CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

Plugin "retryFailedStep" doesn't work in --debug or --verbose mode, searching for element fails immediately

Open mirao opened this issue 8 months ago • 5 comments

It's a regression in 3.6.0. It works well with 3.5.15.

What are you trying to achieve?

You should see the Retrying... Attempt ... retries in the following test.

This is how it works with 3.5.15 :heavy_check_mark:

CodeceptJS v3.5.15 #StandWithUkraine
Using test root "/home/mirao/workspace/codeceptjs/tests/my"
Helpers: Playwright
Plugins: screenshotOnFail, retryFailedStep

My --
    [1]  Starting recording promises
    Timeouts: 
 › [Session] Starting singleton browser session
  test something
    I see element ".blabla"
    [1] Retrying... Attempt #2
    [1] Retrying... Attempt #3
    [1] Retrying... Attempt #4
    [1] Error (Non-Terminated) | Error: Element ".blabla" is not visible on page. | (err) => { step.status = 'failed'; step.endTime = ...
    [1] Error | Error: Element ".blabla" is not visible on page. undefined...
    [1] <teardown> Stopping recording promises
 › <screenshotOnFail> Test failed, try to save a screenshot
 › Screenshot is saving to /home/mirao/workspace/codeceptjs/tests/my/output/test_something.failed.png
  ✖ FAILED in 1148ms

    [2]  Starting recording promises

-- FAILURES:

  1) My
       test something:
     Element ".blabla" is not visible on page.
      at dontSeeElementError (/home/mirao/workspace/codeceptjs/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/codeceptjs/lib/helper/errors/ElementAssertion.js:23:9)
      at Playwright.seeElement (/home/mirao/workspace/codeceptjs/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/codeceptjs/lib/helper/Playwright.js:1460:7)
  
  Scenario Steps:
  - I.seeElement(".blabla") at Test.<anonymous> (./My_test.ts:4:7)
  
  Artifacts:
  - screenshot: /home/mirao/workspace/codeceptjs/tests/my/output/test_something.failed.png


  FAIL  | 0 passed, 1 failed   // 2s

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

This is how it works with 3.6.0 or 3.6.2 :bug:

CodeceptJS v3.6.0 #StandWithUkraine
Using test root "/home/mirao/workspace/codeceptjs/tests/my"
Helpers: Playwright
Plugins: screenshotOnFail, retryFailedStep

My --
    [1]  Starting recording promises
    Timeouts: 
 › [Session] Starting singleton browser session
  test something
    I see element ".blabla"
    [1]  Error (Non-Terminated) | Error: Element ".blabla" is not visible on page. | (err) => { step.status = 'failed'; step.endTime = ...
    [1] Error | Error: Element ".blabla" is not visible on page. undefined...
    [1] <teardown>  Stopping recording promises
 › <screenshotOnFail> Test failed, try to save a screenshot
 › Screenshot is saving to /home/mirao/workspace/codeceptjs/tests/my/output/test_something.failed.png
  ✖ FAILED in 117ms

    [2]  Starting recording promises

-- FAILURES:

  1) My
       test something:
     Element ".blabla" is not visible on page.
      at dontSeeElementError (/home/mirao/workspace/codeceptjs/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/codeceptjs/lib/helper/errors/ElementAssertion.js:23:9)
      at Playwright.seeElement (/home/mirao/workspace/codeceptjs/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/codeceptjs/lib/helper/Playwright.js:1464:7)
  
  Scenario Steps:
  - I.seeElement(".blabla") at Test.<anonymous> (./My_test.ts:4:7)
  
  Artifacts:
  - screenshot: /home/mirao/workspace/codeceptjs/tests/my/output/test_something.failed.png


  FAIL  | 0 passed, 1 failed   // 574ms

Provide test source code if related

Feature("My");

Scenario("test something", ({ I }) => {
    I.seeElement(".blabla");
});

Details

  • CodeceptJS version: 3.6.0 or 3.6.2
  • NodeJS Version: 18.20
  • Operating System: Ubuntu 22.04
  • Playwright Version 1.43.1
  • Configuration file:
export const config: CodeceptJS.MainConfig = {
    tests: "./*_test.ts",
    output: "./output",
    helpers: {
        Playwright: {
            browser: "chromium",
            url: "http://localhost",
            show: true,
        },
    },
    plugins: {
        retryFailedStep: {
            enabled: true,
        },
    },
    name: "my",
};

mirao avatar Jun 06 '24 12:06 mirao