Skip to content

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

@jeffb-sfdc

Description

@jeffb-sfdc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions