Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Before steps into (separate) log groups #922

Closed
3 tasks done
iomedico-beyer opened this issue Jan 12, 2023 · 4 comments
Closed
3 tasks done

Before steps into (separate) log groups #922

iomedico-beyer opened this issue Jan 12, 2023 · 4 comments

Comments

@iomedico-beyer
Copy link

iomedico-beyer commented Jan 12, 2023

Current behavior

v15.1.0 puts test steps (Given, When, Then, And, But) into log groups, which is great! But all the Before stuff is still without log groups.

Also, when multiple Before statements do match, they cannot be distinguished in the log. The all just start by logging “Before”.

Desired behavior

  1. I would love to have one log group for each matching Before statement for a given test scenario.
  2. The group name should also reflect if the Before matches by tag name.

Test code to reproduce

Before(function () {
    cy.log('TODO: login');
});

Before({ tags: '@deleteFoo' }, function () {
    cy.log('TODO: delete foo');
});

Versions

  • Cypress version: 12.3.0
  • Preprocessor version: 15.1.0
  • Node version: 16.16.0

Checklist

  • I've read the FAQ.
  • I've read Instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@iomedico-beyer iomedico-beyer changed the title Before steps into log groups Before steps into (separate) log groups Jan 12, 2023
@badeball
Copy link
Owner

Hey @iomedico-beyer, I've fixed this with v15.1.1.

@iomedico-beyer
Copy link
Author

iomedico-beyer commented Jan 13, 2023

Amazing!

The only thing is that the second point „The group name should also reflect if the Before matches by tag name.“ doesn’t seem to work. The group name is always just „Before“. For the code above with yarn cypress open it looks like this:

image

@badeball
Copy link
Owner

Good idea! Since the requirements are getting a little bit more complex, I think it's warranted that it's tested as well. I think I've seen Cypress themselves testing somewhat similar, where they in a Cypress test actually verifies the runner's appearance. I'd like to dig through their test to find that and replicate it, although I can't right now. If you or anyone finds time though, feel free to do that.

@badeball badeball reopened this Jan 13, 2023
badeball added a commit that referenced this issue May 1, 2023
@badeball
Copy link
Owner

badeball commented May 1, 2023

This has been fixed in v17.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants