You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ai.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
permalink: /ai
3
-
title: Testing with AI 🪄
3
+
title: Testing with AI 🪄
4
4
---
5
5
6
6
# 🪄 Testing with AI
@@ -37,7 +37,7 @@ AI providers have limits on input tokens but HTML pages can be huge. However, so
37
37
38
38
Even though, the HTML is still quite big and may exceed the token limit. So we recommend using models with at least 16K input tokens, (approx. 50K of HTML text), which should be enough for most web pages. It is possible to strictly limit the size of HTML to not exceed tokens limit.
39
39
40
-
> ❗AI features require sending HTML contents to AI provider. Choosing one may depend on the descurity policy of your company. Ask your security department which AI providers you can use.
40
+
> ❗AI features require sending HTML contents to AI provider. Choosing one may depend on the descurity policy of your company. Ask your security department which AI providers you can use.
@@ -260,7 +260,7 @@ async function makeApiRequest(endpoint, deploymentId, messages) {
260
260
}
261
261
```
262
262
263
-
### Writing Tests with AI Copilot
263
+
## Writing Tests with AI Copilot
264
264
265
265
If AI features are enabled when using [interactive pause](/basics/#debug) with `pause()` command inside tests:
266
266
@@ -302,11 +302,11 @@ GPT will generate code and data and CodeceptJS will try to execute its code. If
302
302
303
303
This AI copilot works best with long static forms. In the case of complex and dynamic single-page applications, it may not perform as well, as the form may not be present on HTML page yet. For instance, interacting with calendars or inputs with real-time validations (like credit cards) can not yet be performed by AI.
304
304
305
-
Please keep in mind that GPT can't react to page changes and operates with static text only. This is why it is not ready yet to write the test completely. However, if you are new to CodeceptJS and automated testing AI copilot may help you write tests more efficiently.
305
+
Please keep in mind that GPT can't react to page changes and operates with static text only. This is why it is not ready yet to write the test completely. However, if you are new to CodeceptJS and automated testing AI copilot may help you write tests more efficiently.
306
306
307
307
> 👶 Enable AI copilot for junior test automation engineers. It may help them to get started with CodeceptJS and to write good semantic locators.
308
308
309
-
### Self-Healing Tests
309
+
## Self-Healing Tests
310
310
311
311
In large test suites, the cost of maintaining tests goes exponentially. That's why any effort that can improve the stability of tests pays itself. That's why CodeceptJS has concept of [heal recipes](./heal), functions that can be executed on a test failure. Those functions can try to revive the test and continue execution. When combined with AI, heal recipe can ask AI provider how to fix the test. It will provide error message, step being executed and HTML context of a page. Based on this information AI can suggest the code to be executed to fix the failing test.
312
312
@@ -358,7 +358,7 @@ When execution finishes, you will receive information on token usage and code su
358
358
By evaluating this information you will be able to check how effective AI can be for your case.
359
359
360
360
361
-
### Arbitrary GPT Prompts
361
+
## Arbitrary Prompts
362
362
363
363
What if you want to take AI on the journey of test automation and ask it questions while browsing pages?
364
364
@@ -412,7 +412,7 @@ npx codeceptjs shell --ai
412
412
413
413
Also this is availble from `pause()` if AI helper is enabled,
414
414
415
-
Ensure that browser is started in window mode, then browse the web pages on your site.
415
+
Ensure that browser is started in window mode, then browse the web pages on your site.
416
416
On a page you want to create PageObject execute `askForPageObject()` command. The only required parameter is the name of a page:
417
417
418
418
```js
@@ -438,6 +438,8 @@ If page object has `clickForgotPassword` method you can execute it as:
438
438
=>page.clickForgotPassword()
439
439
```
440
440
441
+
Here is an example of a session:
442
+
441
443
```shell
442
444
Page object for login is saved to .../output/loginPage-1718579784751.js
443
445
Page object registered forthis session as `page` variable
@@ -481,11 +483,11 @@ GPT prompts and HTML compression can also be configured inside `ai` section of `
Waits for element to become disabled (by default waits for 1sec).
27
+
Element can be located by CSS or XPath.
28
+
**[param](https://github.com/param)** {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator. **[param](https://github.com/param)** {number} [sec=1] (optional) time in seconds to wait, 1 by default. **[returns](https://github.com/returns)** {void} automatically synchronized promise through #recorder
29
+
```
30
+
31
+
🐛 *Bug Fixes*
32
+
* fix(AI): AI is not triggered ([#4422](https://github.com/codeceptjs/CodeceptJS/issues/4422)) - by **[kobenguyent](https://github.com/kobenguyent)**
* docs: setup azure open ai using bearer token ([#4434](https://github.com/codeceptjs/CodeceptJS/issues/4434)) - by **[kobenguyent](https://github.com/kobenguyent)**
38
+
10
39
## 3.6.4
11
40
12
41
❤️ Thanks all to those who contributed to make this release! ❤️
Copy file name to clipboardExpand all lines: docs/community-helpers.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,6 @@ Please **add your own** by editing this page.
43
43
*[codeceptjs-slack-reporter](https://www.npmjs.com/package/codeceptjs-slack-reporter) Get a Slack notification when one or more scenarios fail.
44
44
*[codeceptjs-browserlogs-plugin](https://github.com/pavkam/codeceptjs-browserlogs-plugin) Record the browser logs for failed tests.
45
45
*[codeceptjs-testrail](https://github.com/PeterNgTr/codeceptjs-testrail) - a plugin to integrate with [Testrail](https://www.gurock.com/testrail)
46
-
*[codeceptjs-monocart-coverage](https://github.com/cenfun/codeceptjs-monocart-coverage) - a plugin to generate coverage reports, it integrate with [monocart coverage reports](https://github.com/cenfun/monocart-coverage-reports)
47
46
48
47
## Browser request control
49
48
*[codeceptjs-resources-check](https://github.com/luarmr/codeceptjs-resources-check) Load a URL with Puppeteer and listen to the requests while the page is loading. Enabling count the number or check the sizes of the requests.
0 commit comments