Skip to content

Commit eedf001

Browse files
authored
Update ai.md
1 parent d56a260 commit eedf001

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

docs/ai.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,12 +315,28 @@ AI healing can solve exactly one problem: if a locator of an element has changed
315315
316316
> You can define your own [heal recipes](./heal) that won't use AI to revive failing tests.
317317
318-
Heal actions **work only on actions like `click`, `fillField`**, etc, and won't work on assertions, waiters, grabbers, etc. Assertions can't be guessed by AI, the same way as grabbers, as this may lead to unpredictable results.
318+
Heal actions **work only on actions like `click`, `fillField`, etc, and won't work on assertions, waiters, grabbers, etc. Assertions can't be guessed by AI, the same way as grabbers, as this may lead to unpredictable results.
319319
320320
If Heal plugin successfully fixes the step, it will print a suggested change at the end of execution. Take it as actionable advice and use it to update the codebase. Heal plugin is supposed to be used on CI, and works automatically without human assistance.
321321
322322
323-
To start, make sure [AI provider is connected](#set-up-ai-provider), and [heal recipes were created](./heal#how-to-start-healing) and included into `codecept.conf.js` or `codecept.conf.ts` config file. Then enable `heal` plugin:
323+
To start, make sure [AI provider is connected](#set-up-ai-provider), and [heal recipes were created](/heal#how-to-start-healing) by running this command:
324+
325+
```
326+
npx codeceptjs generate:heal
327+
```
328+
329+
Heal recipes should be included into `codecept.conf.js` or `codecept.conf.ts` config file:
330+
331+
```js
332+
333+
require('./heal')
334+
335+
exports.config = {
336+
// ... your codeceptjs config
337+
```
338+
339+
Then enable `heal` plugin:
324340
325341
```js
326342
plugins: {
@@ -330,7 +346,7 @@ plugins: {
330346
}
331347
```
332348
333-
If you tests in AI mode and test fails, a request to AI provider will be sent
349+
If you run tests in AI mode and a test fails, a request to AI provider will be sent
334350
335351
```
336352
npx codeceptjs run --ai

0 commit comments

Comments
 (0)