diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce6dd1b6..ab167b23d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,125 @@ +## 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 + + ```bash + # 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 + + ```js + // 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 + + ```js + // 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.zip` format_ + +- **Worker Data Injection**: Resolved proxy object serialization preventing data sharing between parallel test workers (#5072) - by @kobenguyent + + ```js + // 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 + + ```bash + # 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 + + ```typescript + // Import effects with full TypeScript type definitions + import { tryTo, retryTo, within } from 'codeceptjs/effects' + + // tryTo returns Promise 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 + + ```js + // 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 + ## 3.7.3 â¤ī¸ 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 ``` - feat(cli): print failed hooks (#4476) - by @kobenguyent - - run command ![Screenshot 2024-09-02 at 15 25 20](https://github.com/user-attachments/assets/625c6b54-03f6-41c6-9d0c-cd699582404a) @@ -744,7 +865,6 @@ heal.addRecipe('reloadPageIfModalIsNotVisisble', { ``` - **Breaking Change** **AI** features refactored. Read updated [AI guide](./ai): - - **removed dependency on `openai`** - added support for **Azure OpenAI**, **Claude**, **Mistal**, or any AI via custom request function - `--ai` option added to explicitly enable AI features @@ -755,7 +875,6 @@ heal.addRecipe('reloadPageIfModalIsNotVisisble', { - `OpenAI` helper renamed to `AI` - feat(puppeteer): network traffic manipulation. See #4263 by @KobeNguyenT - - `startRecordingTraffic` - `grabRecordedNetworkTraffics` - `flushNetworkTraffics` @@ -2096,7 +2215,6 @@ await I.seeTraffic({ - **đŸĒ„ [AI Powered Test Automation](/ai)** - use OpenAI as a copilot for test automation. #3713 By @davertmik ![](https://user-images.githubusercontent.com/220264/250418764-c382709a-3ccb-4eb5-b6bc-538f3b3b3d35.png) - - [AI guide](/ai) added - added support for OpenAI in `pause()` - added [`heal` plugin](/plugins#heal) for self-healing tests @@ -2107,7 +2225,6 @@ await I.seeTraffic({ ![](https://user-images.githubusercontent.com/220264/250415226-a7620418-56a4-4837-b790-b15e91e5d1f0.png) - [Playwright] Support for APIs in Playwright (#3665) - by Egor Bodnar - - `clearField` replaced to use new Playwright API - `blur` added - `focus` added @@ -3519,9 +3636,7 @@ I.seeFile(fileName) ## 2.0.0 - [WebDriver] **Breaking Change.** Updated to webdriverio v5. New helper **WebDriver** helper introduced. - - **Upgrade plan**: - 1. Install latest webdriverio ``` @@ -3538,9 +3653,7 @@ I.seeFile(fileName) - [Appium] **Breaking Change.** Updated to use webdriverio v5 as well. See upgrade plan ↑ - [REST] **Breaking Change.** Replaced `unirest` library with `axios`. - - **Upgrade plan**: - 1. Refer to [axios API](https://github.com/axios/axios). 2. If you were using `unirest` requests/responses in your tests change them to axios format. diff --git a/package.json b/package.json index a8b3deaf3..3a09734e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeceptjs", - "version": "3.7.3", + "version": "3.7.4", "description": "Supercharged End 2 End Testing Framework for NodeJS", "keywords": [ "acceptance",