Skip to content

Commit a483106

Browse files
authored
release 3.7.4 (#5075)
* release 3.7.4
1 parent ff63f70 commit a483106

File tree

2 files changed

+123
-10
lines changed

2 files changed

+123
-10
lines changed

CHANGELOG.md

Lines changed: 122 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,125 @@
1+
## 3.7.4
2+
3+
❤️ Thanks all to those who contributed to make this release! ❤️
4+
5+
🛩️ _Features_
6+
7+
- **Test Suite Shuffling**: Randomize test execution order to discover test dependencies and improve test isolation (#5051) - by @NivYarmus
8+
9+
```bash
10+
# Shuffle tests to find order-dependent failures using lodash.shuffle algorithm
11+
npx codeceptjs run --shuffle
12+
13+
# Combined with grep and other options
14+
npx codeceptjs run --shuffle --grep "@smoke" --steps
15+
```
16+
17+
- **Enhanced Interactive Debugging**: Better logging for `I.grab*` methods in live interactive mode for clearer debugging output (#4986) - by @owenizedd
18+
19+
```js
20+
// Interactive pause() now shows detailed grab results with JSON formatting
21+
I.amOnPage('/checkout')
22+
pause() // Interactive shell started
23+
> I.grabTextFrom('.price')
24+
Result $res= "Grabbed text: $29.99" // Pretty-printed JSON output
25+
> I.grabValueFrom('input[name="email"]')
26+
{"value":"[email protected]"} // Structured JSON response
27+
```
28+
29+
🐛 _Bug Fixes_
30+
31+
- **Playwright Session Traces**: Fixed trace file naming convention and improved error handling for multi-session test scenarios (#5073) - by @julien-ft-64 @kobenguyent
32+
33+
```js
34+
// Example outputs:
35+
// - a1b2c3d4-e5f6_checkout_login_test.failed.zip
36+
// - b2c3d4e5-f6g7_admin_dashboard_test.failed.zip
37+
```
38+
39+
_Trace files use UUID prefixes with `sessionName_testTitle.status.zip` format_
40+
41+
- **Worker Data Injection**: Resolved proxy object serialization preventing data sharing between parallel test workers (#5072) - by @kobenguyent
42+
43+
```js
44+
// Fixed: Complex objects can now be properly shared and injected between workers
45+
// Bootstrap data sharing in codecept.conf.js:
46+
exports.config = {
47+
bootstrap() {
48+
share({
49+
userData: { id: 123, preferences: { theme: 'dark' } },
50+
apiConfig: { baseUrl: 'https://api.test.com', timeout: 5000 },
51+
})
52+
},
53+
}
54+
55+
// In tests across different workers:
56+
const testData = inject()
57+
console.log(testData.userData.preferences.theme) // 'dark' - deep nesting works
58+
console.log(Object.keys(testData)) // ['userData', 'apiConfig'] - key enumeration works
59+
60+
// Dynamic sharing during test execution:
61+
share({ newData: 'shared across workers' })
62+
```
63+
64+
- **Hook Exit Codes**: Fixed improper exit codes when test hooks fail, ensuring CI/CD pipelines properly detect failures (#5058) - by @kobenguyent
65+
66+
```bash
67+
# Before: Exit code 0 even when beforeEach/afterEach failed
68+
# After: Exit code 1 when any hook fails, properly failing CI builds
69+
```
70+
71+
- **TypeScript Effects Support**: Added complete TypeScript definitions for effects functionality (#5027) - by @kobenguyent
72+
73+
```typescript
74+
// Import effects with full TypeScript type definitions
75+
import { tryTo, retryTo, within } from 'codeceptjs/effects'
76+
77+
// tryTo returns Promise<boolean> for conditional actions
78+
const success: boolean = await tryTo(async () => {
79+
await I.see('Cookie banner')
80+
await I.click('Accept')
81+
})
82+
83+
// retryTo with typed parameters for reliability
84+
await retryTo(() => {
85+
I.click('Submit')
86+
I.see('Success')
87+
}, 3) // retry up to 3 times
88+
```
89+
90+
_Note: Replaces deprecated global plugins - import from 'codeceptjs/effects' module_
91+
92+
- **Mochawesome Screenshot Uniqueness**: Fixed screenshot naming to prevent test failures from being overwritten when multiple tests run at the same time (#4959) - by @Lando1n
93+
94+
```js
95+
// Problem: When tests run in parallel, screenshots had identical names
96+
// This caused later test screenshots to overwrite earlier ones
97+
98+
// Before: All failed tests saved as "screenshot.png"
99+
// Result: Only the last failure screenshot was kept
100+
101+
// After: Each screenshot gets a unique name with timestamp
102+
// Examples:
103+
// - "login_test_1645123456.failed.png"
104+
// - "checkout_test_1645123789.failed.png"
105+
// - "profile_test_1645124012.failed.png"
106+
107+
// Configuration in codecept.conf.js:
108+
helpers: {
109+
Mochawesome: {
110+
uniqueScreenshotNames: true // Enable unique naming
111+
}
112+
}
113+
```
114+
115+
_Ensures every failed test keeps its own screenshot for easier debugging_
116+
117+
📖 _Documentation_
118+
119+
- Fixed Docker build issues and improved container deployment process (#4980) - by @thomashohn
120+
- Updated dependency versions to maintain security and compatibility (#4957, #4950, #4943) - by @thomashohn
121+
- Fixed automatic documentation generation system for custom plugins (#4973) - by @Lando1n
122+
1123
## 3.7.3
2124

3125
❤️ Thanks all to those who contributed to make this release! ❤️
@@ -481,7 +603,6 @@ I.flushSoftAssertions() // Throws an error if any soft assertions have failed. T
481603
```
482604
483605
- feat(cli): print failed hooks (#4476) - by @kobenguyent
484-
485606
- run command
486607
![Screenshot 2024-09-02 at 15 25 20](https://github.com/user-attachments/assets/625c6b54-03f6-41c6-9d0c-cd699582404a)
487608
@@ -744,7 +865,6 @@ heal.addRecipe('reloadPageIfModalIsNotVisisble', {
744865
```
745866
746867
- **Breaking Change** **AI** features refactored. Read updated [AI guide](./ai):
747-
748868
- **removed dependency on `openai`**
749869
- added support for **Azure OpenAI**, **Claude**, **Mistal**, or any AI via custom request function
750870
- `--ai` option added to explicitly enable AI features
@@ -755,7 +875,6 @@ heal.addRecipe('reloadPageIfModalIsNotVisisble', {
755875
- `OpenAI` helper renamed to `AI`
756876
757877
- feat(puppeteer): network traffic manipulation. See #4263 by @KobeNguyenT
758-
759878
- `startRecordingTraffic`
760879
- `grabRecordedNetworkTraffics`
761880
- `flushNetworkTraffics`
@@ -2096,7 +2215,6 @@ await I.seeTraffic({
20962215

20972216
- **🪄 [AI Powered Test Automation](/ai)** - use OpenAI as a copilot for test automation. #3713 By @davertmik
20982217
![](https://user-images.githubusercontent.com/220264/250418764-c382709a-3ccb-4eb5-b6bc-538f3b3b3d35.png)
2099-
21002218
- [AI guide](/ai) added
21012219
- added support for OpenAI in `pause()`
21022220
- added [`heal` plugin](/plugins#heal) for self-healing tests
@@ -2107,7 +2225,6 @@ await I.seeTraffic({
21072225
![](https://user-images.githubusercontent.com/220264/250415226-a7620418-56a4-4837-b790-b15e91e5d1f0.png)
21082226

21092227
- [Playwright] Support for APIs in Playwright (#3665) - by Egor Bodnar
2110-
21112228
- `clearField` replaced to use new Playwright API
21122229
- `blur` added
21132230
- `focus` added
@@ -3519,9 +3636,7 @@ I.seeFile(fileName)
35193636
## 2.0.0
35203637
35213638
- [WebDriver] **Breaking Change.** Updated to webdriverio v5. New helper **WebDriver** helper introduced.
3522-
35233639
- **Upgrade plan**:
3524-
35253640
1. Install latest webdriverio
35263641
35273642
```
@@ -3538,9 +3653,7 @@ I.seeFile(fileName)
35383653
35393654
- [Appium] **Breaking Change.** Updated to use webdriverio v5 as well. See upgrade plan ↑
35403655
- [REST] **Breaking Change.** Replaced `unirest` library with `axios`.
3541-
35423656
- **Upgrade plan**:
3543-
35443657
1. Refer to [axios API](https://github.com/axios/axios).
35453658
2. If you were using `unirest` requests/responses in your tests change them to axios format.
35463659

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeceptjs",
3-
"version": "3.7.3",
3+
"version": "3.7.4",
44
"description": "Supercharged End 2 End Testing Framework for NodeJS",
55
"keywords": [
66
"acceptance",

0 commit comments

Comments
 (0)