Releases: codeceptjs/CodeceptJS
4.0.0-rc.2-r3
Add --ignore-scripts option to npm publish command
4.0.0-rc.2-r2
Simplify publish-beta workflow by removing steps Removed dependency installation and npm tag determination steps.
4.0.0-rc.2-r1
Merge branch '4.x' of github.com:codeceptjs/CodeceptJS into 4.x
4.0.0-rc.2
What's Changed
- Bump various minor versions to keeps deps updated by @thomashohn in #4957
- Fix issue with docker build by @thomashohn in #4980
- fix: plugins documentation generation by @Lando1n in #4973
- feat: better I.grab logging in live interactive mode by @owenizedd in #4986
- fix: mochawesome helper with unique screenshots by @Lando1n in #4959
- fix: add api key for REST_test.js by @kobenguyent in #5009
- fix: miss the effects types by @kobenguyent in #5027
- Feat/esm by @DavertMik in #5045
- implemented clickXY action by @DavertMik in #5248
- replaced ai provider with vercel ai sdk by @DavertMik in #5249
- replaced joi with zod by @DavertMik in #5250
- Feat/aria selectors by @DavertMik in #5260
- fix(utils): resolve command injection vulnerability in
emptyFolder(4.x) by @mhassan1 in #5191 - Rebase 3.x by @kobenguyent in #5282
- ci: enable workflows for 4.x by @kobenguyent in #5289
- Appium esm migration by @kobenguyent in #5292
- Fix browser hanging during cleanup by not waiting for browser.close() to complete by @Copilot in #5319
- Fix type definitions for custom helpers with ESM default exports by @Copilot in #5321
- Fix TypeScript ESM module resolution docs - recommend tsx over ts-node/esm by @Copilot in #5324
- Fix TypeScript definitions generation when no helpers configured by @Copilot in #5325
- Fix TypeScript error stack traces by @DenysKuchma in #5403
- restore autocompletion for page objects in TypeScript by @DenysKuchma in #5401
- Export container as named export for ESM by @DenysKuchma in #5382
- Add warning for ts-node/esm usage by @DenysKuchma in #5381
- Remove Custom Locator Strategy from playwright by @DenysKuchma in #5405
- Feat/json locators esm by @DavertMik in #5424
- Add seeCurrentPathEquals method to ignore query strings by @DavertMik in #5435
New Contributors
- @Lando1n made their first contribution in #4973
- @owenizedd made their first contribution in #4986
Full Changelog: 3.7.3...4.0.0-rc.2
3.7.5
3.7.5
❤️ Thanks all to those who contributed to make this release! ❤️
✨ Features
- feat: Add configurable sensitive data masking with custom patterns (#5109)
Backward Compatible Boolean Configuration
// codecept.conf.js
exports.config = {
maskSensitiveData: true, // Uses built-in patterns for common sensitive data
// ... other config
}Advanced Custom Patterns Configuration
// codecept.conf.js
exports.config = {
maskSensitiveData: {
enabled: true,
patterns: [
{
name: 'Email',
regex: /(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b)/gi,
mask: '[MASKED_EMAIL]'
},
{
name: 'Credit Card',
regex: /\b(?:\d{4}[- ]?){3}\d{4}\b/g,
mask: '[MASKED_CARD]'
},
{
name: 'Phone Number',
regex: /(\+?1[-.\s]?)?\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})/g,
mask: '[MASKED_PHONE]'
}
]
},
// ... other config
}
## Example Output
With the above configuration, sensitive data is automatically masked:
**Before:**
Given I have user email "john.doe@company.com"
And I have credit card "4111 1111 1111 1111"
And I have phone number "+1-555-123-4567"
**After:**
Given I have user email "[MASKED_EMAIL]"
And I have credit card "[MASKED_CARD]"
And I have phone number "[MASKED_PHONE]"- feat(playwright): Add Custom Strategy Locators support (#5090)
exports.config = {
helpers: {
Playwright: {
url: 'http://localhost',
browser: 'chromium',
customLocatorStrategies: {
byRole: (selector, root) => {
return root.querySelector(`[role="${selector}"]`);
},
byTestId: (selector, root) => {
return root.querySelector(`[data-testid="${selector}"]`);
},
byDataQa: (selector, root) => {
const elements = root.querySelectorAll(`[data-qa="${selector}"]`);
return Array.from(elements); // Return array for multiple elements
}
}
}
}
}
And used in tests with the same syntax as other locator types:
I.click({byRole: 'button'}); // Find by role attribute
I.see('Welcome', {byTestId: 'title'}); // Find by data-testid
I.fillField({byDataQa: 'email'}, 'test@example.com');- feat(reporter): Enable HTML reporter by default in new projects (#5105)
plugins: {
htmlReporter: {
enabled: true
}
}
-
feat(cli): make test file hyperlink clickable (#5078) - by @kobenguyent

-
feat: Introduce CodeceptJS WebElement Class to mirror helpers’ element instance (#5091)
Unified API Methods
- Element Properties:
getText(),getAttribute(),getProperty(),getInnerHTML(),getValue() - Element State:
isVisible(),isEnabled(),exists(),getBoundingBox() - Element Interactions:
click(),type() - Child Element Search:
$()and$$()methods for finding sub-elements - Native Access:
getNativeElement()andgetHelper()for advanced operations
Updated Helper Methods
grabWebElement()andgrabWebElements()now returnWebElementinstances instead of native elements- Added missing
grabWebElement()method to WebDriver and Puppeteer helpers - Maintains backward compatibility through
getNativeElement()method
// Works consistently across all helpers
const element = await I.grabWebElement('#button');
const text = await element.getText();
const childElements = await element.$$('.child');
await element.click();
// Element searching within elements
const form = await I.grabWebElement('#contact-form');
const nameInput = await form.$('#name');
await nameInput.type('John Doe');
-
feat: support
feature.onlylikeScenario.only(#5087)
Example:Feature.only('Checkout Flow', () => { Scenario('complete order', ({ I }) => { // test steps here }); });
🐛 Bug Fixes
- fix(utils): resolve command injection vulnerability in
emptyFolder(#5190) - by @mhassan1 - bugfix: prevent WebDriver error without Bidi protocol (#5095) - by @ngraf
- fix(playwright): relaunch browser correctly with
restart: 'session'inrun-workers --by pool(#5118) - by @Samuel-StO - fix: JSONResponse helper to preserve original
onResponsebehavior (#5106) - by @myprivaterepo - fix: use
platformNamefor mobile click detection (Android touchClick bug) (#5107) - by @mirao - fix: Properly stop network traffic recording (#5127) - by @Samuel-StO
- fix: mocha retries losing CodeceptJS-specific properties (#5099)
- fix: missing
codeceptjs/effectstypes (#5094) - by @kobenguyent - fix: tryTo steps appearing in test failure traces (#5088)
- fix: JUnit XML test case name inconsistency with retries (#5082)
- fix: waitForText timeout regression in Playwright helper (#5093)
- fix(Playwright): I.waitForText() caused unexpected delay (#5077)
- fix: I.seeResponseContainsJson not working (#5081)
New Contributors
- @myrepojuly made their first contribution in #5106
- @Samuel-StO made their first contribution in #5118
- @mhassan1 made their first contribution in #5190
Full Changelog: 3.7.4...3.7.5
3.7.4
3.7.4
❤️ Thanks all to those who contributed to make this release! ❤️
🛩️ Features
-
Test Suite Shuffling: Randomize test execution order to discover test dependencies and improve test isolation (#5051) - by @NivYarmus
# Shuffle tests to find order-dependent failures using lodash.shuffle algorithm npx codeceptjs run --shuffle # Combined with grep and other options npx codeceptjs run --shuffle --grep "@smoke" --steps
-
Enhanced Interactive Debugging: Better logging for
I.grab*methods in live interactive mode for clearer debugging output (#4986) - by @owenizedd// Interactive pause() now shows detailed grab results with JSON formatting I.amOnPage('/checkout') pause() // Interactive shell started > I.grabTextFrom('.price') Result $res= "Grabbed text: $29.99" // Pretty-printed JSON output > I.grabValueFrom('input[name="email"]') {"value":"user@example.com"} // Structured JSON response
🐛 Bug Fixes
-
Playwright Session Traces: Fixed trace file naming convention and improved error handling for multi-session test scenarios (#5073) - by @julien-ft-64 @kobenguyent
// Example outputs: // - a1b2c3d4-e5f6_checkout_login_test.failed.zip // - b2c3d4e5-f6g7_admin_dashboard_test.failed.zip
Trace files use UUID prefixes with
sessionName_testTitle.status.zipformat -
Worker Data Injection: Resolved proxy object serialization preventing data sharing between parallel test workers (#5072) - by @kobenguyent
// Fixed: Complex objects can now be properly shared and injected between workers // Bootstrap data sharing in codecept.conf.js: exports.config = { bootstrap() { share({ userData: { id: 123, preferences: { theme: 'dark' } }, apiConfig: { baseUrl: 'https://api.test.com', timeout: 5000 }, }) }, } // In tests across different workers: const testData = inject() console.log(testData.userData.preferences.theme) // 'dark' - deep nesting works console.log(Object.keys(testData)) // ['userData', 'apiConfig'] - key enumeration works // Dynamic sharing during test execution: share({ newData: 'shared across workers' })
-
Hook Exit Codes: Fixed improper exit codes when test hooks fail, ensuring CI/CD pipelines properly detect failures (#5058) - by @kobenguyent
# Before: Exit code 0 even when beforeEach/afterEach failed # After: Exit code 1 when any hook fails, properly failing CI builds
-
TypeScript Effects Support: Added complete TypeScript definitions for effects functionality (#5027) - by @kobenguyent
// Import effects with full TypeScript type definitions import { tryTo, retryTo, within } from 'codeceptjs/effects' // tryTo returns Promise<boolean> for conditional actions const success: boolean = await tryTo(async () => { await I.see('Cookie banner') await I.click('Accept') }) // retryTo with typed parameters for reliability await retryTo(() => { I.click('Submit') I.see('Success') }, 3) // retry up to 3 times
Note: Replaces deprecated global plugins - import from 'codeceptjs/effects' module
-
Mochawesome Screenshot Uniqueness: Fixed screenshot naming to prevent test failures from being overwritten when multiple tests run at the same time (#4959) - by @Lando1n
// Problem: When tests run in parallel, screenshots had identical names // This caused later test screenshots to overwrite earlier ones // Before: All failed tests saved as "screenshot.png" // Result: Only the last failure screenshot was kept // After: Each screenshot gets a unique name with timestamp // Examples: // - "login_test_1645123456.failed.png" // - "checkout_test_1645123789.failed.png" // - "profile_test_1645124012.failed.png" // Configuration in codecept.conf.js: helpers: { Mochawesome: { uniqueScreenshotNames: true // Enable unique naming } }
Ensures every failed test keeps its own screenshot for easier debugging
📖 Documentation
- Fixed Docker build issues and improved container deployment process (#4980) - by @thomashohn
- Updated dependency versions to maintain security and compatibility (#4957, #4950, #4943) - by @thomashohn
- Fixed automatic documentation generation system for custom plugins (#4973) - by @Lando1n
New Contributors
- @Lando1n made their first contribution in #4973
- @owenizedd made their first contribution in #4986
- @NivYarmus made their first contribution in #5051
Full Changelog: 3.7.3...3.7.4
3.7.3
3.7.3
❤️ Thanks all to those who contributed to make this release! ❤️
🛩️ Features
- feat(cli): improve info command to return installed browsers (#4890) - by @kobenguyent
➜ helloworld npx codeceptjs info
Environment information:
codeceptVersion: "3.7.2"
nodeInfo: 18.19.0
osInfo: macOS 14.4
cpuInfo: (8) x64 Apple M1 Pro
osBrowsers: "chrome: 133.0.6943.143, edge: 133.0.3065.92, firefox: not installed, safari: 17.4"
playwrightBrowsers: "chromium: 133.0.6943.16, firefox: 134.0, webkit: 18.2"
helpers: {
"Playwright": {
"url": "http://localhost",
...
🐛 Bug Fixes
- fix: resolving path inconsistency in container.js and appium.js (#4866) - by @mjalav
- fix: broken screenshot links in mochawesome reports (#4889) - by @kobenguyent
- some internal fixes to make UTs more stable by @thomashohn
- dependencies upgrades by @thomashohn
New Contributors
Full Changelog: 3.7.2...3.7.3
3.7.2
3.7.2
❤️ Thanks all to those who contributed to make this release! ❤️
🛩️ Features
🐛 Bug Fixes
- fix(stepByStepReport): no records html is generated when running with run-workers (#4638)
- fix(webdriver): bidi error in log with webdriver (#4850)
- fix(types): TS types of methods (Feature|Scenario)Config.config (#4851)
- fix: redundant popup log (#4830)
- fix(webdriver): grab browser logs using bidi protocol (#4754)
- fix(webdriver): screenshots for sessions (#4748)
📖 Documentation
3.6.10
What's Changed
- fix(cli): missing failure counts when there is failedHooks by @kobenguyent in #4633
Full Changelog: 3.6.9...3.6.10
3.6.9
What's Changed
3.6.8
❤️ Thanks all to those who contributed to make this release! ❤️
🛩️ Features
- feat(cli): mask sensitive data in logs (#4630) - by @kobenguyent
export const config: CodeceptJS.MainConfig = {
tests: '**/*.e2e.test.ts',
retry: 4,
output: './output',
maskSensitiveData: true,
emptyOutputFolder: true,
...
I login {"username":"helloworld@test.com","password": "****"}
I send post request "https://localhost:8000/login", {"username":"helloworld@test.com","password": "****"}
› [Request] {"baseURL":"https://localhost:8000/login","method":"POST","data":{"username":"helloworld@test.com","password": "****"},"headers":{}}
› [Response] {"access-token": "****"}
- feat(REST): DELETE request supports payload (#4493) - by @schaudhary111
I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });🐛 Bug Fixes
- fix(playwright): Different behavior of see* and waitFor* when used in within (#4557) - by @kobenguyent
- fix(cli): dry run returns no tests when using a regex grep (#4608) - by @kobenguyent
> codeceptjs dry-run --steps --grep "(?=.*Checkout process)"- fix: Replace deprecated faker.name with faker.person (#4581) - by @thomashohn
- fix(wdio): Remove dependency to devtools (#4563) - by @thomashohn
- fix(typings): wrong defineParameterType (#4548) - by @kobenguyent
- fix(typing):
Locator.buildcomplains the empty locator (#4543) - by @kobenguyent - fix: add hint to
I.seeEmailAttachmenttreats parameter as regular expression (#4629) - by @ngraf
Add hint to "I.seeEmailAttachment" that under the hood parameter is treated as RegExp.
When you don't know it, it can cause a lot of pain, wondering why your test fails with I.seeEmailAttachment('Attachment(1).pdf') although it looks just fine, but actually I.seeEmailAttachment('Attachment\\(1\\).pdf is required to make the test green, in case the attachment is called "Attachment(1).pdf" with special character in it.
- fix(playwright): waitForText fails when text contains double quotes (#4528) - by @DavertMik
- fix(mock-server-helper): move to stand-alone package: https://www.npmjs.com/package/@codeceptjs/mock-server-helper (#4536) - by @kobenguyent
- fix(appium): issue with async on runOnIos and runOnAndroid (#4525) - by @kobenguyent
- fix: push ws messages to array (#4513) - by @kobenguyent
- fix: missing invisi-data lib when upgrading codeceptjs
📖 Documentation
- fix(docs): typo in ai.md (#4501) - by @tomaculum
New Contributors
- @schaudhary111 made their first contribution in #4493
- @thomashohn made their first contribution in #4551
Full Changelog: 3.6.6...3.6.9
