-1

I'm currently evaluating CodeceptJS as an alternative to our heavy Java/Selenium/Cucumber stack. I have organized the project like so:

  • BDD is used (everything starts with a feature file).
  • Step definitions exist for each of the steps in the feature files.
  • Step definitions use methods within a corresponding page object.

When I run the example project, I get output like this:

USER REGISTRATION --
  As someone who is not a member
  I would like the ability to sign up
  So that I can enjoy the benefits of Widget XYZ's services
  Register account from the signed out homepage
    Given I open the homepage 
      signedOutHomePage: open 
  ✔ OK in 3230ms

The above test is executed using:

npx codeceptjs run --steps

Is it possible to suppress the output of the Page Object (i.e. so the line signedOutHomePage: open is not diplayed)?

UPDATE (another question): Should I even use PageObjects if I'm using BDD?

Vanessa Deagan
  • 387
  • 4
  • 13
  • You should avoid asking more than once question at a time. And it is OK to use page objects with BDD. I do it all the time. Can you post the code for the page object? Looks like something is writing to standard output, and that is what you are seeing. – Greg Burghardt Feb 04 '20 at 16:38

1 Answers1

0

It appears that whenever the --steps flag is used, any method calls in step definitions will be listed. Without the --steps flag, only the Scenario heading is displayed. It looks like there's no way around this. I'll create a feature request to the CodeceptJS team.

Vanessa Deagan
  • 387
  • 4
  • 13