Skip to content

Need to Skip test cases under a fixture If previous test of the same fixture failed #8335

@SamShot81

Description

@SamShot81

What is your Scenario?

I am working with a situation where I have the following scenario/steps to Test

  1. Create
  2. Edit
  3. Delete

I have the test cases ready but I need a way to skip the Edit and Delete TCs if the Create TC fails. In other words I need to chain them together so the system understands that if Create was not successful then skip the Edit and Delete test cases (Conditional Skipping).

Is it possible with any existing process like hooks/test Context?

Is there any logic I can use to make this happen?

Thanks in Advance.

Expecting something like below

What are you suggesting?

test('Verify Create New Account Functioning Successfully', async (t: TestController) => {
    // if this fails, I can set a variable x=fail
});

test('Verify Edit Account Functioning Successfully', async (t: TestController) => {
    // Skip this as create test case failed
    if(x == fail) {
        test.skip(t.this test);
    }
});

What alternatives have you considered?

Could not find any material regarding this in testcafe documentation.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TYPE: enhancementThe accepted proposal for future implementation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions