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

オープン
#4,527 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, nodejs, playwright
領域
ai, testing-qa

調査の方向性

Start with the heal.addRecipe('ai', ...) configuration and the ai.healFailedStep entry point shown in the issue. Reproduce the two-scenario BDD case with waitForVisible or waitForElement on the listed CodeceptJS, Node.js, and Playwright versions, then trace why healing runs only for the first scenario. Done means the second scenario also invokes self-healing and its logs show the healing attempt.

索引モデルが issue の本文から書いたものです。

説明

stale
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
主要言語
JavaScript
スター
4.2k
フォーク
756
平均マージ
2日 9時間
マージ済み PR(30日)
16

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。