From 28af75a6ebcb9ca05875d99cf020a173637ebe9b Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Wed, 6 Dec 2023 11:37:36 +0100 Subject: [PATCH 1/4] release 3.5.9 --- CHANGELOG.md | 264 ++++++++++++++++++++++++++++++++++++++++----------- package.json | 5 +- runok.js | 4 +- 3 files changed, 216 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fc7134ff..36316d127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,182 @@ +## 3.5.9 + +โค๏ธ Thanks all to those who contributed to make this release! โค๏ธ + +๐Ÿ› *Bug Fixes* +* fix(playwright): proceedSee could not find the element (#4006) - by @hatufacci +* fix(appium): remove the vendor prefix of 'bstack:options' (#4053) - by @mojtabaalavi +* fix(workers): event improvements (#3953) - by @KobeNguyenT +``` +Emit the new event: event.workers.result. + +CodeceptJS also exposes the env var `process.env.RUNS_WITH_WORKERS` when running tests with run-workers command so that you could handle the events better in your plugins/helpers. + +const { event } = require('codeceptjs'); + +module.exports = function() { + // this event would trigger the `_publishResultsToTestrail` when running `run-workers` command + event.dispatcher.on(event.workers.result, async () => { + await _publishResultsToTestrail(); + }); + + // this event would not trigger the `_publishResultsToTestrail` multiple times when running `run-workers` command + event.dispatcher.on(event.all.result, async () => { + // when running `run` command, this env var is undefined + if (!process.env.RUNS_WITH_WORKERS) await _publishResultsToTestrail(); + }); +} +``` +* fix: ai html updates (#3962) - by @davert +``` +replaced minify library with a modern and more secure fork. Fixes html-minifier@4.0.0 Regular Expression Denial of Service vulnerability #3829 +AI class is implemented as singleton +refactored heal.js plugin to work on edge cases +add configuration params on number of fixes performed by ay heal +improved recorder class to add more verbose log +improved recorder class to ignore some of errors +``` +* fix(appium): closeApp supports both Android/iOS (#4046) - by @KobeNguyenT +* fix: some security vulnerability of some packages (#4045) - by @KobeNguyenT +* fix: seeAttributesOnElements check condition (#4029) - by @KobeNguyenT +* fix: waitForText locator issue (#4039) - by @KobeNguyenT +``` +Fixed this error: + +locator.isVisible: Unexpected token "s" while parsing selector ":has-text('Were you able to resolve the resident's issue?') >> nth=0" + at Playwright.waitForText (node_modules\codeceptjs\lib\helper\Playwright.js:2584:79) +``` +* fix: move to sha256 (#4038) - by @KobeNguyenT +* fix: respect retries from retryfailedstep plugin in helpers (#4028) - by @KobeNguyenT +``` +Currently inside the _before() of helpers for example Playwright, the retries is set there, however, when retryFailedStep plugin is enabled, the retries of recorder is still using the value from _before() not the value from retryFailedStep plugin. + +Fix: + +- introduce the process.env.FAILED_STEP_RETIRES which could be access everywhere as the helper won't know anything about the plugin. +- set default retries of Playwright to 3 to be on the same page with Puppeteer. +``` +* fix: examples in test title (#4030) - by @KobeNguyenT +``` +When test title doesn't have the data in examples: + +Feature: Faker examples + + Scenario Outline: Below are the users + Examples: + | user | role | + | John | admin | + | Tim | client | + +Faker examples -- + [1] Starting recording promises + Timeouts: + Below are the users {"user":"John","role":"admin"} + โœ” OK in 4ms + + Below are the users {"user":"Tim","role":"client"} + โœ” OK in 1ms + +When test title includes the data in examples: + + +Feature: Faker examples + + Scenario Outline: Below are the users - - + Examples: + | user | role | + | John | admin | + | Tim | client | + + +Faker examples -- + [1] Starting recording promises + Timeouts: + Below are the users - John - admin + โœ” OK in 4ms + + Below are the users - Tim - client + โœ” OK in 1ms +``` +* fix: disable retryFailedStep when using with tryTo (#4022) - by @KobeNguyenT +* fix: locator builder returns error when class name contains hyphen (#4024) - by @KobeNguyenT +* fix: seeCssPropertiesOnElements failed when font-weight is a number (#4026) - by @KobeNguyenT +* fix(appium): missing await on some steps of runOnIOS and runOnAndroid (#4018) - by @KobeNguyenT +* fix(cli): no error of failed tests when using retry with scenario only (#4020) - by @KobeNguyenT +* fix: set getPageTimeout to 30s (#4031) - by @KobeNguyenT +* fix(appium): expose switchToContext (#4015) - by @KobeNguyenT +* fix: promise issue (#4013) - by @KobeNguyenT + +๐Ÿ“– *Documentation* +* docs: Update clearCookie documentation for Playwright helper (#4005) - by @Hellosager +* docs: improve the example code for autoLogin (#4019) - by @KobeNguyenT + ![Screenshot 2023-11-22 at 14 40 11](https://github.com/codeceptjs/CodeceptJS/assets/7845001/c05ac436-efd0-4bc0-a46c-386f915c0f17) + +๐Ÿ›ฉ๏ธ *Features* +* feat: expose WebElement (#4043) - by @KobeNguyenT +``` +Now we expose the WebElements that are returned by the WebHelper and you could make the subsequence actions on them. + +// Playwright helper would return the Locator + +I.amOnPage('/form/focus_blur_elements'); +const webElements = await I.grabWebElements('#button'); +webElements[0].click(); +``` +* feat(playwright): support HAR replaying (#3990) - by @KobeNguyenT +``` +Replaying from HAR + + // Replay API requests from HAR. + // Either use a matching response from the HAR, + // or abort the request if nothing matches. + I.replayFromHar('./output/har/something.har', { url: "*/**/api/v1/fruits" }); + I.amOnPage('https://demo.playwright.dev/api-mocking'); + I.see('CodeceptJS'); +[Parameters] +harFilePath [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) Path to recorded HAR file +opts [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)? [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har) +``` +* feat(playwright): support HAR recording (#3986) - by @KobeNguyenT +``` +A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded. +It contains information about the request and response headers, cookies, content, timings, and more. +You can use HAR files to mock network requests in your tests. HAR will be saved to output/har. +More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har. + +... +recordHar: { + mode: 'minimal', // possible values: 'minimal'|'full'. + content: 'embed' // possible values: "omit"|"embed"|"attach". +} +... +``` +* improvement(playwright): support partial string for option (#4016) - by @KobeNguyenT +``` +await I.amOnPage('/form/select'); +await I.selectOption('Select your age', '21-'); +``` + ## 3.5.8 Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* fix(appium): type of setNetworkConnection() (#3994) - by @mirao -fix: improve the way to show deprecated appium v1 message (#3992) - by @KobeNguyenT -fix: missing exit condition of some wait functions - by @kobenguyent +fix: improve the way to show deprecated appium v1 message (#3992) - by @@KobeNguyenT +fix: missing exit condition of some wait functions - by @@KobeNguyenT ## 3.5.7 Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* -* Bump playwright to 1.39.0 - run `npx playwright install` to install the browsers as starting from 1.39.0 browsers are not installed automatically (#3924) - by @KobeNguyenT -* fix(playwright): some wait functions draw error due to switchTo iframe (#3918) - by @KobeNguyenT +* Bump playwright to 1.39.0 - run `npx playwright install` to install the browsers as starting from 1.39.0 browsers are not installed automatically (#3924) - by @@KobeNguyenT +* fix(playwright): some wait functions draw error due to switchTo iframe (#3918) - by @@KobeNguyenT * fix(appium): AppiumTestDistribution/appium-device-farm requires 'platformName' (#3950) - by @rock-tran * fix: autologin with empty fetch (#3947) - by @andonary -* fix(cli): customLocator draws error in dry-mode (#3940) - by @KobeNguyenT +* fix(cli): customLocator draws error in dry-mode (#3940) - by @@KobeNguyenT * fix: ensure docs include @returns Promise where appropriate (#3954) - by @fwouts -* fix: long text in data table cuts off (#3936) - by @KobeNguyenT +* fix: long text in data table cuts off (#3936) - by @@KobeNguyenT ``` #language: de Funktionalitรคt: Faker examples @@ -39,16 +197,16 @@ Dr. {{name.findName}} โœ” OK in 13ms ``` -* fix(playwright): move to waitFor (#3933) - by @KobeNguyenT -* fix: relax grabCookie type (#3919) - by @KobeNguyenT -* fix: proceedSee error when being called inside within (#3939) - by @KobeNguyenT -* fix: rename haveRequestHeaders of ppt and pw helpers (#3937) - by @KobeNguyenT +* fix(playwright): move to waitFor (#3933) - by @@KobeNguyenT +* fix: relax grabCookie type (#3919) - by @@KobeNguyenT +* fix: proceedSee error when being called inside within (#3939) - by @@KobeNguyenT +* fix: rename haveRequestHeaders of ppt and pw helpers (#3937) - by @@KobeNguyenT ``` Renamed haveRequestHeaders of Puppeteer, Playwright helper so that it would not confuse the REST helper. Puppeteer: setPuppeteerRequestHeaders Playwright: setPlaywrightRequestHeaders ``` -* improvement: handle the way to load apifactory nicely (#3941) - by @KobeNguyenT +* improvement: handle the way to load apifactory nicely (#3941) - by @@KobeNguyenT ``` With this fix, we could now use the following syntax: @@ -66,12 +224,12 @@ modules.export = new Factory() ``` ๐Ÿ“– *Documentation* -* docs(appium): update to v2 (#3932) - by @KobeNguyenT -* docs: improve BDD Gherkin docs (#3938) - by @KobeNguyenT +* docs(appium): update to v2 (#3932) - by @@KobeNguyenT +* docs: improve BDD Gherkin docs (#3938) - by @@KobeNguyenT * Other docs improvements ๐Ÿ›ฉ๏ธ *Features* -* feat(puppeteer): support trace recording - by @KobeNguyenT +* feat(puppeteer): support trace recording - by @@KobeNguyenT ``` [Trace Recording Customization] Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run. Traces will be saved to output/trace @@ -79,7 +237,7 @@ Trace recording provides complete information on test execution and includes scr trace: enables trace recording for failed tests; trace are saved into output/trace folder keepTraceForPassedTests: - save trace for passed tests ``` -* feat: expect helper (#3923) - by @KobeNguyenT +* feat: expect helper (#3923) - by @@KobeNguyenT ``` * This helper allows performing assertions based on Chai. * @@ -124,7 +282,7 @@ keepTraceForPassedTests: - save trace for passed tests #expectDeepEqualExcluding #expectLengthBelowThan ``` -* feat: run-workers with multiple browsers output folders - by @KobeNguyenT +* feat: run-workers with multiple browsers output folders - by @@KobeNguyenT - ![Screenshot 2023-11-04 at 10 49 56](https://github.com/codeceptjs/CodeceptJS/assets/7845001/8eaecc54-de14-4597-b148-1e087bec3c76) - ![Screenshot 2023-11-03 at 15 56 38](https://github.com/codeceptjs/CodeceptJS/assets/7845001/715aed17-3535-48df-80dd-84f7024f08e3) * feat: introduce new Playwright methods - by @hatufacci @@ -132,7 +290,7 @@ keepTraceForPassedTests: - save trace for passed tests - grabCheckedElementStatus - grabDisabledElementStatus ``` -* feat: gherkin supports i18n (#3934) - by @KobeNguyenT +* feat: gherkin supports i18n (#3934) - by @@KobeNguyenT ``` #language: de Funktionalitรคt: Checkout-Prozess @@ -151,7 +309,7 @@ Funktionalitรคt: Checkout-Prozess | price | total | | 10 | 10.0 | ``` -* feat(autoLogin): improve the check method (#3935) - by @KobeNguyenT +* feat(autoLogin): improve the check method (#3935) - by @@KobeNguyenT ``` Instead of asserting on page elements for the current user in check, you can use the session you saved in fetch @@ -186,15 +344,15 @@ Scenario('login', async ( {I, login} ) => { Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* -* fix: switchTo/within block doesn't switch to expected iframe (#3892) - by @KobeNguyenT -* fix: highlight element doesn't work as expected (#3896) - by @KobeNguyenT +* fix: switchTo/within block doesn't switch to expected iframe (#3892) - by @@KobeNguyenT +* fix: highlight element doesn't work as expected (#3896) - by @@KobeNguyenT ``` verbose/ highlight TRUE TRUE -> highlight element verbose/ highlight TRUE FALSE -> no highlight element verbose/ highlight FALSE TRUE -> no highlight element verbose/ highlight FALSE FALSE -> no highlight element ``` -* fix: masked value issue in data table (#3885) - by @KobeNguyenT +* fix: masked value issue in data table (#3885) - by @@KobeNguyenT ``` const accounts = new DataTable(['role', 'username', 'password']); accounts.add([ @@ -231,10 +389,10 @@ Data(accounts) โœ” OK in 1ms ``` -* fix: debug info causes error (#3882) - by @KobeNguyenT +* fix: debug info causes error (#3882) - by @@KobeNguyenT ๐Ÿ“– *Documentation* -* fix: get rid of complaining when using session without await and returning nothing. (#3899) - by @KobeNguyenT +* fix: get rid of complaining when using session without await and returning nothing. (#3899) - by @@KobeNguyenT * fix(FileSystem): a typo in writeToFile() (#3897) - by @mirao ๐Ÿ›ฉ๏ธ *Features* @@ -247,7 +405,7 @@ Data(accounts) ## 3.5.5 ๐Ÿ› Bug Fixes -* fix(browserstack): issue with vendor prefix (#3845) - by @KobeNguyenT +* fix(browserstack): issue with vendor prefix (#3845) - by @@KobeNguyenT ``` export const caps = { androidCaps: { @@ -281,7 +439,7 @@ export const caps = { } ``` -* switchTo/within now supports strict locator (#3847) - by @KobeNguyenT +* switchTo/within now supports strict locator (#3847) - by @@KobeNguyenT ``` I.switchTo({ css: 'iframe[id^=number-frame]' }) // support the strict locator @@ -311,10 +469,10 @@ within({ bypassCSP: true } ``` -* fix: missing requests when recording network (#3834) - by @KobeNguyenT +* fix: missing requests when recording network (#3834) - by @@KobeNguyenT ๐Ÿ›ฉ๏ธ Features and Improvements -* Show environment info in verbose mode (#3858) - by @KobeNguyenT +* Show environment info in verbose mode (#3858) - by @@KobeNguyenT ``` Environment information:- @@ -381,8 +539,8 @@ CodeceptJS v3.5.4 #StandWithUkraine ``` * some typings improvements (#3855) - by @nikzupancic -* support the puppeteer 21.1.1 (#3856) - by @KobeNguyenT -* fix: support secret value for some methods (#3837) - by @KobeNguyenT +* support the puppeteer 21.1.1 (#3856) - by @@KobeNguyenT +* fix: support secret value for some methods (#3837) - by @@KobeNguyenT ``` await I.amOnPage('/form/field_values'); @@ -402,10 +560,10 @@ await I.seeInField('checkbox[]', secret('see test three')); ## 3.5.4 ๐Ÿ› Bug Fixes: - * [Playwright] When passing `userDataDir`, it throws error after test execution (#3814) - by @KobeNguyenT - * [CodeceptJS-CLI] Improve command to generate types (#3788) - by @KobeNguyenT + * [Playwright] When passing `userDataDir`, it throws error after test execution (#3814) - by @@KobeNguyenT + * [CodeceptJS-CLI] Improve command to generate types (#3788) - by @@KobeNguyenT * Heal plugin fix (#3820) - by @davert - * Fix for error in using `all` with `run-workers` (#3805) - by @KobeNguyenT + * Fix for error in using `all` with `run-workers` (#3805) - by @@KobeNguyenT ```js helpers: { Playwright: { @@ -429,7 +587,7 @@ await I.seeInField('checkbox[]', secret('see test three')); }, ``` * Highlight elements issues (#3779) (#3778) - by @philkas - * Support ` ` symbol in `I.see` method (#3815) - by @KobeNguyenT + * Support ` ` symbol in `I.see` method (#3815) - by @@KobeNguyenT ```js // HTML code uses   instead of space @@ -439,7 +597,7 @@ I.see("My Text!") // this test would work with both   and space ``` ๐Ÿ“– Documentation - * Improve the configuration of electron testing when the app is build with electron-forge (#3802) - by @KobeNguyenT + * Improve the configuration of electron testing when the app is build with electron-forge (#3802) - by @@KobeNguyenT ```js const path = require("path"); @@ -461,7 +619,7 @@ exports.config = { ๐Ÿ›ฉ๏ธ Features #### [Playwright] new features and improvements - * Parse the response in recording network steps (#3771) - by @KobeNguyenT + * Parse the response in recording network steps (#3771) - by @@KobeNguyenT ```js const traffics = await I.grabRecordedNetworkTraffics(); @@ -473,7 +631,7 @@ exports.config = { expect(traffics[1].response.status).to.equal(200); expect(traffics[1].response.body).to.contain({ name: 'this was another mocked' }); ``` - * Grab metrics (#3809) - by @KobeNguyenT + * Grab metrics (#3809) - by @@KobeNguyenT ```js const metrics = await I.grabMetrics(); @@ -520,7 +678,7 @@ const metrics = await I.grabMetrics(); ] ``` -* Grab WebSocket (WS) messages (#3789) - by @KobeNguyenT +* Grab WebSocket (WS) messages (#3789) - by @@KobeNguyenT * `flushWebSocketMessages` * `grabWebSocketMessages` * `startRecordingWebSocketMessages` @@ -555,13 +713,13 @@ const afterWsMessages = I.grabWebSocketMessages(); expect(wsMessages.length).to.equal(afterWsMessages.length); ``` -* Move from `ElementHandle` to `Locator`. This change is quite major, but it happened under hood, so should not affect your code. (#3738) - by @KobeNguyenT +* Move from `ElementHandle` to `Locator`. This change is quite major, but it happened under hood, so should not affect your code. (#3738) - by @@KobeNguyenT ## 3.5.3 ๐Ÿ›ฉ๏ธ Features -* [Playwright] Added commands to check network traffic #3748 - by @ngraf @KobeNguyenT +* [Playwright] Added commands to check network traffic #3748 - by @ngraf @@KobeNguyenT * `startRecordingTraffic` * `grabRecordedNetworkTraffics` * `blockTraffic` @@ -606,7 +764,7 @@ Examples: ๐Ÿ› Bugfix -* [retryStepPlugin] Fix retry step when using global retry #3768 - by @KobeNguyenT +* [retryStepPlugin] Fix retry step when using global retry #3768 - by @@KobeNguyenT ๐Ÿ—‘ Deprecated @@ -617,17 +775,17 @@ Examples: ๐Ÿ› Bug Fixes * [Playwright] reverted `clearField` to previous implementation -* [OpenAI] fixed running helper in pause mode. #3755 by @KobeNguyenT +* [OpenAI] fixed running helper in pause mode. #3755 by @@KobeNguyenT ## 3.5.1 ๐Ÿ›ฉ๏ธ Features -* [Puppeteer][WebDriver][TestCafe] Added methods by @KobeNguyenT in #3737 +* [Puppeteer][WebDriver][TestCafe] Added methods by @@KobeNguyenT in #3737 * `blur` * `focus` * Improved BDD output to print steps without `I.` commands` by @davertmik #3739 -* Improved `codecept init` setup for Electron tests by @KobeNguyenT. See #3733 +* Improved `codecept init` setup for Electron tests by @@KobeNguyenT. See #3733 ๐Ÿ› Bug Fixes @@ -637,7 +795,7 @@ Examples: * Fixed Playwright docs by @Horsty80 * Fixed ai docs by @ngraf -* Various fixes by @KobeNguyenT +* Various fixes by @@KobeNguyenT ## 3.5.0 @@ -651,7 +809,7 @@ Examples: * added [`OpenAI`](/helpers/openai) helper -- [Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with `highlightElement` option set (#3672) - by @KobeNguyenT +- [Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with `highlightElement` option set (#3672) - by @@KobeNguyenT ![](https://user-images.githubusercontent.com/220264/250415226-a7620418-56a4-4837-b790-b15e91e5d1f0.png) @@ -689,18 +847,18 @@ And executed via `run-workers` with `all` argument npx codeceptjs run-workers 2 all ``` -- [Appium] Add Appium v2 support (#3622) - by @KobeNguyenT -- Improve `gpo` command to create page objects as modules or as classes (#3625) - by @KobeNguyenT -- Added `emptyOutputFolder` config to clean up output before running tests (#3604) - by @KobeNguyenT +- [Appium] Add Appium v2 support (#3622) - by @@KobeNguyenT +- Improve `gpo` command to create page objects as modules or as classes (#3625) - by @@KobeNguyenT +- Added `emptyOutputFolder` config to clean up output before running tests (#3604) - by @@KobeNguyenT - Add `secret()` function support to `append()` and `type()` (#3615) - by @anils92 -- [Playwright] Add `bypassCSP` option to helper's config (#3641) - by @KobeNguyenT -- Print number of tests for each suite in dryRun (#3620) - by @KobeNguyenT +- [Playwright] Add `bypassCSP` option to helper's config (#3641) - by @@KobeNguyenT +- Print number of tests for each suite in dryRun (#3620) - by @@KobeNguyenT ๐Ÿ› Bug Fixes -- Support `--grep` in dry-run command (#3673) - by @KobeNguyenT -- Fix typings improvements in playwright (#3650) - by @KobeNguyenT -- Fixed global retry #3667 by @KobeNguyenT +- Support `--grep` in dry-run command (#3673) - by @@KobeNguyenT +- Fix typings improvements in playwright (#3650) - by @@KobeNguyenT +- Fixed global retry #3667 by @@KobeNguyenT - Fixed creating JavaScript test using "codeceptjs gt" (#3611) - by Jaromir Obr diff --git a/package.json b/package.json index 90f6bf6a6..b891e1b7d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeceptjs", - "version": "3.5.8", + "version": "3.5.9", "description": "Supercharged End 2 End Testing Framework for NodeJS", "keywords": [ "acceptance", @@ -59,7 +59,8 @@ "publish:site": "./runok.js publish:site", "update-contributor-faces": "./runok.js contributor:faces", "dtslint": "dtslint typings --localTs './node_modules/typescript/lib'", - "prepare": "husky install" + "prepare": "husky install", + "prepare-release": "./runok.js versioning && ./runok.js get:commit-log" }, "dependencies": { "@codeceptjs/configure": "0.10.0", diff --git a/runok.js b/runok.js index 8e600bd44..0de4564ba 100755 --- a/runok.js +++ b/runok.js @@ -429,7 +429,7 @@ title: ${name} const changelog = fs.readFileSync(file).toString(); const _changelog = `## ${newVersion}\n -Thanks all to those who contributed to make this release! +โค๏ธ Thanks all to those who contributed to make this release! โค๏ธ ๐Ÿ› *Bug Fixes* @@ -448,7 +448,7 @@ ${changelog}`; async getCommitLog() { console.log('Gathering commits...'); - const logs = await exec('git log --pretty=\'format:%s - by %aN\' $(git describe --abbrev=0 --tags)..HEAD'); + const logs = await exec('git log --pretty=\'format:* %s - by @%aN\' $(git describe --abbrev=0 --tags)..HEAD'); console.log(logs.data.stdout); }, From 8c63b5417b2e771cdd32864f718e793227a0aa1e Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Wed, 6 Dec 2023 11:39:49 +0100 Subject: [PATCH 2/4] fix: change log --- CHANGELOG.md | 106 +++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36316d127..412ada378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -162,21 +162,21 @@ Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* fix(appium): type of setNetworkConnection() (#3994) - by @mirao -fix: improve the way to show deprecated appium v1 message (#3992) - by @@KobeNguyenT -fix: missing exit condition of some wait functions - by @@KobeNguyenT +fix: improve the way to show deprecated appium v1 message (#3992) - by @KobeNguyenT +fix: missing exit condition of some wait functions - by @KobeNguyenT ## 3.5.7 Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* -* Bump playwright to 1.39.0 - run `npx playwright install` to install the browsers as starting from 1.39.0 browsers are not installed automatically (#3924) - by @@KobeNguyenT -* fix(playwright): some wait functions draw error due to switchTo iframe (#3918) - by @@KobeNguyenT +* Bump playwright to 1.39.0 - run `npx playwright install` to install the browsers as starting from 1.39.0 browsers are not installed automatically (#3924) - by @KobeNguyenT +* fix(playwright): some wait functions draw error due to switchTo iframe (#3918) - by @KobeNguyenT * fix(appium): AppiumTestDistribution/appium-device-farm requires 'platformName' (#3950) - by @rock-tran * fix: autologin with empty fetch (#3947) - by @andonary -* fix(cli): customLocator draws error in dry-mode (#3940) - by @@KobeNguyenT +* fix(cli): customLocator draws error in dry-mode (#3940) - by @KobeNguyenT * fix: ensure docs include @returns Promise where appropriate (#3954) - by @fwouts -* fix: long text in data table cuts off (#3936) - by @@KobeNguyenT +* fix: long text in data table cuts off (#3936) - by @KobeNguyenT ``` #language: de Funktionalitรคt: Faker examples @@ -197,16 +197,16 @@ Dr. {{name.findName}} โœ” OK in 13ms ``` -* fix(playwright): move to waitFor (#3933) - by @@KobeNguyenT -* fix: relax grabCookie type (#3919) - by @@KobeNguyenT -* fix: proceedSee error when being called inside within (#3939) - by @@KobeNguyenT -* fix: rename haveRequestHeaders of ppt and pw helpers (#3937) - by @@KobeNguyenT +* fix(playwright): move to waitFor (#3933) - by @KobeNguyenT +* fix: relax grabCookie type (#3919) - by @KobeNguyenT +* fix: proceedSee error when being called inside within (#3939) - by @KobeNguyenT +* fix: rename haveRequestHeaders of ppt and pw helpers (#3937) - by @KobeNguyenT ``` Renamed haveRequestHeaders of Puppeteer, Playwright helper so that it would not confuse the REST helper. Puppeteer: setPuppeteerRequestHeaders Playwright: setPlaywrightRequestHeaders ``` -* improvement: handle the way to load apifactory nicely (#3941) - by @@KobeNguyenT +* improvement: handle the way to load apifactory nicely (#3941) - by @KobeNguyenT ``` With this fix, we could now use the following syntax: @@ -224,12 +224,12 @@ modules.export = new Factory() ``` ๐Ÿ“– *Documentation* -* docs(appium): update to v2 (#3932) - by @@KobeNguyenT -* docs: improve BDD Gherkin docs (#3938) - by @@KobeNguyenT +* docs(appium): update to v2 (#3932) - by @KobeNguyenT +* docs: improve BDD Gherkin docs (#3938) - by @KobeNguyenT * Other docs improvements ๐Ÿ›ฉ๏ธ *Features* -* feat(puppeteer): support trace recording - by @@KobeNguyenT +* feat(puppeteer): support trace recording - by @KobeNguyenT ``` [Trace Recording Customization] Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run. Traces will be saved to output/trace @@ -237,7 +237,7 @@ Trace recording provides complete information on test execution and includes scr trace: enables trace recording for failed tests; trace are saved into output/trace folder keepTraceForPassedTests: - save trace for passed tests ``` -* feat: expect helper (#3923) - by @@KobeNguyenT +* feat: expect helper (#3923) - by @KobeNguyenT ``` * This helper allows performing assertions based on Chai. * @@ -282,7 +282,7 @@ keepTraceForPassedTests: - save trace for passed tests #expectDeepEqualExcluding #expectLengthBelowThan ``` -* feat: run-workers with multiple browsers output folders - by @@KobeNguyenT +* feat: run-workers with multiple browsers output folders - by @KobeNguyenT - ![Screenshot 2023-11-04 at 10 49 56](https://github.com/codeceptjs/CodeceptJS/assets/7845001/8eaecc54-de14-4597-b148-1e087bec3c76) - ![Screenshot 2023-11-03 at 15 56 38](https://github.com/codeceptjs/CodeceptJS/assets/7845001/715aed17-3535-48df-80dd-84f7024f08e3) * feat: introduce new Playwright methods - by @hatufacci @@ -290,7 +290,7 @@ keepTraceForPassedTests: - save trace for passed tests - grabCheckedElementStatus - grabDisabledElementStatus ``` -* feat: gherkin supports i18n (#3934) - by @@KobeNguyenT +* feat: gherkin supports i18n (#3934) - by @KobeNguyenT ``` #language: de Funktionalitรคt: Checkout-Prozess @@ -309,7 +309,7 @@ Funktionalitรคt: Checkout-Prozess | price | total | | 10 | 10.0 | ``` -* feat(autoLogin): improve the check method (#3935) - by @@KobeNguyenT +* feat(autoLogin): improve the check method (#3935) - by @KobeNguyenT ``` Instead of asserting on page elements for the current user in check, you can use the session you saved in fetch @@ -344,15 +344,15 @@ Scenario('login', async ( {I, login} ) => { Thanks all to those who contributed to make this release! ๐Ÿ› *Bug Fixes* -* fix: switchTo/within block doesn't switch to expected iframe (#3892) - by @@KobeNguyenT -* fix: highlight element doesn't work as expected (#3896) - by @@KobeNguyenT +* fix: switchTo/within block doesn't switch to expected iframe (#3892) - by @KobeNguyenT +* fix: highlight element doesn't work as expected (#3896) - by @KobeNguyenT ``` verbose/ highlight TRUE TRUE -> highlight element verbose/ highlight TRUE FALSE -> no highlight element verbose/ highlight FALSE TRUE -> no highlight element verbose/ highlight FALSE FALSE -> no highlight element ``` -* fix: masked value issue in data table (#3885) - by @@KobeNguyenT +* fix: masked value issue in data table (#3885) - by @KobeNguyenT ``` const accounts = new DataTable(['role', 'username', 'password']); accounts.add([ @@ -389,10 +389,10 @@ Data(accounts) โœ” OK in 1ms ``` -* fix: debug info causes error (#3882) - by @@KobeNguyenT +* fix: debug info causes error (#3882) - by @KobeNguyenT ๐Ÿ“– *Documentation* -* fix: get rid of complaining when using session without await and returning nothing. (#3899) - by @@KobeNguyenT +* fix: get rid of complaining when using session without await and returning nothing. (#3899) - by @KobeNguyenT * fix(FileSystem): a typo in writeToFile() (#3897) - by @mirao ๐Ÿ›ฉ๏ธ *Features* @@ -405,7 +405,7 @@ Data(accounts) ## 3.5.5 ๐Ÿ› Bug Fixes -* fix(browserstack): issue with vendor prefix (#3845) - by @@KobeNguyenT +* fix(browserstack): issue with vendor prefix (#3845) - by @KobeNguyenT ``` export const caps = { androidCaps: { @@ -439,7 +439,7 @@ export const caps = { } ``` -* switchTo/within now supports strict locator (#3847) - by @@KobeNguyenT +* switchTo/within now supports strict locator (#3847) - by @KobeNguyenT ``` I.switchTo({ css: 'iframe[id^=number-frame]' }) // support the strict locator @@ -469,10 +469,10 @@ within({ bypassCSP: true } ``` -* fix: missing requests when recording network (#3834) - by @@KobeNguyenT +* fix: missing requests when recording network (#3834) - by @KobeNguyenT ๐Ÿ›ฉ๏ธ Features and Improvements -* Show environment info in verbose mode (#3858) - by @@KobeNguyenT +* Show environment info in verbose mode (#3858) - by @KobeNguyenT ``` Environment information:- @@ -539,8 +539,8 @@ CodeceptJS v3.5.4 #StandWithUkraine ``` * some typings improvements (#3855) - by @nikzupancic -* support the puppeteer 21.1.1 (#3856) - by @@KobeNguyenT -* fix: support secret value for some methods (#3837) - by @@KobeNguyenT +* support the puppeteer 21.1.1 (#3856) - by @KobeNguyenT +* fix: support secret value for some methods (#3837) - by @KobeNguyenT ``` await I.amOnPage('/form/field_values'); @@ -560,10 +560,10 @@ await I.seeInField('checkbox[]', secret('see test three')); ## 3.5.4 ๐Ÿ› Bug Fixes: - * [Playwright] When passing `userDataDir`, it throws error after test execution (#3814) - by @@KobeNguyenT - * [CodeceptJS-CLI] Improve command to generate types (#3788) - by @@KobeNguyenT + * [Playwright] When passing `userDataDir`, it throws error after test execution (#3814) - by @KobeNguyenT + * [CodeceptJS-CLI] Improve command to generate types (#3788) - by @KobeNguyenT * Heal plugin fix (#3820) - by @davert - * Fix for error in using `all` with `run-workers` (#3805) - by @@KobeNguyenT + * Fix for error in using `all` with `run-workers` (#3805) - by @KobeNguyenT ```js helpers: { Playwright: { @@ -587,7 +587,7 @@ await I.seeInField('checkbox[]', secret('see test three')); }, ``` * Highlight elements issues (#3779) (#3778) - by @philkas - * Support ` ` symbol in `I.see` method (#3815) - by @@KobeNguyenT + * Support ` ` symbol in `I.see` method (#3815) - by @KobeNguyenT ```js // HTML code uses   instead of space @@ -597,7 +597,7 @@ I.see("My Text!") // this test would work with both   and space ``` ๐Ÿ“– Documentation - * Improve the configuration of electron testing when the app is build with electron-forge (#3802) - by @@KobeNguyenT + * Improve the configuration of electron testing when the app is build with electron-forge (#3802) - by @KobeNguyenT ```js const path = require("path"); @@ -619,7 +619,7 @@ exports.config = { ๐Ÿ›ฉ๏ธ Features #### [Playwright] new features and improvements - * Parse the response in recording network steps (#3771) - by @@KobeNguyenT + * Parse the response in recording network steps (#3771) - by @KobeNguyenT ```js const traffics = await I.grabRecordedNetworkTraffics(); @@ -631,7 +631,7 @@ exports.config = { expect(traffics[1].response.status).to.equal(200); expect(traffics[1].response.body).to.contain({ name: 'this was another mocked' }); ``` - * Grab metrics (#3809) - by @@KobeNguyenT + * Grab metrics (#3809) - by @KobeNguyenT ```js const metrics = await I.grabMetrics(); @@ -678,7 +678,7 @@ const metrics = await I.grabMetrics(); ] ``` -* Grab WebSocket (WS) messages (#3789) - by @@KobeNguyenT +* Grab WebSocket (WS) messages (#3789) - by @KobeNguyenT * `flushWebSocketMessages` * `grabWebSocketMessages` * `startRecordingWebSocketMessages` @@ -713,13 +713,13 @@ const afterWsMessages = I.grabWebSocketMessages(); expect(wsMessages.length).to.equal(afterWsMessages.length); ``` -* Move from `ElementHandle` to `Locator`. This change is quite major, but it happened under hood, so should not affect your code. (#3738) - by @@KobeNguyenT +* Move from `ElementHandle` to `Locator`. This change is quite major, but it happened under hood, so should not affect your code. (#3738) - by @KobeNguyenT ## 3.5.3 ๐Ÿ›ฉ๏ธ Features -* [Playwright] Added commands to check network traffic #3748 - by @ngraf @@KobeNguyenT +* [Playwright] Added commands to check network traffic #3748 - by @ngraf @KobeNguyenT * `startRecordingTraffic` * `grabRecordedNetworkTraffics` * `blockTraffic` @@ -764,7 +764,7 @@ Examples: ๐Ÿ› Bugfix -* [retryStepPlugin] Fix retry step when using global retry #3768 - by @@KobeNguyenT +* [retryStepPlugin] Fix retry step when using global retry #3768 - by @KobeNguyenT ๐Ÿ—‘ Deprecated @@ -775,17 +775,17 @@ Examples: ๐Ÿ› Bug Fixes * [Playwright] reverted `clearField` to previous implementation -* [OpenAI] fixed running helper in pause mode. #3755 by @@KobeNguyenT +* [OpenAI] fixed running helper in pause mode. #3755 by @KobeNguyenT ## 3.5.1 ๐Ÿ›ฉ๏ธ Features -* [Puppeteer][WebDriver][TestCafe] Added methods by @@KobeNguyenT in #3737 +* [Puppeteer][WebDriver][TestCafe] Added methods by @KobeNguyenT in #3737 * `blur` * `focus` * Improved BDD output to print steps without `I.` commands` by @davertmik #3739 -* Improved `codecept init` setup for Electron tests by @@KobeNguyenT. See #3733 +* Improved `codecept init` setup for Electron tests by @KobeNguyenT. See #3733 ๐Ÿ› Bug Fixes @@ -795,7 +795,7 @@ Examples: * Fixed Playwright docs by @Horsty80 * Fixed ai docs by @ngraf -* Various fixes by @@KobeNguyenT +* Various fixes by @KobeNguyenT ## 3.5.0 @@ -809,7 +809,7 @@ Examples: * added [`OpenAI`](/helpers/openai) helper -- [Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with `highlightElement` option set (#3672) - by @@KobeNguyenT +- [Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with `highlightElement` option set (#3672) - by @KobeNguyenT ![](https://user-images.githubusercontent.com/220264/250415226-a7620418-56a4-4837-b790-b15e91e5d1f0.png) @@ -847,18 +847,18 @@ And executed via `run-workers` with `all` argument npx codeceptjs run-workers 2 all ``` -- [Appium] Add Appium v2 support (#3622) - by @@KobeNguyenT -- Improve `gpo` command to create page objects as modules or as classes (#3625) - by @@KobeNguyenT -- Added `emptyOutputFolder` config to clean up output before running tests (#3604) - by @@KobeNguyenT +- [Appium] Add Appium v2 support (#3622) - by @KobeNguyenT +- Improve `gpo` command to create page objects as modules or as classes (#3625) - by @KobeNguyenT +- Added `emptyOutputFolder` config to clean up output before running tests (#3604) - by @KobeNguyenT - Add `secret()` function support to `append()` and `type()` (#3615) - by @anils92 -- [Playwright] Add `bypassCSP` option to helper's config (#3641) - by @@KobeNguyenT -- Print number of tests for each suite in dryRun (#3620) - by @@KobeNguyenT +- [Playwright] Add `bypassCSP` option to helper's config (#3641) - by @KobeNguyenT +- Print number of tests for each suite in dryRun (#3620) - by @KobeNguyenT ๐Ÿ› Bug Fixes -- Support `--grep` in dry-run command (#3673) - by @@KobeNguyenT -- Fix typings improvements in playwright (#3650) - by @@KobeNguyenT -- Fixed global retry #3667 by @@KobeNguyenT +- Support `--grep` in dry-run command (#3673) - by @KobeNguyenT +- Fix typings improvements in playwright (#3650) - by @KobeNguyenT +- Fixed global retry #3667 by @KobeNguyenT - Fixed creating JavaScript test using "codeceptjs gt" (#3611) - by Jaromir Obr From 7c5dd8b59c7a7dd22610e61023b117fa19cfeba1 Mon Sep 17 00:00:00 2001 From: KobeNguyenT <7845001+kobenguyent@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:15:26 +0100 Subject: [PATCH 3/4] fix: seeCssPropertiesOnElements verification condition (#4057) * fix: seeCssPropertiesOnElements verification condition * fix: UTs * fix: UTs * fix: UTs * fix: UTs --- .github/workflows/playwright.yml | 2 +- lib/colorUtils.js | 10 +++++++++ lib/helper/Playwright.js | 17 +++++++--------- lib/helper/Puppeteer.js | 35 ++++++++++++++------------------ test/helper/Playwright_test.js | 16 +++++++++++++++ test/helper/webapi.js | 2 +- 6 files changed, 50 insertions(+), 32 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 6571d838e..ed5aa4c47 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -50,5 +50,5 @@ jobs: run: "BROWSER=firefox node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug" - name: run webkit tests run: "BROWSER=webkit node ./bin/codecept.js run -c test/acceptance/codecept.Playwright.js --grep @Playwright --debug" - - name: run unit tests + - name: run chromium unit tests run: ./node_modules/.bin/mocha test/helper/Playwright_test.js --timeout 5000 diff --git a/lib/colorUtils.js b/lib/colorUtils.js index 349de6a46..ce1f6465a 100644 --- a/lib/colorUtils.js +++ b/lib/colorUtils.js @@ -226,15 +226,25 @@ function isColorProperty(prop) { 'color', 'background', 'backgroundColor', + 'background-color', 'borderColor', + 'border-color', 'borderBottomColor', + 'border-bottom-color', 'borderLeftColor', + 'border-left-color', 'borderRightColor', 'borderTopColor', 'caretColor', 'columnRuleColor', 'outlineColor', 'textDecorationColor', + 'border-right-color', + 'border-top-color', + 'caret-color', + 'column-rule-color', + 'outline-color', + 'text-decoration-color', ].indexOf(prop) > -1; } diff --git a/lib/helper/Playwright.js b/lib/helper/Playwright.js index 95cab8be0..714b20c14 100644 --- a/lib/helper/Playwright.js +++ b/lib/helper/Playwright.js @@ -2119,19 +2119,17 @@ class Playwright extends Helper { const cssPropertiesCamelCase = convertCssPropertiesToCamelCase(cssProperties); const elemAmount = res.length; - const commands = []; let props = []; for (const element of res) { - const cssProperties = await element.evaluate((el) => getComputedStyle(el)); - - Object.keys(cssPropertiesCamelCase).forEach(prop => { + for (const prop of Object.keys(cssProperties)) { + const cssProp = await this.grabCssPropertyFrom(locator, prop); if (isColorProperty(prop)) { - props.push(convertColorToRGBA(cssProperties[prop])); + props.push(convertColorToRGBA(cssProp)); } else { - props.push(cssProperties[prop]); + props.push(cssProp); } - }); + } } const values = Object.keys(cssPropertiesCamelCase).map(key => cssPropertiesCamelCase[key]); @@ -2139,9 +2137,8 @@ class Playwright extends Helper { let chunked = chunkArray(props, values.length); chunked = chunked.filter((val) => { for (let i = 0; i < val.length; ++i) { - const _acutal = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(val[i], 10); - const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10); - if (_acutal !== _expected) return false; + // eslint-disable-next-line eqeqeq + if (val[i] != values[i]) return false; } return true; }); diff --git a/lib/helper/Puppeteer.js b/lib/helper/Puppeteer.js index e94b40817..41f2fd44a 100644 --- a/lib/helper/Puppeteer.js +++ b/lib/helper/Puppeteer.js @@ -1770,31 +1770,26 @@ class Puppeteer extends Helper { const cssPropertiesCamelCase = convertCssPropertiesToCamelCase(cssProperties); const elemAmount = res.length; - const commands = []; - res.forEach((el) => { - Object.keys(cssPropertiesCamelCase).forEach((prop) => { - commands.push(el.executionContext() - .evaluate((el) => { - const style = window.getComputedStyle ? getComputedStyle(el) : el.currentStyle; - return JSON.parse(JSON.stringify(style)); - }, el) - .then((props) => { - if (isColorProperty(prop)) { - return convertColorToRGBA(props[prop]); - } - return props[prop]; - })); - }); - }); - let props = await Promise.all(commands); + let props = []; + + for (const element of res) { + for (const prop of Object.keys(cssProperties)) { + const cssProp = await this.grabCssPropertyFrom(locator, prop); + if (isColorProperty(prop)) { + props.push(convertColorToRGBA(cssProp)); + } else { + props.push(cssProp); + } + } + } + const values = Object.keys(cssPropertiesCamelCase).map(key => cssPropertiesCamelCase[key]); if (!Array.isArray(props)) props = [props]; let chunked = chunkArray(props, values.length); chunked = chunked.filter((val) => { for (let i = 0; i < val.length; ++i) { - const _acutal = Number.isNaN(val[i]) || (typeof values[i]) === 'string' ? val[i] : Number.parseInt(val[i], 10); - const _expected = Number.isNaN(values[i]) || (typeof values[i]) === 'string' ? values[i] : Number.parseInt(values[i], 10); - if (_acutal !== _expected) return false; + // eslint-disable-next-line eqeqeq + if (val[i] != values[i]) return false; } return true; }); diff --git a/test/helper/Playwright_test.js b/test/helper/Playwright_test.js index 7f7c6221f..3ed3cdc89 100644 --- a/test/helper/Playwright_test.js +++ b/test/helper/Playwright_test.js @@ -33,6 +33,7 @@ describe('Playwright', function () { I = new Playwright({ url: siteUrl, windowSize: '500x700', + browser: process.env.BROWSER || 'chromium', show: false, waitForTimeout: 5000, waitForAction: 500, @@ -112,6 +113,17 @@ describe('Playwright', function () { }); }); + describe('#seeCssPropertiesOnElements', () => { + it('should check background-color css property for given element', async () => { + try { + await I.amOnPage('https://codecept.io/helpers/Playwright/'); + await I.seeCssPropertiesOnElements('.navbar', { 'background-color': 'rgb(128, 90, 213)' }); + } catch (e) { + e.message.should.include('expected element (.navbar) to have CSS property { \'background-color\': \'rgb(128, 90, 213)\' }'); + } + }); + }); + webApiTests.tests(); describe('#click', () => { @@ -1051,6 +1063,7 @@ describe('Playwright', function () { describe('#startRecordingWebSocketMessages, #grabWebSocketMessages, #stopRecordingWebSocketMessages', () => { it('should throw error when calling grabWebSocketMessages before startRecordingWebSocketMessages', () => { + if (process.env.BROWSER === 'firefox') this.skip(); try { I.amOnPage('https://websocketstest.com/'); I.waitForText('Work for You!'); @@ -1061,6 +1074,7 @@ describe('Playwright', function () { }); it('should flush the WS messages', async () => { + if (process.env.BROWSER === 'firefox') this.skip(); await I.startRecordingWebSocketMessages(); I.amOnPage('https://websocketstest.com/'); I.waitForText('Work for You!'); @@ -1070,6 +1084,7 @@ describe('Playwright', function () { }); it('should see recording WS messages', async () => { + if (process.env.BROWSER === 'firefox') this.skip(); await I.startRecordingWebSocketMessages(); await I.amOnPage('https://websocketstest.com/'); I.waitForText('Work for You!'); @@ -1078,6 +1093,7 @@ describe('Playwright', function () { }); it('should not see recording WS messages', async () => { + if (process.env.BROWSER === 'firefox') this.skip(); await I.startRecordingWebSocketMessages(); await I.amOnPage('https://websocketstest.com/'); I.waitForText('Work for You!'); diff --git a/test/helper/webapi.js b/test/helper/webapi.js index 3c9ea7b1c..39f7cdfdd 100644 --- a/test/helper/webapi.js +++ b/test/helper/webapi.js @@ -1399,7 +1399,7 @@ module.exports.tests = function () { }); it('should check css property for several elements', async function () { - if (isHelper('TestCafe')) this.skip(); + if (isHelper('TestCafe') || process.env.BROWSER === 'firefox') this.skip(); try { await I.amOnPage('/'); From 518a9a42ebe85d84c2d0ae8f46a76bb39a48939d Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Thu, 7 Dec 2023 10:19:11 +0100 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 91 ++++++++++++++++++++++++++-------------------------- runok.js | 4 +-- 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 412ada378..1f1f67425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,51 @@ โค๏ธ Thanks all to those who contributed to make this release! โค๏ธ +๐Ÿ›ฉ๏ธ *Features* +* feat: expose WebElement (#4043) - by @KobeNguyenT +``` +Now we expose the WebElements that are returned by the WebHelper and you could make the subsequence actions on them. + +// Playwright helper would return the Locator + +I.amOnPage('/form/focus_blur_elements'); +const webElements = await I.grabWebElements('#button'); +webElements[0].click(); +``` +* feat(playwright): support HAR replaying (#3990) - by @KobeNguyenT +``` +Replaying from HAR + + // Replay API requests from HAR. + // Either use a matching response from the HAR, + // or abort the request if nothing matches. + I.replayFromHar('./output/har/something.har', { url: "*/**/api/v1/fruits" }); + I.amOnPage('https://demo.playwright.dev/api-mocking'); + I.see('CodeceptJS'); +[Parameters] +harFilePath [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) Path to recorded HAR file +opts [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)? [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har) +``` +* feat(playwright): support HAR recording (#3986) - by @KobeNguyenT +``` +A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded. +It contains information about the request and response headers, cookies, content, timings, and more. +You can use HAR files to mock network requests in your tests. HAR will be saved to output/har. +More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har. + +... +recordHar: { + mode: 'minimal', // possible values: 'minimal'|'full'. + content: 'embed' // possible values: "omit"|"embed"|"attach". +} +... +``` +* improvement(playwright): support partial string for option (#4016) - by @KobeNguyenT +``` +await I.amOnPage('/form/select'); +await I.selectOption('Select your age', '21-'); +``` + ๐Ÿ› *Bug Fixes* * fix(playwright): proceedSee could not find the element (#4006) - by @hatufacci * fix(appium): remove the vendor prefix of 'bstack:options' (#4053) - by @mojtabaalavi @@ -105,57 +150,13 @@ Faker examples -- * fix: set getPageTimeout to 30s (#4031) - by @KobeNguyenT * fix(appium): expose switchToContext (#4015) - by @KobeNguyenT * fix: promise issue (#4013) - by @KobeNguyenT +* fix: seeCssPropertiesOnElements issue with improper condition (#4057) - by @KobeNguyenT ๐Ÿ“– *Documentation* * docs: Update clearCookie documentation for Playwright helper (#4005) - by @Hellosager * docs: improve the example code for autoLogin (#4019) - by @KobeNguyenT ![Screenshot 2023-11-22 at 14 40 11](https://github.com/codeceptjs/CodeceptJS/assets/7845001/c05ac436-efd0-4bc0-a46c-386f915c0f17) -๐Ÿ›ฉ๏ธ *Features* -* feat: expose WebElement (#4043) - by @KobeNguyenT -``` -Now we expose the WebElements that are returned by the WebHelper and you could make the subsequence actions on them. - -// Playwright helper would return the Locator - -I.amOnPage('/form/focus_blur_elements'); -const webElements = await I.grabWebElements('#button'); -webElements[0].click(); -``` -* feat(playwright): support HAR replaying (#3990) - by @KobeNguyenT -``` -Replaying from HAR - - // Replay API requests from HAR. - // Either use a matching response from the HAR, - // or abort the request if nothing matches. - I.replayFromHar('./output/har/something.har', { url: "*/**/api/v1/fruits" }); - I.amOnPage('https://demo.playwright.dev/api-mocking'); - I.see('CodeceptJS'); -[Parameters] -harFilePath [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) Path to recorded HAR file -opts [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)? [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har) -``` -* feat(playwright): support HAR recording (#3986) - by @KobeNguyenT -``` -A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded. -It contains information about the request and response headers, cookies, content, timings, and more. -You can use HAR files to mock network requests in your tests. HAR will be saved to output/har. -More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har. - -... -recordHar: { - mode: 'minimal', // possible values: 'minimal'|'full'. - content: 'embed' // possible values: "omit"|"embed"|"attach". -} -... -``` -* improvement(playwright): support partial string for option (#4016) - by @KobeNguyenT -``` -await I.amOnPage('/form/select'); -await I.selectOption('Select your age', '21-'); -``` - ## 3.5.8 Thanks all to those who contributed to make this release! diff --git a/runok.js b/runok.js index 0de4564ba..db25dc2e9 100755 --- a/runok.js +++ b/runok.js @@ -431,12 +431,12 @@ title: ${name} const _changelog = `## ${newVersion}\n โค๏ธ Thanks all to those who contributed to make this release! โค๏ธ +๐Ÿ›ฉ๏ธ *Features* + ๐Ÿ› *Bug Fixes* ๐Ÿ“– *Documentation* -๐Ÿ›ฉ๏ธ *Features* - ${changelog}`; fs.writeFileSync(`./${file}`, _changelog);