Skip to content

Commit a11fe4e

Browse files
DavertMikDavertMikclaude
authored
Chore/remove react (#5568)
* minor docs update * replace runok with bunosh, removed react locators * docs: remove React docs page, document react/vue locator removal in migration guide - delete docs/react.md (page removed, dropped from sidebar) - migration-4.md: add 'React and Vue Locators removed' section recommending ARIA locators + resq removed from dependency table - locators.md / webdriver.md: drop /react links, point to ARIA locators Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: DavertMik <davert@testomat.io> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent e37977a commit a11fe4e

49 files changed

Lines changed: 1169 additions & 811 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Bunoshfile.js

Lines changed: 834 additions & 0 deletions
Large diffs are not rendered by default.

docs/ai.md

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
permalink: /ai
3-
title: Testing with AI 🪄
3+
title: Testing with AI
44
---
55

6-
# 🪄 Testing with AI
6+
# Testing with AI
77

88
**CodeceptJS is the first open-source test automation framework with AI** features to improve the testing experience. CodeceptJS uses AI provider like OpenAI or Anthropic to auto-heal failing tests, assist in writing tests, and more...
99

1010
Think of it as your testing co-pilot built into the testing framework
1111

12-
> 🪄 **AI features for testing are experimental**. AI works only for web based testing with Playwright, WebDriver, etc. Those features will be improved based on user's experience.
12+
> This is guide on using AI features inside CodeceptJS. To control CodeceptJS via AI Agents, see [Agentic Testing Guide](/agents/).
1313
1414
## How AI Improves Automated Testing
1515

@@ -164,50 +164,6 @@ The AI SDK supports 20+ providers including:
164164

165165
See [AI SDK Providers](https://ai-sdk.dev/docs/foundations/providers-and-models) for complete list and configuration details.
166166

167-
## Writing Tests with AI Copilot
168-
169-
If AI features are enabled when using [interactive pause](/basics/#debug) with `pause()` command inside tests:
170-
171-
For instance, let's create a test to try ai features via `gt` command:
172-
173-
```
174-
npx codeceptjs gt
175-
```
176-
177-
Name a test and write the code. We will use `Scenario.only` instead of Scenario to execute only this exact test.
178-
179-
```js
180-
Feature('ai')
181-
182-
Scenario.only('test ai features', ({ I }) => {
183-
I.amOnPage('https://getbootstrap.com/docs/5.1/examples/checkout/')
184-
pause()
185-
})
186-
```
187-
188-
Now run the test in debug mode with AI enabled:
189-
190-
```
191-
npx codeceptjs run --debug --ai
192-
```
193-
194-
When pause mode started you can ask GPT to fill in the fields on this page. Use natural language to describe your request, and provide enough details that AI could operate with it. It is important to include at least a space char in your input, otherwise, CodeceptJS will consider the input to be JavaScript code.
195-
196-
```
197-
I.fill checkout form with valid values without submitting it
198-
```
199-
200-
![](/img/fill_form_1.png)
201-
202-
GPT will generate code and data and CodeceptJS will try to execute its code. If it succeeds, the code will be saved to history and you will be able to copy it to your test.
203-
204-
![](/img/fill_form2.png)
205-
206-
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.
207-
208-
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.
209-
210-
> 👶 Enable AI copilot for junior test automation engineers. It may help them to get started with CodeceptJS and to write good semantic locators.
211167

212168
## Self-Healing Tests
213169

@@ -409,9 +365,7 @@ ai: {
409365
410366
CodeceptJS uses three main prompts for AI features:
411367
412-
- `writeStep` - generates test code in interactive pause mode
413368
- `healStep` - suggests fixes for failing tests
414-
- `generatePageObject` - creates page objects from HTML
415369
416370
To customize a prompt, generate it using:
417371
@@ -452,9 +406,7 @@ You can also override prompts programmatically in config:
452406
```js
453407
ai: {
454408
prompts: {
455-
writeStep: (html, input) => [{ role: 'user', content: 'As a test engineer...' }]
456409
healStep: (html, { step, error, prevSteps }) => [{ role: 'user', content: 'As a test engineer...' }]
457-
generatePageObject: (html, extraPrompt = '', rootLocator = null) => [{ role: 'user', content: 'As a test engineer...' }]
458410
}
459411
}
460412
```

docs/helpers/ApiDataFactory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: ApiDataFactory
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## ApiDataFactory

docs/helpers/Appium.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: Appium
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## Appium

docs/helpers/Detox.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ title: Detox
77
# Detox
88

99

10+
---
11+
permalink: /helpers/Detox
12+
sidebar: auto
13+
title: Detox
14+
---
15+
16+
# Detox
17+
18+
1019
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
1120

1221
## Detox

docs/helpers/FileSystem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: FileSystem
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## FileSystem

docs/helpers/GraphQL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: GraphQL
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## GraphQL

docs/helpers/GraphQLDataFactory.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: GraphQLDataFactory
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## GraphQLDataFactory

docs/helpers/JSONResponse.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: JSONResponse
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## JSONResponse

docs/helpers/Playwright.md

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar: auto
55
title: Playwright
66
---
77

8+
89
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
910

1011
## Playwright
@@ -46,14 +47,14 @@ Type: [object][6]
4647
* `url` **[string][9]?** base url of website to be tested
4748
* `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
4849
* `show` **[boolean][27]?** show browser window.
49-
* `restart` **([string][9] | [boolean][27])?** restart strategy between tests. Possible values:* 'context' or **false** - restarts [browser context][45] but keeps running browser. Recommended by Playwright team to keep tests isolated.
50+
* `restart` **([string][9] | [boolean][27])?** restart strategy between tests. Possible values:* 'context' or **false** - restarts [browser context][44] but keeps running browser. Recommended by Playwright team to keep tests isolated.
5051
* 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
51-
* `timeout` **[number][18]?** * [timeout][46] in ms of all Playwright actions .
52+
* `timeout` **[number][18]?** * [timeout][45] in ms of all Playwright actions .
5253
* `disableScreenshots` **[boolean][27]?** don't save screenshot on failure.
5354
* `emulate` **any?** browser in device emulation mode.
5455
* `video` **[boolean][27]?** enables video recording for failed tests; videos are saved into `output/videos` folder
5556
* `keepVideoForPassedTests` **[boolean][27]?** save videos for passed tests; videos are saved into `output/videos` folder
56-
* `trace` **[boolean][27]?** record [tracing information][47] with screenshots and snapshots.
57+
* `trace` **[boolean][27]?** record [tracing information][46] with screenshots and snapshots.
5758
* `keepTraceForPassedTests` **[boolean][27]?** save trace for passed tests.
5859
* `fullPageScreenshots` **[boolean][27]?** make full page screenshots on failure.
5960
* `uniqueScreenshotNames` **[boolean][27]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
@@ -73,13 +74,13 @@ Type: [object][6]
7374
* `chromium` **[object][6]?** pass additional chromium options
7475
* `firefox` **[object][6]?** pass additional firefox options
7576
* `electron` **[object][6]?** (pass additional electron options
76-
* `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][48].
77-
* `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][49].
77+
* `channel` **any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][47].
78+
* `ignoreLog` **[Array][10]<[string][9]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][48].
7879
* `ignoreHTTPSErrors` **[boolean][27]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
7980
* `bypassCSP` **[boolean][27]?** bypass Content Security Policy or CSP
8081
* `highlightElement` **[boolean][27]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
8182
* `recordHar` **[object][6]?** record HAR and will be saved to `output/har`. See more of [HAR options][3].
82-
* `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][50].
83+
* `testIdAttribute` **[string][9]?** locate elements based on the testIdAttribute. See more of [locate by test id][49].
8384
* `storageState` **([string][9] | [object][6])?** Playwright storage state (path to JSON file or object)
8485
passed directly to `browser.newContext`.
8586
If a Scenario is declared with a `cookies` option (e.g. `Scenario('name', { cookies: [...] }, fn)`),
@@ -2794,8 +2795,6 @@ Returns **void** automatically synchronized promise through #recorder
27942795

27952796
### waitForVisible
27962797

2797-
This method accepts [React selectors][44].
2798-
27992798
Waits for an element to become visible on a page (by default waits for 1sec).
28002799
Element can be located by CSS or XPath.
28012800

@@ -2959,16 +2958,14 @@ Returns **void** automatically synchronized promise through #recorder
29592958

29602959
[43]: https://playwright.dev/docs/api/class-page#page-wait-for-url
29612960

2962-
[44]: https://codecept.io/react
2963-
2964-
[45]: https://playwright.dev/docs/api/class-browsercontext
2961+
[44]: https://playwright.dev/docs/api/class-browsercontext
29652962

2966-
[46]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
2963+
[45]: https://playwright.dev/docs/api/class-page#page-set-default-timeout
29672964

2968-
[47]: https://playwright.dev/docs/trace-viewer
2965+
[46]: https://playwright.dev/docs/trace-viewer
29692966

2970-
[48]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
2967+
[47]: https://playwright.dev/docs/browsers/#google-chrome--microsoft-edge
29712968

2972-
[49]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
2969+
[48]: https://playwright.dev/docs/api/class-consolemessage#console-message-type
29732970

2974-
[50]: https://playwright.dev/docs/locators#locate-by-test-id
2971+
[49]: https://playwright.dev/docs/locators#locate-by-test-id

0 commit comments

Comments
 (0)