playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature] Allow to fail tests unconditionally with description

Open 4ekki opened this issue 1 year ago • 0 comments

Currently, unconditional test.fail() doesn't accept description. In order to mark test 'failed', I need to use either comments, or use conditional form with 'true':

  test("function works properly", async () => {
    test.fail("Fails because of JIRA-123");                    // doesn't work 
    test.fail(true, "Fails because of JIRA-123");              // works 
    test.fail();  // "Fails because of JIRA-123"               // works 
    expect(0).toBeTruthy();
  });

It would be nice to have ability to add optional description to unconditional test.fail: test.fail(description?:string)

4ekki avatar May 16 '23 09:05 4ekki