Skip to content

Commit 3ba96d1

Browse files
authored
release 3.7.5 (#5198)
1 parent 5a440e2 commit 3ba96d1

File tree

2 files changed

+169
-1
lines changed

2 files changed

+169
-1
lines changed

CHANGELOG.md

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,171 @@
1+
## 3.7.5
2+
3+
❤️ Thanks all to those who contributed to make this release! ❤️
4+
5+
## ✨ Features
6+
7+
- feat: Add configurable sensitive data masking with custom patterns (#5109)
8+
9+
### Backward Compatible Boolean Configuration
10+
11+
```js
12+
// codecept.conf.js
13+
exports.config = {
14+
maskSensitiveData: true, // Uses built-in patterns for common sensitive data
15+
// ... other config
16+
}
17+
```
18+
19+
### Advanced Custom Patterns Configuration
20+
21+
```js
22+
// codecept.conf.js
23+
exports.config = {
24+
maskSensitiveData: {
25+
enabled: true,
26+
patterns: [
27+
{
28+
name: 'Email',
29+
regex: /(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b)/gi,
30+
mask: '[MASKED_EMAIL]'
31+
},
32+
{
33+
name: 'Credit Card',
34+
regex: /\b(?:\d{4}[- ]?){3}\d{4}\b/g,
35+
mask: '[MASKED_CARD]'
36+
},
37+
{
38+
name: 'Phone Number',
39+
regex: /(\+?1[-.\s]?)?\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})/g,
40+
mask: '[MASKED_PHONE]'
41+
}
42+
]
43+
},
44+
// ... other config
45+
}
46+
47+
## Example Output
48+
49+
With the above configuration, sensitive data is automatically masked:
50+
51+
**Before:**
52+
53+
Given I have user email "[email protected]"
54+
And I have credit card "4111 1111 1111 1111"
55+
And I have phone number "+1-555-123-4567"
56+
57+
58+
**After:**
59+
60+
Given I have user email "[MASKED_EMAIL]"
61+
And I have credit card "[MASKED_CARD]"
62+
And I have phone number "[MASKED_PHONE]"
63+
```
64+
65+
- feat(playwright): Add Custom Strategy Locators support (#5090)
66+
67+
```js
68+
exports.config = {
69+
helpers: {
70+
Playwright: {
71+
url: 'http://localhost',
72+
browser: 'chromium',
73+
customLocatorStrategies: {
74+
byRole: (selector, root) => {
75+
return root.querySelector(`[role="${selector}"]`);
76+
},
77+
byTestId: (selector, root) => {
78+
return root.querySelector(`[data-testid="${selector}"]`);
79+
},
80+
byDataQa: (selector, root) => {
81+
const elements = root.querySelectorAll(`[data-qa="${selector}"]`);
82+
return Array.from(elements); // Return array for multiple elements
83+
}
84+
}
85+
}
86+
}
87+
}
88+
89+
And used in tests with the same syntax as other locator types:
90+
91+
I.click({byRole: 'button'}); // Find by role attribute
92+
I.see('Welcome', {byTestId: 'title'}); // Find by data-testid
93+
I.fillField({byDataQa: 'email'}, '[email protected]');
94+
```
95+
96+
- feat(reporter): Enable HTML reporter by default in new projects (#5105)
97+
98+
```
99+
plugins: {
100+
htmlReporter: {
101+
enabled: true
102+
}
103+
}
104+
```
105+
106+
![HTML report](https://github.com/codeceptjs/CodeceptJS/raw/3.x/docs/shared/html-reporter-main-dashboard.png)
107+
108+
- feat(cli): make test file hyperlink clickable (#5078) - by @kobenguyent
109+
![test file hyperlink clickable](https://private-user-images.githubusercontent.com/7845001/479922301-a2a21480-00d8-4508-8bf6-d4bf5630e06a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTg1MzA1MTUsIm5iZiI6MTc1ODUzMDIxNSwicGF0aCI6Ii83ODQ1MDAxLzQ3OTkyMjMwMS1hMmEyMTQ4MC0wMGQ4LTQ1MDgtOGJmNi1kNGJmNTYzMGUwNmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDkyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA5MjJUMDgzNjU1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDE2OGE2YTY5NGZiNmU1NWU2YjA0NmI1ZTZhN2M0MTgzODE3MDNhYTZiM2IzMGU0Y2U1NzY3OWNmNDVlZjJjNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.iyq8LmTLSwoYIoCY4lBAIQRFGAEBYSq3JTO9ePfNWBg)
110+
111+
- feat: Introduce CodeceptJS WebElement Class to mirror helpers’ element instance (#5091)
112+
113+
### Unified API Methods
114+
115+
- **Element Properties**: `getText()`, `getAttribute()`, `getProperty()`, `getInnerHTML()`, `getValue()`
116+
- **Element State**: `isVisible()`, `isEnabled()`, `exists()`, `getBoundingBox()`
117+
- **Element Interactions**: `click()`, `type()`
118+
- **Child Element Search**: `$()` and `$$()` methods for finding sub-elements
119+
- **Native Access**: `getNativeElement()` and `getHelper()` for advanced operations
120+
121+
### Updated Helper Methods
122+
123+
- `grabWebElement()` and `grabWebElements()` now return `WebElement` instances instead of native elements
124+
- Added missing `grabWebElement()` method to WebDriver and Puppeteer helpers
125+
- Maintains backward compatibility through `getNativeElement()` method
126+
127+
```
128+
// Works consistently across all helpers
129+
const element = await I.grabWebElement('#button');
130+
const text = await element.getText();
131+
const childElements = await element.$$('.child');
132+
await element.click();
133+
134+
// Element searching within elements
135+
const form = await I.grabWebElement('#contact-form');
136+
const nameInput = await form.$('#name');
137+
await nameInput.type('John Doe');
138+
```
139+
140+
- feat: support `feature.only` like `Scenario.only` (#5087)
141+
Example:
142+
143+
```js
144+
Feature.only('Checkout Flow', () => {
145+
Scenario('complete order', ({ I }) => {
146+
// test steps here
147+
})
148+
})
149+
```
150+
151+
---
152+
153+
## 🐛 Bug Fixes
154+
155+
- fix(utils): resolve command injection vulnerability in `emptyFolder` (#5190) - by @mhassan1
156+
- bugfix: prevent WebDriver error without Bidi protocol (#5095) - by @ngraf
157+
- fix(playwright): relaunch browser correctly with `restart: 'session'` in `run-workers --by pool` (#5118) - by @Samuel-StO
158+
- fix: JSONResponse helper to preserve original `onResponse` behavior (#5106) - by @myprivaterepo
159+
- fix: use `platformName` for mobile click detection (Android touchClick bug) (#5107) - by @mirao
160+
- fix: Properly stop network traffic recording (#5127) - by @Samuel-StO
161+
- fix: mocha retries losing CodeceptJS-specific properties (#5099)
162+
- fix: missing `codeceptjs/effects` types (#5094) - by @kobenguyent
163+
- fix: tryTo steps appearing in test failure traces (#5088)
164+
- fix: JUnit XML test case name inconsistency with retries (#5082)
165+
- fix: waitForText timeout regression in Playwright helper (#5093)
166+
- fix(Playwright): I.waitForText() caused unexpected delay (#5077)
167+
- fix: I.seeResponseContainsJson not working (#5081)
168+
1169
## 3.7.4
2170

3171
❤️ Thanks all to those who contributed to make this release! ❤️

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.4",
3+
"version": "3.7.5",
44
"description": "Supercharged End 2 End Testing Framework for NodeJS",
55
"keywords": [
66
"acceptance",

0 commit comments

Comments
 (0)