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

Nesting step() within step() skips over the the nested step() #36

Open
jeffb-sfdc opened this issue Dec 15, 2022 · 0 comments
Open

Nesting step() within step() skips over the the nested step() #36

jeffb-sfdc opened this issue Dec 15, 2022 · 0 comments

Comments

@jeffb-sfdc
Copy link

We have test code along the lines of:

describe('Some group', async () => {
  step('Set up', async () => {
    // ...
  });

  step('Some category', async () => {
    step('Test something', async () => {
      // ...
    });

    step('Test something else', async () => {
      // ...
    });
    .
    .
    .
  });

  step('Another category', async () => {
    step('Test something', async () => {
      // ...
    });

    step('Test something else', async () => {
      // ...
    });
    .
    .
    .
  });

  step('Tear down', async () => {
    // ...
  });
});

...and I'd like to nest a step() within a step(), but nested steps aren't called. Instead of

Some group
Set up
Some category
Test something
Test something else
Another category
Test something
Test something else
Tear down

...we see:

Some group
Set up
Some category
Another category
Tear down

Would it be possible to add the ability to nest step() within another step() to this library?

We can't use describe() for grouping the categories, like so...

describe('Some group', async () => {
  step('Set up', async () => {
    // ...
  });

  describe('Some category', async () => {
    step('Test something', async () => {
      // ...
    });
.
.
.

...because we need the tests to run in a specific order (this is used for e2e automation tests, not unit tests) and the setup need to run first, and the tear down needs to run last.

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

1 participant