Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Self healing AI capability doesn't repeat waitForVisible/waitForElement step healing for more than 1 BDD scenario (test) #4527

Open
ikwefy opened this issue Oct 25, 2024 · 0 comments

Comments

@ikwefy
Copy link

ikwefy commented Oct 25, 2024

What are you trying to achieve?

We would like to use self healing AI capability https://codecept.io/ai/#self-healing-tests on CI with non default steps (waitForVisible/waitForElement) for more then 1 BDD scenario (test)

@test
Feature: Check that self healing works for more then 1 scenario

    Scenario: Self-healing test 1
        Given The tests is logged into Application
        
    Scenario: Self-healing test 2
        Given The tests is logged into Application

What do you get instead?

Self-healing is being invoked for the first scenario (test) on waitForVisible step and doesn't for the second on the same step.

  • logs from 1st scenario:
    [1]  Error (Non-Terminated) | Error: element ({id: usernameee}) still not present on page after 15 sec
locator.waitFor: Timeout 15000ms exceeded.
Call log:
  - waiting for locator('#usernameee').first()
 | async (err) => { isHealing = true if (caughtError ...
  codeceptjs:heal Self-healing started I.waitForElement({"id":"usernameee"}, 15) +0ms
      › Trying to heal I.waitForElement({"id":"usernameee"}, 15) step
  • logs from 2nd scenario:
    [3]  Error (Non-Terminated) | Error: element ({id: usernameee}) still not present on page after 15 sec
locator.waitFor: Timeout 15000ms exceeded.
Call log:
  - waiting for locator('#usernameee').first()
 | (err) => { step.status = 'failed'; step.endTime = ...
    [3] Error | Error: element ({id: usernameee}) still not present on page after 15 sec
locator.waitFor: Timeout 15000ms exceeded.
Call log:
  - waiting for locator('#usernameee').first()
 undefined...
    [3] <teardown>  Stopping recording promises
heal.addRecipe('ai', {
  priority: 1,
  prepare: {
    html: ({ I }) => I.grabHTMLFrom('body'),
  },
  steps: [
    'waitForVisible',
    'waitForInvisible',
    'waitForElement',
  ],
  fn: async args => {
    return ai.healFailedStep(args);
  },
});

Details

  • CodeceptJS version:3.6.6
  • NodeJS Version:18.17.0
  • Operating System:MacOS
  • Playwright: 1.46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant