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
This project is migrating from 3.x to ESM replacing all require() calls with imports.
3
+
CodeceptJS is a full-featured End-to-End testing framework for web and native apps. It is built on top of WebDriverIO, Appium, and Puppeteer, and provides a simple and intuitive API for writing tests.
4
4
5
-
## Compare with Reference
5
+
## Rules
6
6
7
-
Each time unsure what to do refer to the same file implementation in **3.x branch**
8
-
3.x branch contains stable version of all core classes that work
7
+
## Testing with Shell Command
9
8
10
-
## Running Tests
11
-
12
-
Focus on acceptance tests:
13
-
14
-
For instance this helps to understand if final migration is ok:
9
+
To quickly test CodeceptJS features without writing full test files, use the shell command with a script file:
15
10
11
+
1. Create a temporary script file (e.g., `/tmp/test-script.js`):
12
+
```javascript
13
+
I.amOnPage('https://example.com')
14
+
I.click('Login')
15
+
I.fillField('Email', 'test@example.com')
16
16
```
17
-
DEBUG="codeceptjs:*" ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --verbose
18
-
19
-
DEBUG="codeceptjs:*" ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --debug --grep within
20
-
```
21
-
22
-
Do not say: it works befire running specific acceptance test.
23
-
Tests may stuck so always run them with timeout call:
timeout=30000 ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --verbose
27
-
```
28
-
29
-
Web Server for this tests are running on port 8000 and it works but responds 500 for HEAD requests.
30
-
31
-
## Princinples
32
-
33
-
All unit tests for Playwright/Puppeteer/WebdriverIO are passing. But acceptance tests are failing due to promises composition. Complexity of promises composition comes from promise chaining and async/await syntax. And `session` mechanism from `promise.js` which allows spawning different promises chains and sync them up in the end.
34
-
35
-
The full test suite extensively uses plugins so refer to plugins and corresponding helpers as well
36
22
37
-
We are building test framework. So even passing ests are not indicator of successful usage. Side effects like: timeouts, bad output, errors, memory leaks, etc are affecting performance.
38
-
For instance, if a tests stuck and won't finish this is very bad.
23
+
3. Check the output for errors or success messages.
39
24
40
-
## Coding Style
25
+
Notes:
26
+
- Scripts use the global `I` object directly (no imports needed)
27
+
- Commands don't need `await` - they queue automatically via the recorder
28
+
- Use the `examples/` config which has Playwright helper configured
29
+
- The shell initializes the browser and executes commands in sequence
41
30
42
-
- Never add comments unless explicitly required.
43
-
- DO not mention plugins or helpers inside core classes
0 commit comments