|
| 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 | + |
| 107 | + |
| 108 | +- feat(cli): make test file hyperlink clickable (#5078) - by @kobenguyent |
| 109 | +  |
| 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 | + |
1 | 169 | ## 3.7.4
|
2 | 170 |
|
3 | 171 | ❤️ Thanks all to those who contributed to make this release! ❤️
|
|
0 commit comments