`
+ })
+
+ const rows = []
+ const chunkSize = 4
+ for (let i = 0; i < contributors.length; i += chunkSize) {
+ rows.push(`
${contributors.slice(i, i + chunkSize).join('')}
`)
+ }
+
+ const contributorsTable = `
+
+ ${rows.join('\n')}
+
+ `
+
+ const readmePath = path.join(process.cwd(), 'README.md')
+ let content = fs.readFileSync(readmePath, 'utf-8')
+
+ const contributorsSectionRegex = /(## Contributors\s*\n)([\s\S]*?)(\n##|$)/
+ const match = content.match(contributorsSectionRegex)
+
+ if (match) {
+ const updatedContent = content.replace(contributorsSectionRegex, `${match[1]}\n${contributorsTable}\n${match[3]}`)
+ fs.writeFileSync(readmePath, updatedContent, 'utf-8')
+ } else {
+ content += `\n${contributorsTable}`
+ fs.writeFileSync(readmePath, content, 'utf-8')
+ }
+
+ say('Contributors section updated successfully!')
+ } catch (error) {
+ yell(`Error fetching contributors: ${error.message}`)
+ }
+}
+
+
+/**
+ * Scaffold a config, feature test and runner test for a new feature.
+ * @param {string} featureName - Name of the feature to scaffold tests for.
+ */
+export async function runnerCreateTests(featureName) {
+ const fsp = fs.promises
+
+ const configDir = path.join('test/data/sandbox/configs', featureName)
+ await fsp.mkdir(configDir, { recursive: true })
+
+ const configContent = `exports.config = {
+ tests: './*_test.js',
+ output: './output',
+ helpers: {
+ FileSystem: {},
+ },
+ include: {},
+ bootstrap: false,
+ mocha: {},
+ name: '${featureName} tests'
+}
+`
+ await fsp.writeFile(path.join(configDir, `codecept.conf.js`), configContent)
+
+ const testContent = `Feature('${featureName}');
+
+Scenario('test ${featureName}', ({ I }) => {
+ // Add test steps here
+});
+`
+ await fsp.writeFile(path.join(configDir, `${featureName}_test.js`), testContent)
+
+ const runnerTestContent = `const { expect } = require('expect')
+const exec = require('child_process').exec
+const { codecept_dir, codecept_run } = require('./consts')
+const debug = require('debug')('codeceptjs:tests')
+
+const config_run_config = (config, grep, verbose = false) =>
+ \`\${codecept_run} \${verbose ? '--verbose' : ''} --config \${codecept_dir}/configs/${featureName}/\${config} \${grep ? \`--grep "\${grep}"\` : ''}\`
+
+describe('CodeceptJS ${featureName}', function () {
+ this.timeout(10000)
+
+ it('should run ${featureName} test', done => {
+ exec(config_run_config('codecept.conf.js'), (err, stdout) => {
+ debug(stdout)
+ expect(stdout).toContain('OK')
+ expect(err).toBeFalsy()
+ done()
+ })
+ })
+})
+`
+ await fsp.writeFile(path.join('test/runner', `${featureName}_test.js`), runnerTestContent)
+
+ say(`Created test files for feature: ${featureName}`)
+ say('Run codecept tests with:')
+ say(`./bin/codecept.js run --config ${configDir}/codecept.conf.js`)
+ say('')
+ say('Run tests with:')
+ say(`npx mocha test/runner --grep ${featureName}`)
+}
+
+async function processChangelog() {
+ const file = 'CHANGELOG.md'
+ let changelog = fs.readFileSync(file).toString()
+
+ changelog = changelog.replace(/\s@([\w-]+)/gm, ' **[$1](https://github.com/$1)**')
+ changelog = changelog.replace(/#(\d+)/gm, '[#$1](https://github.com/codeceptjs/CodeceptJS/issues/$1)')
+ changelog = changelog.replace(/\s\[(\w+)\]\s/gm, ' **[$1]** ')
+
+ await writeToFile('docs/changelog.md', line => {
+ line`---`
+ line`permalink: /changelog`
+ line`title: Releases`
+ line`sidebar: false`
+ line`layout: Section`
+ line`---`
+ line``
+ line`# Releases`
+ line``
+ line`${changelog}`
+ })
+}
+
+/**
+ * Run the read-only REST test server on port 8010.
+ */
+export async function testServer() {
+ await shell`node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010 --read-only`
+}
+
+/**
+ * Run the writable REST test server on port 8010.
+ */
+export async function testServerWritable() {
+ await shell`node bin/test-server.js test/data/rest/db.json --host 0.0.0.0 -p 8010`
+}
+
+/**
+ * Start the mock server.
+ */
+export async function mockServerStart() {
+ await shell`node test/mock-server/start-mock-server.js`
+}
+
+/**
+ * Stop the mock server (kills the process listening on port 3001).
+ */
+export async function mockServerStop() {
+ await shell`kill -9 $(lsof -t -i:3001)`
+}
+
+/**
+ * Run the GraphQL test data server.
+ */
+export async function graphql() {
+ await shell`node test/data/graphql/index.js`
+}
+
+/**
+ * Lint the codebase with ESLint.
+ */
+export async function lint() {
+ await shell`eslint bin/ examples/ lib/ test/ translations/ runok.cjs`
+}
+
+/**
+ * Lint and auto-fix the codebase with ESLint.
+ */
+export async function lintFix() {
+ await shell`eslint bin/ examples/ lib/ test/ translations/ runok.cjs --fix`
+}
+
+/**
+ * Format the codebase with Prettier.
+ */
+export async function prettier() {
+ await shell`prettier --config prettier.config.js --write bin/**/*.js lib/**/*.js test/**/*.js translations/**/*.js runok.cjs`
+}
+
+/**
+ * Run unit tests.
+ */
+export async function testUnit() {
+ await shell`mocha test/unit --recursive --timeout 10000 --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run REST tests.
+ */
+export async function testRest() {
+ await shell`mocha test/rest --recursive --timeout 20000 --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run runner tests.
+ */
+export async function testRunner() {
+ await shell`mocha test/runner --recursive --timeout 10000 --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run the full test suite: unit, rest and runner tests.
+ */
+export async function test() {
+ task.stopOnFailures()
+ await testUnit()
+ await testRest()
+ await testRunner()
+}
+
+/**
+ * Start the mock server, then run the full test suite.
+ */
+export async function testWithMockServer() {
+ task.stopOnFailures()
+ await mockServerStart()
+ await test()
+}
+
+/**
+ * Run quick Appium tests.
+ */
+export async function testAppiumQuick() {
+ await shell`mocha test/helper/Appium_test.js --grep 'quick' --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run the remaining (second) Appium tests.
+ */
+export async function testAppiumOther() {
+ await shell`mocha test/helper/Appium_test.js --grep 'second' --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run quick iOS Appium tests.
+ */
+export async function testIosAppiumQuick() {
+ await shell`mocha test/helper/Appium_ios_test.js --grep 'quick' --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run the remaining (second) iOS Appium tests.
+ */
+export async function testIosAppiumOther() {
+ await shell`mocha test/helper/Appium_ios_test.js --grep 'second' --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Start the PHP test app on port 8000. Warning! PHP required!
+ */
+export async function testAppStart() {
+ await shell`php -S 127.0.0.1:8000 -t test/data/app`
+}
+
+/**
+ * Stop the PHP test app (kills the process listening on port 8000).
+ */
+export async function testAppStop() {
+ await shell`kill -9 $(lsof -t -i:8000)`
+}
+
+/**
+ * Run Playwright helper unit tests.
+ */
+export async function testWebapiPlaywright() {
+ await shell`mocha test/helper/Playwright_test.js --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run Puppeteer helper unit tests.
+ */
+export async function testWebapiPuppeteer() {
+ await shell`mocha test/helper/Puppeteer_test.js --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run WebDriver helper unit tests.
+ */
+export async function testWebapiWebdriver() {
+ await shell`mocha test/helper/WebDriver_test.js --timeout 10000 --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run WebDriver helper unit tests without a Selenium server.
+ */
+export async function testWebapiWebdriverNoSelenium() {
+ await shell`mocha test/helper/WebDriver.noSeleniumServer_test.js --timeout 10000 --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run Expect helper unit tests.
+ */
+export async function testExpect() {
+ await shell`mocha test/helper/Expect_test.js --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Run plugin tests.
+ */
+export async function testPlugin() {
+ await shell`mocha test/plugin/plugin_test.js --reporter @testomatio/reporter/mocha`
+}
+
+/**
+ * Regenerate TypeScript definition files via typings/fixDefFiles.js.
+ */
+export async function typesFix() {
+ await shell`node typings/fixDefFiles.js`
+}
+
+/**
+ * Fix typings and run tsd type tests.
+ */
+export async function dtslint() {
+ task.stopOnFailures()
+ await typesFix()
+ await shell`tsd`
+}
+
+/**
+ * Install husky git hooks.
+ */
+export async function prepare() {
+ await shell`husky install`
+}
+
+
+function replaceInFile(file, fn) {
+ let text = fs.readFileSync(file).toString()
+ fn({
+ replace(pattern, replacement) {
+ text = text.replace(pattern, replacement)
+ },
+ })
+ fs.writeFileSync(file, text)
+}
+
+function ensureDir(dir) {
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true })
+}
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 841870af0..000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,1676 +0,0 @@
-## 2.6.11
-
-* [Playwright] Playwright 1.4 compatibility
-* [Playwright] Added `ignoreHTTPSErrors` config option (default: false). See #2566 by gurjeetbains
-* Added French translation by @vimar
-* [WebDriver] Updated `dragSlider` to work in WebDriver W3C protocol. Fixes #2557 by suniljaiswal01
-
-## 2.6.10
-
-* Fixed saving options for suite via `Feature('title', {key: value})` by @Diokuz. See #2553 and [Docs](https://codecept.io/advanced/#dynamic-configuration)
-
-## 2.6.9
-
-* [Puppeteer][Playwright] SessionStorage is now cleared in after hook. See #2524
-* When helper load failed the error stack is now logged by @SkReD. See #2541
-* Small documentation fixes.
-
-## 2.6.8
-
-* [WebDriver][Protractor][Playwright][Puppeteer][Nightmare] `saveElementScreenshot` method added to make screenshot of an element. By @suniljaiswal01
-* [Playwright][Puppeteer] Added `type` method to type a text using keyboard with an optional delay.
-* [WebDriver] Added optional `delay` argument to `type` method to slow down typing.
-* [Puppeteer] Fixed `amOnPage` freeze when `getPageTimeout` is 0"; set 30 sec as default timeout by @Vorobeyko.
-* Fixed printing step with null argument in custom helper by @sjana-aj. See #2494
-* Fix missing screenshot on failure when REST helper is in use #2513 by @PeterNgTr
-* Improve error logging in the `screenshotOnFail` plugin #2512 by @pablopaul
-
-## 2.6.7
-
-* Add REST helper into `standardActingHelpers` array #2474 by @PeterNgTr
-* Add missing `--invert` option for `run-workers` command #2504 by @pablopaul
-* [WebDriver] Introduce `forceRightClick` method #2485 bylsuniljaiswal01
-* [Playwright] Fix `setCookie` method #2491 by @bmbarker90
-* [TypeScript] Update compilerOptions.target to es2017 #2483 by @shanplourde
-* [Mocha] Honor reporter configuration #2465 by @trinhpham
-
-## 2.6.6
-
-* Puppeteer 4.0 support. Important: MockRequest helper won't work with Puppeter > 3.3
-* Added `xFeature` and `Feature.skip` to skip all tests in a suite. By @Georgegriff
-* [Appium] Fixed #2428 Android native locator support by @idxn
-* [WebDriver] Fixed `waitNumberOfVisibleElements` to actually filter visible elements. By @ilangv
-* [Puppeteer] Fixed handling error which is not an Error object. Fixes `cannot read property indexOf of undefined` error. Fix #2436 by @Georgegriff
-* [Puppeteer] Print error on page crash by @Georgegriff
-
-## 2.6.5
-
-* Added `test.skipped` event to run-workers, fixing allure reports with skipped tests in workers #2391. Fix #2387 by @koushikmohan1996
-* [Playwright] Fixed calling `waitFor*` methods with custom locators #2314. Fix #2389 by @Georgegriff
-
-## 2.6.4
-
-* [Playwright] **Playwright 1.0 support** by @Georgegriff.
-
-## 2.6.3
-
-* [stepByStepReport plugin] Fixed when using plugin with BeforeSuite. Fixes #2337 by @mirao
-* [allure plugin] Fixed reporting of tests skipped by failure in before hook. Refer to #2349 & #2354. Fix by @koushikmohan1996
-
-## 2.6.2
-
-* [WebDriver][Puppeteer] Added `forceClick` method to emulate click event instead of using native events.
-* [Playwright] Updated to 0.14
-* [Puppeteer] Updated to Puppeteer v3.0
-* [wdio] Fixed undefined output directory for wdio plugns. Fix By @PeterNgTr
-* [Playwright] Introduced `handleDownloads` method to download file. Please note, this method has slightly different API than the same one in Puppeteer.
-* [allure] Fixed undefined output directory for allure plugin on using custom runner. Fix by @charliepradeep
-* [WebDriver] Fixed `waitForEnabled` fix for webdriver 6. Fix by @dsharapkou
-* Workers: Fixed negative failure result if use scenario with the same names. Fix by @Vorobeyko
-* [MockRequest] Updated documentation to match new helper version
-* Fixed: skipped tests are not reported if a suite failed in `before`. Refer #2349 & #2354. Fix by @koushikmohan1996
-
-## 2.6.1
-
-* [screenshotOnFail plugin] Fixed saving screenshot of active session.
-* [screenshotOnFail plugin] Fix issue #2301 when having the flag `uniqueScreenshotNames`=true results in `undefined` in screenshot file name by @PeterNgTr
-* [WebDriver] Fixed `waitForElement` not applying the optional second argument to override the default timeout in webdriverio 6. Fix by @Mooksc
-* [WebDriver] Updated `waitUntil` method which is used by all of the wait* functions. This updates the `waitForElement` by the same convention used to update `waitForVisible` and `waitInUrl` to be compatible with both WebDriverIO v5 & v6. See #2313 by @Mooksc
-
-## 2.6.0
-
-* **[Playwright] Updated to Playwright 0.12** by @Georgegriff.
-
-Upgrade playwright to ^0.12:
-
-```
-npm i playwright@^0.12 --save
-```
-
-[Notable changes](https://github.com/microsoft/playwright/releases/tag/v0.12.0):
- * Fixed opening two browsers on start
- * `executeScript` - passed function now accepts only one argument. Pass in objects or arrays if you need multtple arguments:
-```js
-// Old style, does not work anymore:
-I.executeScript((x, y) => x + y, x, y);
-// New style, passing an object:
-I.executeScript(({x, y}) => x + y, {x, y});
-```
- * `click` - automatically waits for element to become clickable (visible, not animated) and waits for navigation.
- * `clickLink` - deprecated
- * `waitForClickable` - deprecated
- * `forceClick` - added
- * Added support for custom locators. See #2277
- * Introduced [device emulation](/playwright/#device-emulation):
- * globally via `emulate` config option
- * per session
-
-**[WebDriver] Updated to webdriverio v6** by @PeterNgTr.
-
-Read [release notes](https://webdriver.io/blog/2020/03/26/webdriverio-v6-released.html), then
-upgrade webdriverio to ^6.0:
-
-```
-npm i webdriverio@^6.0 --save
-```
-*(webdriverio v5 support is deprecated and will be removed in CodeceptJS 3.0)*
-
-[WebDriver] Introduced [Shadow DOM support](/shadow) by @gkushang
-
-```js
-I.click({ shadow: ['my-app', 'recipe-hello', 'button'] });
-```
-
-* **Fixed parallel execution of `run-workers` for Gherkin** scenarios by @koushikmohan1996
-* [MockRequest] Updated and **moved to [standalone package](https://github.com/codecept-js/mock-request)**:
- * full support for record/replay mode for Puppeteer
- * added `mockServer` method to use flexible PollyJS API to define mocks
- * fixed stale browser screen in record mode.
-* [Playwright] Added support on for `screenshotOnFail` plugin by @amonkc
-* Gherkin improvement: setting different tags per examples. See #2208 by @acuper
-* [TestCafe] Updated `click` to take first visible element. Fixes #2226 by @theTainted
-* [Puppeteer][WebDriver] Updated `waitForClickable` method to check for element overlapping. See #2261 by @PiQx
-* [Puppeteer] Dropped `puppeteer-firefox` support, as Puppeteer supports Firefox natively.
-* [REST] Rrespect Content-Type header. See #2262 by @pmarshall-legacy
-* [allure plugin] Fixes BeforeSuite failures in allure reports. See #2248 by @Georgegriff
-* [WebDriver][Puppeteer][Playwright] A screenshot of for an active session is saved in multi-session mode. See #2253 by @ChexWarrior
-* Fixed `--profile` option by @pablopaul. Profile value to be passed into `run-multiple` and `run-workers`:
-
-```
-npx codecept run-workers 2 --profile firefox
-```
-
-Value is available at `process.env.profile` (previously `process.profile`). See #2302. Fixes #1968 #1315
-
-* [commentStep Plugin introduced](/plugins#commentstep). Allows to annotate logical parts of a test:
-
-```js
-__`Given`;
-I.amOnPage('/profile')
-
-__`When`;
-I.click('Logout');
-
-__`Then`;
-I.see('You are logged out');
-```
-
-## 2.5.0
-
-* **Experimental: [Playwright](/playwright) helper introduced**.
-
-> [Playwright](https://github.com/microsoft/playwright/) is an alternative to Puppeteer which works very similarly to it but adds cross-browser support with Firefox and Webkit. Until v1.0 Playwright API is not stable but we introduce it to CodeceptJS so you could try it.
-
-* [Puppeteer] Fixed basic auth support when running in multiple sessions. See #2178 by @ian-bartholomew
-* [Puppeteer] Fixed `waitForText` when there is no `body` element on page (redirect). See #2181 by @Vorobeyko
-* [Selenoid plugin] Fixed overriding current capabilities by adding deepMerge. Fixes #2183 by @koushikmohan1996
-* Added types for `Scenario.todo` by @Vorobeyko
-* Added types for Mocha by @Vorobeyko. Fixed typing conflicts with Jest
-* [FileSystem] Added methods by @nitschSB
- * `waitForFile`
- * `seeFileContentsEqualReferenceFile`
-* Added `--colors` option to `run` and `run-multiple` so you force colored output in dockerized environment. See #2189 by @mirao
-* [WebDriver] Added `type` command to enter value without focusing on a field. See #2198 by @xMutaGenx
-* Fixed `codeceptjs gt` command to respect config pattern for tests. See #2200 and #2204 by @matheo
-
-
-## 2.4.3
-
-* Hotfix for interactive pause
-
-## 2.4.2
-
-* **Interactive pause improvements** by @koushikmohan1996
- * allows using in page objects and variables: `pause({ loginPage, a })`
- * enables custom commands inside pause with `=>` prefix: `=> loginPage.open()`
-* [Selenoid plugin](/plugins#selenoid) added by by @koushikmohan1996
- * uses Selenoid to launch browsers inside Docker containers
- * automatically **records videos** and attaches them to allure reports
- * can delete videos for successful tests
- * can automatically pull in and start Selenoid containers
- * works with WebDriver helper
-* Avoid failiure report on successful retry in worker by @koushikmohan1996
-* Added translation ability to Scenario, Feature and other context methods by @koushikmohan1996
- * 📢 Please help us translate context methods to your language! See [italian translation](https://github.com/codeceptjs/CodeceptJS/blob/master/translations/it-IT.js#L3) as an example and send [patches to vocabularies](https://github.com/codeceptjs/CodeceptJS/tree/master/translations).
-* allurePlugin: Added `say` comments to allure reports by @PeterNgTr.
-* Fixed no custom output folder created when executed with run-worker. Fix by @PeterNgTr
-* [Puppeteer] Fixed error description for context element not found. See #2065. Fix by @PeterNgTr
-* [WebDriver] Fixed `waitForClickable` to wait for exact number of seconds by @mirao. Resolves #2166
-* Fixed setting `compilerOptions` in `jsconfig.json` file on init by @PeterNgTr
-* [Filesystem] Added method by @nitschSB
- * `seeFileContentsEqualReferenceFile`
- * `waitForFile`
-
-
-## 2.4.1
-
-* [Hotfix] - Add missing lib that prevents codeceptjs from initializing.
-
-## 2.4.0
-
-* Improved setup wizard with `npx codecept init`:
- * **enabled [retryFailedStep](/plugins/#retryfailedstep) plugin for new setups**.
- * enabled [@codeceptjs/configure](/configuration/#common-configuration-patterns) to toggle headless/window mode via env variable
- * creates a new test on init
- * removed question on "steps file", create it by default.
-* Added [pauseOnFail plugin](/plugins/#pauseonfail). *Sponsored by Paul Vincent Beigang and his book "[Practical End 2 End Testing with CodeceptJS](https://leanpub.com/codeceptjs/)"*.
-* Added [`run-rerun` command](/commands/#run-rerun) to run tests multiple times to detect and fix flaky tests. By @Ilrilan and @Vorobeyko.
-* Added [`Scenario.todo()` to declare tests as pending](/basics#todotest). See #2100 by @Vorobeyko
-* Added support for absolute path for `output` dir. See #2049 by @elukoyanov
-* Fixed error in `npx codecept init` caused by calling `console.print`. See #2071 by @Atinux.
-* [Filesystem] Methods added by @aefluke:
- * `seeFileNameMatching`
- * `grabFileNames`
-* [Puppeteer] Fixed grabbing attributes with hyphen by @Holorium
-* [TestCafe] Fixed `grabAttributeFrom` method by @elukoyanov
-* [MockRequest] Added support for [Polly config options](https://netflix.github.io/pollyjs/#/configuration?id=configuration) by @ecrmnn
-* [TestCafe] Fixes exiting with zero code on failure. Fixed #2090 with #2106 by @koushikmohan1996
-* [WebDriver][Puppeteer] Added basicAuth support via config. Example: `basicAuth: {username: 'username', password: 'password'}`. See #1962 by @PeterNgTr
-* [WebDriver][Appium] Added `scrollIntoView` by @pablopaul
-* Fixed #2118: No error stack trace for syntax error by @senthillkumar
-* Added `parse()` method to data table inside Cucumber tests. Use it to obtain rows and hashes for test data. See #2082 by @Sraime
-
-## 2.3.6
-
-* Create better Typescript definition file through JSDoc. By @lemnis
-* `run-workers` now can use glob pattern. By @Ilrilan
-```js
-// Example:
-exports.config = {
- tests: '{./workers/base_test.workers.js,./workers/test_grep.workers.js}',
-}
-```
-* Added new command `npx codeceptjs info` which print information about your environment and CodeceptJS configs. By @jamesgeorge007
-* Fixed some typos in documantation. By @pablopaul @atomicpages @EricTendian
-* Added PULL_REQUEST template.
-* [Puppeteer][WebDriver] Added `waitForClickable` for waiting clickable element on page.
-* [TestCafe] Added support for remote connection. By @jvdieten
-* [Puppeteer] Fixed `waitForText` XPath context now works correctly. By @Heavik
-* [TestCafe] Fixed `clearField` clear field now awaits TestCafe's promise. By @orihomie
-* [Puppeteer] Fixed fails when executing localStorage on services pages. See #2026
-* Fixed empty tags in test name. See #2038
-
-## 2.3.5
-
-* Set "parse-function" dependency to "5.2.11" to avoid further installation errors.
-
-## 2.3.4
-
-* Fixed installation error "Cannot find module '@babel/runtime/helpers/interopRequireDefault'". The issue came from `parse-function` package. Fixed by @pablopaul.
-* [Puppeteer] Fixed switching to iframe without an ID by @johnyb. See #1974
-* Added `--profile` option to `run-workers` by @orihomie
-* Added a tag definition to `FeatureConfig` and `ScenarioConfig` by @sseliverstov
-
-## 2.3.3
-
-* **[customLocator plugin](#customlocator) introduced**. Adds a locator strategy for special test attributes on elements.
-
-```js
-// when data-test-id is a special test attribute
-// enable and configure plugin to replace this
-I.click({ css: '[data-test-id=register_button]');
-// with this
-I.click('$register_button');
-```
-* [Puppeteer][WebDriver] `pressKey` improvements by @martomo:
-Changed pressKey method to resolve issues and extend functionality.
- * Did not properly recognize 'Meta' (or 'Command') as modifier key.
- * Right modifier keys did not work in WebDriver using JsonWireProtocol.
- * 'Shift' + 'key' combination would not reflect actual keyboard behavior.
- * Respect sequence with multiple modifier keys passed to pressKey.
- * Added support to automatic change operation modifier key based on operating system.
-* [Puppeteer][WebDriver] Added `pressKeyUp` and `pressKeyDown` to press and release modifier keys like `Control` or `Shift`. By @martomo.
-* [Puppeteer][WebDriver] Added `grabElementBoundingRect` by @PeterNgTr.
-* [Puppeteer] Fixed speed degradation introduced in #1306 with accessibility locators support. See #1953.
-* Added `Config.addHook` to add a function that will update configuration on load.
-* Started [`@codeceptjs/configure`](https://github.com/codecept-js/configure) package with a collection of common configuration patterns.
-* [TestCafe] port's management removed (left on TestCafe itself) by @orihomie. Fixes #1934.
-* [REST] Headers are no more declared as singleton variable. Fixes #1959
-* Updated Docker image to include run tests in workers with `NUMBER_OF_WORKERS` env variable. By @PeterNgTr.
-
-## 2.3.2
-
-* [Puppeteer] Fixed Puppeteer 1.20 support by @davertmik
-* Fixed `run-workers` to run with complex configs. See #1887 by @nitschSB
-* Added `--suites` option to `run-workers` to split suites by workers (tests of the same suite goes to teh same worker). Thanks @nitschSB.
-* Added a guide on [Email Testing](https://codecept.io/email).
-* [retryFailedStepPlugin] Improved to ignore wait* steps and others. Also added option to ignore this plugin per test bases. See [updated documentation](https://codecept.io/plugins#retryfailedstep). By @davertmik
-* Fixed using PageObjects as classes by @Vorobeyko. See #1896
-* [WebDriver] Fixed opening more than one tab. See #1875 by @jplegoff. Fixes #1874
-* Fixed #1891 when `I.retry()` affected retries of next steps. By @davertmik
-
-## 2.3.1
-
-* [MockRequest] Polly helper was renamed to MockRequest.
-* [MockRequest][WebDriver] [Mocking requests](https://codecept.io/webdriver#mocking-requests) is now available in WebDriver. Thanks @radhey1851
-* [Puppeteer] Ensure configured user agent and/or window size is applied to all pages. See #1862 by @martomo
-* Improve handling of xpath locators with round brackets by @nitschSB. See #1870
-* Use WebDriver capabilities config in wdio plugin. #1869 by @quekshuy
-
-## 2.3.0
-
-
-* **[Parallel testing by workers](https://codecept.io/parallel#parallel-execution-by-workers) introduced** by @VikalpP and @davertmik. Use `run-workers` command as faster and simpler alternative to `run-multiple`. Requires NodeJS v12
-
-```
-# run all tests in parallel using 3 workers
-npx codeceptjs run-workers 3
-```
-* [GraphQL][GraphQLDataFactory] **Helpers for data management over GraphQL** APIs added. By @radhey1851.
- * Learn how to [use GraphQL helper](https://codecept.io/data#graphql) to access GarphQL API
- * And how to combine it with [GraphQLDataFactory](https://codecept.io/data#graphql-data-factory) to generate and persist test data.
-* **Updated to use Mocha 6**. See #1802 by @elukoyanov
-* Added `dry-run` command to print steps of test scenarios without running them. Fails to execute scenarios with `grab*` methods or custom code. See #1825 for more details.
-
-```
-npx codeceptjs dry-run
-```
-
-* [Appium] Optimization when clicking, searching for fields by accessibility id. See #1777 by @gagandeepsingh26
-* [TestCafe] Fixed `switchTo` by @KadoBOT
-* [WebDriver] Added geolocation actions by @PeterNgTr
- * `grabGeoLocation()`
- * `setGeoLocation()`
-* [Polly] Check typeof arguments for mock requests by @VikalpP. Fixes #1815
-* CLI improvements by @jamesgeorge007
- * `codeceptjs` command prints list of all available commands
- * added `codeceptjs -V` flag to print version information
- * warns on unknown command
-* Added TypeScript files support to `run-multiple` by @z4o4z
-* Fixed element position bug in locator builder. See #1829 by @AnotherAnkor
-* Various TypeScript typings updates by @elukoyanov and @Vorobeyko
-* Added `event.step.comment` event for all comment steps like `I.say` or gherking steps.
-
-## 2.2.1
-
-* [WebDriver] A [dedicated guide](https://codecept.io/webdriver) written.
-* [TestCafe] A [dedicated guide](https://codecept.io/testcafe) written.
-* [Puppeteer] A [chapter on mocking](https://codecept.io/puppeteer#mocking-requests) written
-* [Puppeteer][Nightmare][TestCafe] Window mode is enabled by default on `codeceptjs init`.
-* [TestCafe] Actions implemented by @hubidu
- * `grabPageScrollPosition`
- * `scrollPageToTop`
- * `scrollPageToBottom`
- * `scrollTo`
- * `switchTo`
-* Intellisense improvements. Renamed `tsconfig.json` to `jsconfig.json` on init. Fixed autocompletion for Visual Studio Code.
-* [Polly] Take configuration values from Puppeteer. Fix #1766 by @VikalpP
-* [Polly] Add preconditions to check for puppeteer page availability by @VikalpP. Fixes #1767
-* [WebDriver] Use filename for `uploadFile` by @VikalpP. See #1797
-* [Puppeteer] Configure speed of input with `pressKeyDelay` option. By @hubidu
-* Fixed recursive loading of support objects by @davertmik.
-* Fixed support object definitions in steps.d.ts by @johnyb. Fixes #1795
-* Fixed `Data().Scenario().injectDependencies()` is not a function by @andrerleao
-* Fixed crash when using xScenario & Scenario.skip with tag by @VikalpP. Fixes #1751
-* Dynamic configuration of helpers can be performed with async function. See #1786 by @cviejo
-* Added TS definitions for internal objects by @Vorobeyko
-* BDD improvements:
- * Fix for snippets command with a .feature file that has special characters by @asselin
- * Fix `--path` option on `gherkin:snippets` command by @asselin. See #1790
- * Added `--feature` option to `gherkin:snippets` to enable creating snippets for a subset of .feature files. See #1803 by @asselin.
-* Fixed: dynamic configs not reset after test. Fixes #1776 by @cviejo.
-
-## 2.2.0
-
-* **EXPERIMENTAL** [**TestCafe** helper](https://codecept.io/helpers/TestCafe) introduced. TestCafe allows to run cross-browser tests it its own very fast engine. Supports all browsers including mobile. Thanks to @hubidu for implementation! Please test it and send us feedback.
-* [Puppeteer] Mocking requests enabled by introducing [Polly.js helper](https://codecept.io/helpers/Polly). Thanks @VikalpP
-
-```js
-// use Polly & Puppeteer helpers
-I.mockRequest('GET', '/api/users', 200);
-I.mockRequest('POST', '/users', { user: { name: 'fake' }});
-```
-
-* **EXPERIMENTAL** [Puppeteer] [Firefox support](https://codecept.io/helpers/Puppeteer-firefox) introduced by @ngadiyak, see #1740
-* [stepByStepReportPlugin] use md5 hash to generate reports into unique folder. Fix #1744 by @chimurai
-* Interactive pause improvements:
- * print result of `grab` commands
- * print message for successful assertions
-* `run-multiple` (parallel execution) improvements:
- * `bootstrapAll` must be called before creating chunks. #1741 by @Vorobeyko
- * Bugfix: If value in config has falsy value then multiple config does not overwrite original value. #1756 by @LukoyanovE
-* Fixed hooks broken in 2.1.5 by @Vorobeyko
-* Fix references to support objects when using Dependency Injection. Fix by @johnyb. See #1701
-* Fix dynamic config applied for multiple helpers by @VikalpP #1743
-
-
-## 2.1.5
-
-* **EXPERIMENTAL** [Wix Detox support](https://github.com/codeceptjs/detox-helper) introduced as standalone helper. Provides a faster alternative to Appium for mobile testing.
-* Saving successful commands inside interactive pause into `_output/cli-history` file. By @hubidu
-* Fixed hanging error handler inside scenario. See #1721 by @haily-lgc.
-* Fixed by @Vorobeyko: tests did not fail when an exception was raised in async bootstrap.
-* [WebDriver] Added window control methods by @emmonspired
- * `grabAllWindowHandles` returns all window handles
- * `grabCurrentWindowHandle` returns current window handle
- * `switchToWindow` switched to window by its handle
-* [Appium] Fixed using `host` as configuration by @trinhpham
-* Fixed `run-multiple` command when `tests` config option is undefined (in Gherkin scenarios). By @gkushang.
-* German translation introduced by @hubidu
-
-## 2.1.4
-
-* [WebDriver][Puppeteer][Protractor][Nightmare] A11y locator support introduced by @Holorium. Clickable elements as well as fields can be located by following attributes:
- * `aria-label`
- * `title`
- * `aria-labelledby`
-* [Puppeteer] Added support for React locators.
- * New [React Guide](https://codecept.io/react) added.
-* [Puppeteer] Deprecated `downloadFile`
-* [Puppeteer] Introduced `handleDownloads` replacing `downloadFile`
-* [puppeteerCoverage plugin] Fixed path already exists error by @seta-tuha.
-* Fixed 'ERROR: ENAMETOOLONG' creating directory names in `run-multiple` with long config. By @artvinn
-* [REST] Fixed url autocompletion combining base and relative paths by @LukoyanovE
-* [Nightmare][Protractor] `uncheckOption` method introduced by @PeterNgTr
-* [autoLogin plugin] Enable to use without `await` by @tsuemura
-* [Puppeteer] Fixed `UnhandledPromiseRejectionWarning: "Execution context was destroyed...` by @adrielcodeco
-* [WebDriver] Keep browser window dimensions when starting a new session by @spiroid
-* Replace Ghekrin plceholders with values in files that combine a scenerio outline and table by @medtoure18.
-* Added Documentation to [locate elements in React Native](https://codecept.io/mobile-react-native-locators) apps. By @DimGun.
-* Adding optional `path` parameter to `bdd:snippets` command to append snippets to a specific file. By @cthorsen31.
-* Added optional `output` parameter to `def` command by @LukoyanovE.
-* [Puppeteer] Added `grabDataFromPerformanceTiming` by @PeterNgTr.
-* axios updated to `0.19.0` by @SteveShaffer
-* TypeScript defitions updated by @LukoyanovE. Added `secret` and `inject` function.
-
-## 2.1.3
-
-* Fixed autoLogin plugin to inject `login` function
-* Fixed using `toString()` in DataTablewhen it is defined by @tsuemura
-
-## 2.1.2
-
-* Fixed `inject` to load objects recursively.
-* Fixed TypeScript definitions for locators by @LukoyanovE
-* **EXPERIMENTAL** [WebDriver] ReactJS locators support with webdriverio v5.8+:
-
-```js
-// locating React element by name, prop, state
-I.click({ react: 'component-name', props: {}, state: {} });
-I.seeElement({ react: 'component-name', props: {}, state: {} });
-```
-
-## 2.1.1
-
-* Do not retry `within` and `session` calls inside `retryFailedStep` plugin. Fix by @tsuemura
-
-## 2.1.0
-
-* Added global `inject()` function to require actor and page objects using dependency injection. Recommended to use in page objects, step definition files, support objects:
-
-```js
-// old way
-const I = actor();
-const myPage = require('../page/myPage');
-
-// new way
-const { I, myPage } = inject();
-```
-
-* Added global `secret` function to fill in sensitive data. By @RohanHart:
-
-```js
-I.fillField('password', secret('123456'));
-```
-
-* [wdioPlugin](https://codecept.io/plugins/#wdio) Added a plugin to **support webdriverio services** including *selenium-standalone*, *sauce*, *browserstack*, etc. **Sponsored by @GSasu**
-* [Appium] Fixed `swipe*` methods by @PeterNgTr
-* BDD Gherkin Improvements:
- * Implemented `run-multiple` for feature files. **Sponsored by @GSasu**
- * Added `--features` and `--tests` options to `run-multiple`. **Sponsored by @GSasu**
- * Implemented `Before` and `After` hooks in [step definitions](https://codecept.io/bdd#before)
-* Fixed running tests by absolute path. By @batalov.
-* Enabled the adding screenshot to failed test for moch-junit-reporter by @PeterNgTr.
-* [Puppeteer] Implemented `uncheckOption` and fixed behavior of `checkOption` by @aml2610
-* [WebDriver] Fixed `seeTextEquals` on empty strings by @PeterNgTr
-* [Puppeteer] Fixed launch with `browserWSEndpoint` config by @ngadiyak.
-* [Puppeteer] Fixed switching back to main window in multi-session mode by @davertmik.
-* [autoLoginPlugin] Fixed using async functions for auto login by @nitschSB
-
-> This release was partly sponsored by @GSasu. Thanks for the support!
-Do you want to improve this project? [Learn more about sponsorin CodeceptJS
-
-
-## 2.0.8
-
-* [Puppeteer] Added `downloadFile` action by @PeterNgTr.
-
-Use it with `FileSystem` helper to test availability of a file:
-```js
- const fileName = await I.downloadFile('a.file-link');
- I.amInPath('output');
- I.seeFile(fileName);
-```
-> Actions `amInPath` and `seeFile` are taken from [FileSystem](https://codecept.io/helpers/FileSystem) helper
-
-* [Puppeteer] Fixed `autoLogin` plugin with Puppeteer by @davertmik
-* [WebDriver] `seeInField` should throw error if element has no value attrubite. By @PeterNgTr
-* [WebDriver] Fixed `seeTextEquals` passes for any string if element is empty by @PeterNgTr.
-* [WebDriver] Internal refctoring to use `el.isDisplayed` to match latest webdriverio implementation. Thanks to @LukoyanovE
-* [allure plugin] Add ability enable [screenshotDiff plugin](https://github.com/allure-framework/allure2/blob/master/plugins/screen-diff-plugin/README.md) by @Vorobeyko
-* [Appium] Fixed `locator.stringify` call by @LukoyanovE
-
-## 2.0.7
-
-* [WebDriver][Protractor][Nightmare] `rightClick` method implemented (fixed) in a standard way. By @davertmik
-* [WebDriver] Updated WebDriver API calls in helper. By @PeterNgTr
-* [stepByStepReportPlugin] Added `screenshotsForAllureReport` config options to automatically attach screenshots to allure reports. By @PeterNgTr
-* [allurePlugin] Added `addLabel` method by @Vorobeyko
-* Locator Builder: fixed `withChild` and `withDescendant` to match deep nested siblings by @Vorobeyko.
-
-## 2.0.6
-
-* Introduced [Custom Locator Strategies](https://codecept.io/locators#custom-locators).
-* Added [Visual Testing Guide](https://codecept.io/visual) by @puneet0191 and @MitkoTschimev.
-* [Puppeteer] [`puppeteerCoverage`](https://codecept.io/plugins#puppeteercoverage) plugin added to collect code coverage in JS. By @dvillarama
-* Make override option in `run-multiple` to respect the generated overridden config by @kinyat
-* Fixed deep merge for `container.append()`. Introduced `lodash.merge()`. By @Vorobeyko
-* Fixed saving screenshot on Windows by
-* Fix errors on using interactive shell with Allure plugin by tsuemura
-* Fixed using dynamic injections with `Scenario().injectDependencies` by @tsemura
-* [WebDriver][Puppeteer][Nightmare][Protractor] Fixed url protocol detection for non-http urls by @LukoyanovE
-* [WebDriver] Enabled compatibility with `stepByStepReport` by @tsuemura
-* [WebDriver] Fixed `grabHTMLFrom` to return innerHTML value by @Holorium. Fixed compatibility with WebDriverIO.
-* [WebDriver] `grabHTMLFrom` to return one HTML vlaue for one element matched, array if multiple elements found by @davertmik.
-* [Nightmare] Added `grabHTMLFrom` by @davertmik
-* Fixed `bootstrapAll` and `teardownAll` launch with path as argument by @LukoyanovE
-* Fixed `bootstrapAll` and `teardownAll` calls from exported object by @LukoyanovE
-* [WebDriver] Added possibility to define conditional checks interval for `waitUntil` by @LukoyanovE
-* Fixed storing current data in data driven tests in a test object. By @Vorobeyko
-* [WebDriver] Fixed `hostname` config option overwrite when setting a cloud provider. By @LukoyanovE
-* [WebDriver] `dragSlider` method implemented by @DavertMik
-* [WebDrover] Fixed `scrollTo` to use new webdriverio API by @PeterNgTr
-* Added Japanese translation file by @tsemura
-* Added `Locator.withDescendant()` method to find an element which contains a descendant (child, grandchild) by @Vorobeyko
-* [WebDriver] Fixed configuring capabilities for Selenoid and IE by @Vorobeyko
-* [WebDriver] Restore original window size when taking full size screenshot by @tsuemura
-* Enabled `throws()`,` fails()`, `retry()`, `timeout()`, `config()` functions for data driven tests. By @jjm409
-
-## 2.0.5
-
-[Broken Release]
-
-## 2.0.4
-
-* [WebDriver][Protractor][Nightmare][Puppeteer] `grabAttributeFrom` returns an array when multiple elements matched. By @PeterNgTr
-* [autoLogin plugin] Fixed merging users config by @nealfennimore
-* [autoDelay plugin] Added WebDriver to list of supported helpers by @mattin4d
-* [Appium] Fixed using locators in `waitForElement`, `waitForVisible`, `waitForInvisible`. By @eduardofinotti
-* [allure plugin] Add tags to allure reports by @Vorobeyko
-* [allure plugin] Add skipped tests to allure reports by @Vorobeyko
-* Fixed `Logged Test name | [object Object]` when used Data().Scenario(). By @Vorobeyko
-* Fixed Data().only.Scenario() to run for all datasets. By @Vorobeyko
-* [WebDriver] `attachFile` to work with hidden elements. Fixed in #1460 by @tsuemura
-
-
-
-## 2.0.3
-
-* [**autoLogin plugin**](https://codecept.io/plugins#autologin) added. Allows to log in once and reuse browser session. When session expires - automatically logs in again. Can persist session between runs by saving cookies to file.
-* Fixed `Maximum stack trace` issue in `retryFailedStep` plugin.
-* Added `locate()` function into the interactive shell.
-* [WebDriver] Disabled smartWait for interactive shell.
-* [Appium] Updated methods to use for mobile locators
- * `waitForElement`
- * `waitForVisible`
- * `waitForInvisible`
-* Helper and page object generators no longer update config automatically. Please add your page objects and helpers manually.
-
-## 2.0.2
-
-* [Puppeteer] Improved handling of connection with remote browser using Puppeteer by @martomo
-* [WebDriver] Updated to webdriverio 5.2.2 by @martomo
-* Interactive pause improvements by @davertmik
- * Disable retryFailedStep plugin in in interactive mode
- * Removes `Interface: parseInput` while in interactive pause
-* [ApiDataFactory] Improvements
- * added `fetchId` config option to override id retrieval from payload
- * added `onRequest` config option to update request in realtime
- * added `returnId` config option to return ids of created items instead of items themvelves
- * added `headers` config option to override default headers.
- * added a new chapter into [DataManagement](https://codecept.io/data#api-requests-using-browser-session)
-* [REST] Added `onRequest` config option
-
-
-## 2.0.1
-
-* Fixed creating project with `codecept init`.
-* Fixed error while installing webdriverio@5.
-* Added code beautifier for generated configs.
-* [WebDriver] Updated to webdriverio 5.1.0
-
-## 2.0.0
-
-* [WebDriver] **Breaking Change.** Updated to webdriverio v5. New helper **WebDriver** helper introduced.
-
- * **Upgrade plan**:
-
- 1. Install latest webdriverio
- ```
- npm install webdriverio@5 --save
- ```
-
- 2. Replace `WebDriverIO` => `WebDriver` helper name in config.
- 3. Read [webdriverio changelog](https://github.com/webdriverio/webdriverio/blob/master/CHANGELOG.md). If you were using webdriver API in your helpers, upgrade accordingly.
- 4. We made WebDriver helper to be compatible with old API so no additional changes required.
-
- > If you face issues using webdriverio v5 you can still use webdriverio 4.x and WebDriverIO helper. Make sure you have `webdriverio: ^4.0` installed.
-
- * Known issues: `attachFile` doesn't work with proxy server.
-
-* [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.
-* **Breaking Change.** Generators support in tests removed. Use `async/await` in your tests
-* **Using `codecept.conf.js` as default configuration format**
-* Fixed "enametoolong" error when saving screenshots for data driven tests by @PeterNgTr
-* Updated NodeJS to 10 in Docker image
-* [Pupeteer] Add support to use WSEndpoint. Allows to execute tests remotely. [See #1350] by @gabrielcaires (https://github.com/codeceptjs/CodeceptJS/pull/1350)
-* In interactive shell [Enter] goes to next step. Improvement by @PeterNgTr.
-* `I.say` accepts second parameter as color to print colorful comments. Improvement by @PeterNgTr.
-
-```js
-I.say('This is red', 'red'); //red is used
-I.say('This is blue', 'blue'); //blue is used
-I.say('This is by default'); //cyan is used
-```
-* Fixed allure reports for multi session testing by @PeterNgTr
-* Fixed allure reports for hooks by @PeterNgTr
-
-## 1.4.6
-
-* [Puppeteer] `dragSlider` action added by @PeterNgTr
-* [Puppeteer] Fixed opening browser in shell mode by @allenhwkim
-* [Puppeteer] Fixed making screenshot on additional sessions by @PeterNgTr. Fixes #1266
-* Added `--invert` option to `run-multiple` command by @LukoyanovE
-* Fixed steps in Allure reports by @PeterNgTr
-* Add option `output` to customize output directory in [stepByStepReport plugin](https://codecept.io/plugins/#stepbystepreport). By @fpsthirty
-* Changed type definition of PageObjects to get auto completion by @rhicu
-* Fixed steps output for async/arrow functions in CLI by @LukoyanovE. See #1329
-
-## 1.4.5
-
-* Add **require** param to main config. Allows to require Node modules before executing tests. By @LukoyanovE. For example:
- * Use `ts-node/register` to register TypeScript parser
- * Use `should` to register should-style assertions
-
-```js
-"require": ["ts-node/register", "should"]
-```
-
-* [WebDriverIO] Fix timeouts definition to be compatible with W3C drivers. By @LukoyanovE
-* Fixed: exception in Before block w/ Mocha causes test not to report failure. See #1292 by @PeterNgTr
-* Command `run-parallel` now accepts `--override` flag. Thanks to @ClemCB
-* Fixed Allure report with Before/BeforeSuite/After/AfterSuite steps. By @PeterNgTr
-* Added `RUN_MULTIPLE` env variable to [Docker config](https://codecept.io/docker/). Allows to run tests in parallel inside a container. Thanks to @PeterNgTr
-* [Mochawesome] Fixed showing screenshot on failure. Fix by @PeterNgTr
-* Fixed running tests filtering by tag names defined via `Scenario.tag()`
-
-## 1.4.4
-
-* [autoDelay plugin](https://codecept.io/plugins/#autoDelay) added. Adds tiny delay before and after an action so the page could react to actions performed.
-* [Puppeteer] improvements by @luismanuel001
- * `click` no longer waits for navigation
- * `clickLink` method added. Performs a click and waits for navigation.
-* Bootstrap scripts to be started only for `run` command and ignored on `list`, `def`, etc. Fix by @LukoyanovE
-
-
-## 1.4.3
-
-* Groups renamed to Tags for compatibility with BDD layer
-* Test and suite objects to contain tags property which can be accessed from internal API
-* Fixed adding tags for Scenario Outline in BDD
-* Added `tag()` method to ScenarioConfig and FeatureConfig:
-
-```js
-Scenario('update user profile', () => {
- // test goes here
-}).tag('@slow');
-```
-
-* Fixed attaching Allure screenshot on exception. Fix by @DevinWatson
-* Improved type definitions for custom steps. By @Akxe
-* Fixed setting `multiple.parallel.chunks` as environment variable in config. See #1238 by @ngadiyak
-
-## 1.4.2
-
-* Fixed setting config for plugins (inclunding setting `outputDir` for allure) by @jplegoff
-
-## 1.4.1
-
-* Added `plugins` option to `run-multiple`
-* Minor output fixes
-* Added Type Definition for Helper class by @Akxe
-* Fixed extracing devault extension in generators by @Akxe
-
-## 1.4.0
-
-* [**Allure Reporter Integration**](https://codecept.io/reports/#allure). Full inegration with Allure Server. Get nicely looking UI for tests,including steps, nested steps, and screenshots. Thanks **Natarajan Krishnamurthy @krish** for sponsoring this feature.
-* [Plugins API introduced](https://codecept.io/hooks/#plugins). Create custom plugins for CodeceptJS by hooking into event dispatcher, and using promise recorder.
-* **Official [CodeceptJS plugins](https://codecept.io/plugins) added**:
- * **`stepByStepReport` - creates nicely looking report to see test execution as a slideshow**. Use this plugin to debug tests in headless environment without recording a video.
- * `allure` - Allure reporter added as plugin.
- * `screenshotOnFail` - saves screenshot on fail. Replaces similar functionality from helpers.
- * `retryFailedStep` - to rerun each failed step.
-* [Puppeteer] Fix `executeAsyncScript` unexpected token by @jonathanz
-* Added `override` option to `run-multiple` command by @svarlet
-
-## 1.3.3
-
-* Added `initGlobals()` function to API of [custom runner](https://codecept.io/hooks/#custom-runner).
-
-## 1.3.2
-
-* Interactve Shell improvements for `pause()`
- * Added `next` command for **step-by-step debug** when using `pause()`.
- * Use `After(pause);` in a to start interactive console after last step.
-* [Puppeteer] Updated to Puppeteer 1.6.0
- * Added `waitForRequest` to wait for network request.
- * Added `waitForResponse` to wait for network response.
-* Improved TypeScript definitions to support custom steps and page objects. By @xt1
-* Fixed XPath detection to accept XPath which starts with `./` by @BenoitZugmeyer
-
-## 1.3.1
-
-* BDD-Gherkin: Fixed running async steps.
-* [Puppeteer] Fixed process hanging for 30 seconds. Page loading timeout default via `getPageTimeout` set 0 seconds.
-* [Puppeteer] Improved displaying client-side console messages in debug mode.
-* [Puppeteer] Fixed closing sessions in `restart:false` mode for multi-session mode.
-* [Protractor] Fixed `grabPopupText` to not throw error popup is not opened.
-* [Protractor] Added info on using 'direct' Protractor driver to helper documentation by @xt1.
-* [WebDriverIO] Added a list of all special keys to WebDriverIO helper by @davertmik and @xt1.
-* Improved TypeScript definitions generator by @xt1
-
-## 1.3.0
-
-* **Cucumber-style BDD. Introduced [Gherkin support](https://codecept.io/bdd). Thanks to [David Vins](https://github.com/dvins) and [Omedym](https://www.omedym.com) for sponsoring this feature**.
-
-Basic feature file:
-
-```gherkin
-Feature: Business rules
- In order to achieve my goals
- As a persona
- I want to be able to interact with a system
-
- Scenario: do anything in my life
- Given I need to open Google
-```
-
-Step definition:
-
-```js
-const I = actor();
-
-Given('I need to open Google', () => {
- I.amOnPage('https://google.com');
-});
-```
-
-Run it with `--features --steps` flag:
-
-```
-codeceptjs run --steps --features
-```
-
----
-
-* **Brekaing Chnage** `run` command now uses relative path + test name to run exactly one test file.
-
-Previous behavior (removed):
-```
-codeceptjs run basic_test.js
-```
-Current behavior (relative path to config + a test name)
-
-```
-codeceptjs run tests/basic_test.js
-```
-This change allows using auto-completion when running a specific test.
-
----
-
-* Nested steps output enabled for page objects.
- * to see high-level steps only run tests with `--steps` flag.
- * to see PageObjects implementation run tests with `--debug`.
-* PageObjects simplified to remove `_init()` extra method. Try updated generators and see [updated guide](https://codecept.io/pageobjects/#pageobject).
-* [Puppeteer] [Multiple sessions](https://codecept.io/acceptance/#multiple-sessions) enabled. Requires Puppeteer >= 1.5
-* [Puppeteer] Stability improvement. Waits for for `load` event on page load. This strategy can be changed in config:
- * `waitForNavigation` config option introduced. Possible options: `load`, `domcontentloaded`, `networkidle0`, `networkidle2`. See [Puppeteer API](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagewaitfornavigationoptions)
- * `getPageTimeout` config option to set maximum navigation time in milliseconds. Default is 30 seconds.
- * `waitForNavigation` method added. Explicitly waits for navigation to be finished.
-* [WebDriverIO][Protractor][Puppeteer][Nightmare] **Possible BC** `grabTextFrom` unified. Return a text for single matched element and an array of texts for multiple elements.
-* [Puppeteer]Fixed `resizeWindow` by @sergejkaravajnij
-* [WebDriverIO][Protractor][Puppeteer][Nightmare] `waitForFunction` added. Waits for client-side JavaScript function to return true by @GREENpoint.
-* [Puppeteer] `waitUntil` deprecated in favor of `waitForFunction`.
-* Added `filter` function to DataTable.
-* Send non-nested array of files to custom parallel execution chunking by @mikecbrant.
-* Fixed invalid output directory path for run-multiple by @mikecbrant.
-* [WebDriverIO] `waitUntil` timeout accepts time in seconds (as all other wait* functions). Fix by @truesrc.
-* [Nightmare] Fixed `grabNumberOfVisibleElements` to work similarly to `seeElement`. Thx to @stefanschenk and Jinbo Jinboson.
-* [Protractor] Fixed alert handling error with message 'no such alert' by @truesrc.
-
-
-## 1.2.1
-
-* Fixed running `I.retry()` on multiple steps.
-* Fixed parallel execution wih chunks.
-* [Puppeteer] Fixed `grabNumberOfVisibleElements` to return `0` instead of throwing error if no elements are found.
-
-## 1.2.0
-
-* [WebDriverIO][Protractor][Multiple Sessions](https://codecept.io/acceptance/#multiple-sessions). Run several browser sessions in one test. Introduced `session` command, which opens additional browser window and closes it after a test.
-
-```js
-Scenario('run in different browsers', (I) => {
- I.amOnPage('/hello');
- I.see('Hello!');
- session('john', () => {
- I.amOnPage('/bye');
- I.dontSee('Hello');
- I.see('Bye');
- });
- I.see('Hello');
-});
-```
-
-* [Parallel Execution](https://codecept.io/advanced/#parallel-execution) by @sveneisenschmidt. Run tests in parallel specifying number of chunks:
-
-```js
-"multiple": {
- "parallel": {
- // run in 2 processes
- "chunks": 2,
- // run all tests in chrome
- "browsers": ["chrome"]
- },
-}
-```
-
-* [Locator Builder](https://codecept.io/locators). Write complex locators with simplest API combining CSS and XPath:
-
-```js
-// select 'Edit' link inside 2nd row of a table
-locate('//table')
- .find('tr')
- .at(2)
- .find('a')
- .withText('Edit');
-```
-
-* [Dynamic configuration](https://codecept.io/advanced/#dynamic-configuration) to update helpers config per test or per suite.
-* Added `event.test.finished` which fires synchronously for both failed and passed tests.
-* [WebDriverIO][Protractor][Nightmare][Puppeteer] Full page screenshots on failure disabled by default. See [issue#1600. You can enabled them with `fullPageScreenshots: true`, however they may work unstable in Selenium.
-* `within` blocks can return values. See [updated documentation](https://codecept.io/basics/#within).
-* Removed doublt call to `_init` in helpers. Fixes issue #1036
-* Added scenario and feature configuration via fluent API:
-
-```js
-Feature('checkout')
- .timeout(3000)
- .retry(2);
-
-Scenario('user can order in firefox', (I) => {
- // see dynamic configuration
-}).config({ browser: 'firefox' })
- .timeout(20000);
-
-Scenario('this test should throw error', (I) => {
- // I.amOnPage
-}).throws(new Error);
-```
-
-## 1.1.8
-
-* Fixed generating TypeScript definitions with `codeceptjs def`.
-* Added Chinese translation ("zh-CN" and "zh-TW") by @TechQuery.
-* Fixed running tests from a different folder specified by `-c` option.
-* [Puppeteer] Added support for hash handling in URL by @gavoja.
-* [Puppeteer] Fixed setting viewport size by @gavoja. See [Puppeteer issue](https://github.com/GoogleChrome/puppeteer/issues/1183)
-
-
-## 1.1.7
-
-* Docker Image updateed. [See updated reference](https://codecept.io/docker/):
- * codeceptjs package is mounted as `/codecept` insde container
- * tests directory is expected to be mounted as `/tests`
- * `codeceptjs` global runner added (symlink to `/codecept/bin/codecept.js`)
-* [Protractor] Functions added by @reubenmiller:
- * `_locateCheckable (only available from other helpers)`
- * `_locateClickable (only available from other helpers)`
- * `_locateFields (only available from other helpers)`
- * `acceptPopup`
- * `cancelPopup`
- * `dragAndDrop`
- * `grabBrowserLogs`
- * `grabCssPropertyFrom`
- * `grabHTMLFrom`
- * `grabNumberOfVisibleElements`
- * `grabPageScrollPosition (new)`
- * `rightClick`
- * `scrollPageToBottom`
- * `scrollPageToTop`
- * `scrollTo`
- * `seeAttributesOnElements`
- * `seeCssPropertiesOnElements`
- * `seeInPopup`
- * `seeNumberOfVisibleElements`
- * `switchTo`
- * `waitForEnabled`
- * `waitForValue`
- * `waitInUrl`
- * `waitNumberOfVisibleElements`
- * `waitToHide`
- * `waitUntil`
- * `waitUrlEquals`
-* [Nightmare] added:
- * `grabPageScrollPosition` (new)
- * `seeNumberOfVisibleElements`
- * `waitToHide`
-* [Puppeteer] added:
- * `grabPageScrollPosition` (new)
-* [WebDriverIO] added"
- * `grabPageScrollPosition` (new)
-* [Puppeteer] Fixed running wait* functions without setting `sec` parameter.
-* [Puppeteer][Protractor] Fixed bug with I.click when using an object selector with the xpath property. By @reubenmiller
-* [WebDriverIO][Protractor][Nightmare][Puppeteer] Fixed I.switchTo(0) and I.scrollTo(100, 100) api inconsistencies between helpers.
-* [Protractor] Fixing bug when `seeAttributesOnElements` and `seeCssPropertiesOnElement` were incorrectly passing when the attributes/properties did not match by @reubenmiller
-* [WebDriverIO] Use inbuilt dragAndDrop function (still doesn't work in Firefox). By @reubenmiller
-* Support for Nightmare 3.0
-* Enable glob patterns in `config.test` / `Codecept.loadTests` by @sveneisenschmidt
-* Enable overriding of `config.tests` for `run-multiple` by @sveneisenschmidt
-
-
-## 1.1.6
-
-* Added support for `async I =>` functions syntax in Scenario by @APshenkin
-* [WebDriverIO][Protractor][Puppeteer][Nightmare] `waitForInvisible` waits for element to hide or to be removed from page. By @reubenmiller
-* [Protractor][Puppeteer][Nightmare] Added `grabCurrentUrl` function. By @reubenmiller
-* [WebDriverIO] `grabBrowserUrl` deprecated in favor of `grabCurrentUrl` to unify the API.
-* [Nightmare] Improved element visibility detection by @reubenmiller
-* [Puppeteer] Fixing function calls when clearing the cookies and localstorage. By @reubenmiller
-* [Puppeteer] Added `waitForEnabled`, `waitForValue` and `waitNumberOfVisibleElements` methods by @reubenmiller
-* [WebDriverIO] Fixed `grabNumberOfVisibleElements` to return 0 when no visible elements are on page. By @michaltrunek
-* Helpers API improvements (by @reubenmiller)
- * `_passed` hook runs after a test passed successfully
- * `_failed` hook runs on a failed test
-* Hooks API. New events added by @reubenmiller:
- * `event.all.before` - executed before all tests
- * `event.all.after` - executed after all tests
- * `event.multiple.before` - executed before all processes in run-multiple
- * `event.multiple.after` - executed after all processes in run-multiple
-* Multiple execution
-* Allow `AfterSuite` and `After` test hooks to be defined after the first Scenario. By @reubenmiller
-* [Nightmare] Prevent `I.amOnpage` navigation if the browser is already at the given url
-* Multiple-Run: Added new `bootstrapAll` and `teardownAll` hooks to be executed before and after all processes
-* `codeceptjs def` command accepts `--config` option. By @reubenmiller
-
-## 1.1.5
-
-* [Puppeteer] Rerun steps failed due to "Cannot find context with specified id" Error.
-* Added syntax to retry a single step:
-
-```js
-// retry action once on failure
-I.retry().see('Hello');
-
-// retry action 3 times on failure
-I.retry(3).see('Hello');
-
-// retry action 3 times waiting for 0.1 second before next try
-I.retry({ retries: 3, minTimeout: 100 }).see('Hello');
-
-// retry action 3 times waiting no more than 3 seconds for last retry
-I.retry({ retries: 3, maxTimeout: 3000 }).see('Hello');
-
-// retry 2 times if error with message 'Node not visible' happens
-I.retry({
- retries: 2,
- when: err => err.message === 'Node not visible'
-}).seeElement('#user');
-```
-
-* `Scenario().injectDependencies` added to dynamically add objects into DI container by @Apshenkin. See [Dependency Injection section in PageObjects](https://codecept.io/pageobjects/#dependency-injection).
-* Fixed using async/await functions inside `within`
-* [WebDriverIO][Protractor][Puppeteer][Nightmare] **`waitUntilExists` deprecated** in favor of `waitForElement`
-* [WebDriverIO][Protractor] **`waitForStalenessOf` deprecated** in favor of `waitForDetached`
-* [WebDriverIO][Protractor][Puppeteer][Nightmare] `waitForDetached` added
-* [Nightmare] Added `I.seeNumberOfElements()` by @pmoncadaisla
-* [Nightmare] Load blank page when starting nightmare so that the .evaluate function will work if _failed/saveScreenshot is triggered by @reubenmiller
-* Fixed using plain arrays for data driven tests by @reubenmiller
-* [Puppeteer] Use default tab instead of opening a new tab when starting the browser by @reubenmiller
-* [Puppeteer] Added `grabNumberOfTabs` function by @reubenmiller
-* [Puppeteer] Add ability to set user-agent by @abidhahmed
-* [Puppeteer] Add keepCookies and keepBrowserState @abidhahmed
-* [Puppeteer] Clear value attribute instead of innerhtml for TEXTAREA by @reubenmiller
-* [REST] fixed sending string payload by @michaltrunek
-* Fixed unhandled rejection in async/await tests by @APshenkin
-
-
-## 1.1.4
-
-* Removed `yarn` call in package.json
-* Fixed `console.log` in Puppeteer by @othree
-* [Appium] `runOnAndroid` and `runOnIOS` can receive a function to check capabilities dynamically:
-
-```js
-I.runOnAndroid(caps => caps.platformVersion >= 7, () => {
- // run code only on Android 7+
-});
-```
-
-## 1.1.3
-
-* [Puppeteer] +25 Functions added by @reubenmiller
- * `_locateCheckable`
- * `_locateClickable`
- * `_locateFields`
- * `closeOtherTabs`
- * `dragAndDrop`
- * `grabBrowserLogs`
- * `grabCssPropertyFrom`
- * `grabHTMLFrom`
- * `grabNumberOfVisibleElements`
- * `grabSource`
- * `rightClick`
- * `scrollPageToBottom`
- * `scrollPageToTop`
- * `scrollTo`
- * `seeAttributesOnElements`
- * `seeCssPropertiesOnElements`
- * `seeInField`
- * `seeNumberOfElements`
- * `seeNumberOfVisibleElements`
- * `seeTextEquals`
- * `seeTitleEquals`
- * `switchTo`
- * `waitForInvisible`
- * `waitInUrl`
- * `waitUrlEquals`
-* [Protractor] +8 functions added by @reubenmiller
- * `closeCurrentTab`
- * `grabSource`
- * `openNewTab`
- * `seeNumberOfElements`
- * `seeTextEquals`
- * `seeTitleEquals`
- * `switchToNextTab`
- * `switchToPreviousTab`
-* [Nightmare] `waitForInvisible` added by @reubenmiller
-* [Puppeteer] Printing console.log information in debug mode.
-* [Nightmare] Integrated with `nightmare-har-plugin` by mingfang. Added `enableHAR` option. Added HAR functions:
- * `grabHAR`
- * `saveHAR`
- * `resetHAR`
-* [WebDriverIO] Fixed execution stability for parallel requests with Chromedriver
-* [WebDriverIO] Fixed resizeWindow when resizing to 'maximize' by @reubenmiller
-* [WebDriverIO] Fixing resizing window to full screen when taking a screenshot by @reubenmiller
-
-## 1.1.2
-
-* [Puppeteer] Upgraded to Puppeteer 1.0
-* Added `grep` option to config to set default matching pattern for tests.
-* [Puppeteer] Added `acceptPopup`, `cancelPopup`, `seeInPopup` and `grabPopupText` functions by @reubenmiller
-* [Puppeteer] `within` iframe and nested iframe support added by @reubenmiller
-* [REST] Added support for JSON objects since payload (as a JSON) was automatically converted into "URL query" type of parameter by @Kalostrinho
-* [REST] Added `resetRequestHeaders` method by @Kalostrinho
-* [REST] Added `followRedirect` option and `amFollowingRequestRedirects`/`amNotFollowingRequestRedirects` methods by @Kalostrinho
-* [WebDriverIO] `uncheckOption` implemented by @brunobg
-* [WebDriverIO] Added `grabBrowserUrl` by @Kalostrinho
-* Add ability to require helpers from node_modules by @APshenkin
-* Added `--profile` option to `run-multiple` command by @jamie-beck
-* Custom output name for multiple browser run by @tfiwm
-* Fixed passing data to scenarios by @KennyRules
-
-## 1.1.1
-
-* [WebDriverIO] fixed `waitForInvisible` by @Kporal
-
-## 1.1.0
-
-Major update to CodeceptJS. **NodeJS v 8.9.1** is now minimal Node version required.
-This brings native async-await support to CodeceptJS. It is recommended to start using await for tests instead of generators:
-
-```js
-async () => {
- I.amOnPage('/page');
- const url = await I.grabTextFrom('.nextPage');
- I.amOnPage(url);
-}
-```
-
-Thanks to [@Apshenkin](https://github.com/apshenkin) for implementation. Also, most helpers were refactored to use async-await. This made our code simpler. We hope that this encourages more users to send pull requests!
-
-We also introduced strict ESLint policies for our codebase. Thanks to [@Galkin](https://github.com/galkin) for that.
-
-* **[Puppeteer] Helper introduced**. [Learn how to run tests headlessly with Google Chrome's Puppeteer](http://codecept.io/puppeteer/).
-* [SeleniumWebdriver] Helper is deprecated, it is recommended to use Protractor with config option `angular: false` instead.
-* [WebDriverIO] nested iframe support in the within block by @reubenmiller. Example:
-
-```js
-within({frame: ['#wrapperId', '[name=content]']}, () => {
- I.click('Sign in!');
- I.see('Email Address');
-});
-I.see('Nested Iframe test');
-I.dontSee('Email Address');
-});
-```
-* [WebDriverIO] Support for `~` locator to find elements by `aria-label`. This behavior is similar as it is in Appium and helps testing cross-platform React apps. Example:
-
-```html
-
- CodeceptJS is awesome
-
-```
-↑ This element can be located with `~foobar` in WebDriverIO and Appium helpers. Thanks to @flyskywhy
-
-* Allow providing arbitrary objects in config includes by @rlewan
-* [REST] Prevent from mutating default headers by @alexashley. See #789
-* [REST] Fixed sending empty helpers with `haveRequestHeaders` in `sendPostRequest`. By @petrisorionel
-* Fixed displaying undefined args in output by @APshenkin
-* Fixed NaN instead of seconds in output by @APshenkin
-* Add browser name to report file for `multiple-run` by @trollr
-* Mocha updated to 4.x
-
-
-
-## 1.0.3
-
-* [WebDriverIO][Protractor][Nightmare] method `waitUntilExists` implemented by @sabau
-* Absolute path can be set for `output` dir by @APshenkin. Fix #571* Data table rows can be ignored by using `xadd`. By @APhenkin
-* Added `Data(table).only.Scenario` to give ability to launch only Data tests. By @APhenkin
-* Implemented `ElementNotFound` error by @BorisOsipov.
-* Added TypeScript compiler / configs to check the JavaScript by @KennyRules
-* [Nightmare] fix executeScript return value by @jploskonka
-* [Nightmare] fixed: err.indexOf not a function when waitForText times out in nightmare by @joeypedicini92
-* Fixed: Retries not working when using .only. By @APhenkin
-
-
-## 1.0.2
-
-* Introduced generators support in scenario hooks for `BeforeSuite`/`Before`/`AfterSuite`/`After`
-* [ApiDataFactory] Fixed loading helper; `requireg` package included.
-* Fix #485`run-multiple`: the first browser-resolution combination was be used in all configurations
-* Fixed unique test names:
- * Fixed #447 tests failed silently if they have the same name as other tests.
- * Use uuid in screenshot names when `uniqueScreenshotNames: true`
-* [Protractor] Fixed testing non-angular application. `amOutsideAngularApp` is executed before each step. Fixes #458* Added output for steps in hooks when they fail
-
-## 1.0.1
-
-* Reporters improvements:
- * Allows to execute [multiple reporters](http://codecept.io/advanced/#Multi-Reports)
- * Added [Mochawesome](http://codecept.io/helpers/Mochawesome/) helper
- * `addMochawesomeContext` method to add custom data to mochawesome reports
- * Fixed Mochawesome context for failed screenshots.
-* [WebDriverIO] improved click on context to match clickable element with a text inside. Fixes #647* [Nightmare] Added `refresh` function by @awhanks
-* fixed `Unhandled promise rejection (rejection id: 1): Error: Unknown wait type: pageLoad`
-* support for tests with retries in html report
-* be sure that change window size and timeouts completes before test
-* [Nightmare] Fixed `[Wrapped Error] "codeceptjs is not defined"`; Reinjectiing client scripts to a webpage on changes.
-* [Nightmare] Added more detailed error messages for `Wait*` methods
-* [Nightmare] Fixed adding screenshots to Mochawesome
-* [Nightmare] Fix unique screenshots names in Nightmare
-* Fixed CodeceptJS work with hooks in helpers to finish codeceptJS correctly if errors appears in helpers hooks
-* Create a new session for next test If selenium grid error received
-* Create screenshots for failed hooks from a Feature file
-* Fixed `retries` option
-
-## 1.0
-
-CodeceptJS hits first stable release. CodeceptJS provides a unified API for [web testing for Webdriverio](http://codecept.io/acceptance/), [Protractor](http://codecept.io/angular/), and [NightmareJS](http://codecept.io/nightmare/). Since 1.0 you can also **test mobile applications** in the similar manner with Appium.
-
-Sample test:
-
-```js
-I.seeAppIsInstalled("io.super.app");
-I.click('~startUserRegistrationCD');
-I.fillField('~email of the customer', 'Nothing special'));
-I.see('davert@codecept.io', '~email of the customer'));
-I.clearField('~email of the customer'));
-I.dontSee('Nothing special', '~email of the customer'));
-```
-
-* Read [the Mobile Testing guide](http://codecept.io/mobile).
-* Discover [Appium Helper](http://codecept.io/helpers/Appium/)
-
----
-
-We also introduced two new **helpers for data management**.
-Using them you can easily prepare and cleanup data for your tests using public REST API.
-
-Sample test
-
-```js
-// create a user using data factories and REST API
-I.have('user', { name: 'davert', password: '123456' });
-// use it to login
-I.amOnPage('/login');
-I.fillField('login', 'davert');
-I.fillField('password', '123456');
-I.click('Login');
-I.see('Hello, davert');
-// user will be removed after the test
-```
-
-* Read [Data Management guide](http://codecept.io/data)
-* [REST Helper](http://codecept.io/helpers/REST)
-* [ApiDataFactory](http://codecept.io/helpers/ApiDataFactory/)
-
----
-
-Next notable feature is **[SmartWait](http://codecept.io/acceptance/#smartwait)** for WebDriverIO, Protractor, SeleniumWebdriver. When `smartwait` option is set, script will wait for extra milliseconds to locate an element before failing. This feature uses implicit waits of Selenium but turns them on only in applicable pieces. For instance, implicit waits are enabled for `seeElement` but disabled for `dontSeeElement`
-
-* Read more about [SmartWait](http://codecept.io/acceptance/#smartwait)
-
-##### Changelog
-
-* Minimal NodeJS version is 6.11.1 LTS
-* Use `within` command with generators.
-* [Data Driven Tests](http://codecept.io/advanced/#data-driven-tests) introduced.
-* Print execution time per step in `--debug` mode. #591 by @APshenkin
-* [WebDriverIO][Protractor][Nightmare] Added `disableScreenshots` option to disable screenshots on fail by @Apshenkin
-* [WebDriverIO][Protractor][Nightmare] Added `uniqueScreenshotNames` option to generate unique names for screenshots on failure by @Apshenkin
-* [WebDriverIO][Nightmare] Fixed click on context; `click('text', '#el')` will throw exception if text is not found inside `#el`.
-* [WebDriverIO][Protractor][SeleniumWebdriver] [SmartWait introduced](http://codecept.io/acceptance/#smartwait).
-* [WebDriverIO][Protractor][Nightmare]Fixed `saveScreenshot` for PhantomJS, `fullPageScreenshots` option introduced by @HughZurname #549
-* [Appium] helper introduced by @APshenkin
-* [REST] helper introduced by @atrevino in #504
-* [WebDriverIO][SeleniumWebdriver] Fixed "windowSize": "maximize" for Chrome 59+ version #560 by @APshenkin
-* [Nightmare] Fixed restarting by @APshenkin #581
-* [WebDriverIO] Methods added by @APshenkin:
- * [grabCssPropertyFrom](http://codecept.io/helpers/WebDriverIO/#grabcsspropertyfrom)
- * [seeTitleEquals](http://codecept.io/helpers/WebDriverIO/#seetitleequals)
- * [seeTextEquals](http://codecept.io/helpers/WebDriverIO/#seetextequals)
- * [seeCssPropertiesOnElements](http://codecept.io/helpers/WebDriverIO/#seecsspropertiesonelements)
- * [seeAttributesOnElements](http://codecept.io/helpers/WebDriverIO/#seeattributesonelements)
- * [grabNumberOfVisibleElements](http://codecept.io/helpers/WebDriverIO/#grabnumberofvisibleelements)
- * [waitInUrl](http://codecept.io/helpers/WebDriverIO/#waitinurl)
- * [waitUrlEquals](http://codecept.io/helpers/WebDriverIO/#waiturlequals)
- * [waitForValue](http://codecept.io/helpers/WebDriverIO/#waitforvalue)
- * [waitNumberOfVisibleElements](http://codecept.io/helpers/WebDriverIO/#waitnumberofvisibleelements)
- * [switchToNextTab](http://codecept.io/helpers/WebDriverIO/#switchtonexttab)
- * [switchToPreviousTab](http://codecept.io/helpers/WebDriverIO/#switchtoprevioustab)
- * [closeCurrentTab](http://codecept.io/helpers/WebDriverIO/#closecurrenttab)
- * [openNewTab](http://codecept.io/helpers/WebDriverIO/#opennewtab)
- * [refreshPage](http://codecept.io/helpers/WebDriverIO/#refreshpage)
- * [scrollPageToBottom](http://codecept.io/helpers/WebDriverIO/#scrollpagetobottom)
- * [scrollPageToTop](http://codecept.io/helpers/WebDriverIO/#scrollpagetotop)
- * [grabBrowserLogs](http://codecept.io/helpers/WebDriverIO/#grabbrowserlogs)
-* Use mkdirp to create output directory. #592 by @vkramskikh
-* [WebDriverIO] Fixed `seeNumberOfVisibleElements` by @BorisOsipov #574
-* Lots of fixes for promise chain by @APshenkin #568
- * Fix #543- After block not properly executed if Scenario fails
- * Expected behavior in promise chains: `_beforeSuite` hooks from helpers -> `BeforeSuite` from test -> `_before` hooks from helpers -> `Before` from test - > Test steps -> `_failed` hooks from helpers (if test failed) -> `After` from test -> `_after` hooks from helpers -> `AfterSuite` from test -> `_afterSuite` hook from helpers.
- * if during test we got errors from any hook (in test or in helper) - stop complete this suite and go to another
- * if during test we got error from Selenium server - stop complete this suite and go to another
- * [WebDriverIO][Protractor] if `restart` option is false - close all tabs expect one in `_after`.
- * Complete `_after`, `_afterSuite` hooks even After/AfterSuite from test was failed
- * Don't close browser between suites, when `restart` option is false. We should start browser only one time and close it only after all tests.
- * Close tabs and clear local storage, if `keepCookies` flag is enabled
-* Fix TypeError when using babel-node or ts-node on node.js 7+ #586 by @vkramskikh
-* [Nightmare] fixed usage of `_locate`
-
-Special thanks to **Andrey Pshenkin** for his work on this release and the major improvements.
-
-## 0.6.3
-
-* Errors are printed in non-verbose mode. Shows "Selenium not started" and other important errors.
-* Allowed to set custom test options:
-
-```js
-Scenario('My scenario', { build_id: 123, type: 'slow' }, function (I)
-```
-those options can be accessed as `opts` property inside a `test` object. Can be used in custom listeners.
-
-* Added `docs` directory to a package.
-* [WebDriverIO][Protractor][SeleniumWebdriver] Bugfix: cleaning session when `restart: false` by @tfiwm #519
-* [WebDriverIO][Protractor][Nightmare] Added second parameter to `saveScreenshot` to allow a full page screenshot. By @HughZurname
-* Added suite object to `suite.before` and `suite.after` events by @implico. #496
-
-## 0.6.2
-
-* Added `config` object to [public API](http://codecept.io/hooks/#api)
-* Extended `index.js` to include `actor` and `helpers`, so they could be required:
-
-```js
-const actor = require('codeceptjs').actor;
-```
-
-* Added [example for creating custom runner](http://codecept.io/hooks/#custom-runner) with public API.
-* run command to create `output` directory if it doesn't exist
-* [Protractor] fixed loading globally installed Protractor
-* run-multiple command improvements:
- * create output directories for each process
- * print process ids in output
-
-## 0.6.1
-
-* Fixed loading hooks
-
-## 0.6.0
-
-Major release with extension API and parallel execution.
-
-* **Breaking** Removed path argument from `run`. To specify path other than current directory use `--config` or `-c` option:
-
-Instead of: `codeceptjs run tests` use:
-
-```
-# load config and run from tests directory
-codeceptjs run -c tests/
-
-# or load codecept.json from tests directory
-codeceptjs run -c tests/codecept.json
-
-# run users_test.js inside tests directory
-codeceptjs run users_test.js -c tests
-```
-
-* **Command `multiple-run` added**, to execute tests in several browsers in parallel by @APshenkin and @davertmik. [See documentation](http://codecept.io/advanced/#multiple-execution).
-* **Hooks API added to extend CodeceptJS** with custom listeners and plugins. [See documentation](http://codecept.io/hooks/#hooks_1).
-* [Nightmare][WebDriverIO] `within` can work with iframes by @imvetri. [See documentation](http://codecept.io/acceptance/#iframes).
-* [WebDriverIO][SeleniumWebdriver][Protractor] Default browser changed to `chrome`
-* [Nightmare] Fixed globally locating `nightmare-upload`.
-* [WebDriverIO] added `seeNumberOfVisibleElements` method by @elarouche.
-* Exit with non-zero code if init throws an error by @rincedd
-* New guides published:
- * [Installation](http://codecept.io/installation/)
- * [Hooks](http://codecept.io/hooks/)
- * [Advanced Usage](http://codecept.io/advanced/)
-* Meta packages published:
- * [codecept-webdriverio](https://www.npmjs.com/package/codecept-webdriverio)
- * [codecept-protractor](https://www.npmjs.com/package/codecept-protractor)
- * [codecept-nightmare](https://www.npmjs.com/package/codecept-nightmare)
-
-
-## 0.5.1
-
-* [Polish translation](http://codecept.io/translation/#polish) added by @limes.
-* Update process exit code so that mocha saves reports before exit by @romanovma.
-* [Nightmare] fixed `getAttributeFrom` for custom attributes by @robrkerr
-* [Nightmare] Fixed *UnhandledPromiseRejectionWarning error* when selecting the dropdown using `selectOption` by @robrkerr. [Se PR.
-* [Protractor] fixed `pressKey` method by @romanovma
-
-## 0.5.0
-
-* Protractor ^5.0.0 support (while keeping ^4.0.9 compatibility)
-* Fix 'fullTitle() is not a function' in exit.js by @hubidu. See #388.
-* [Nightmare] Fix for `waitTimeout` by @HughZurname. See #391. Resolves #236* Dockerized CodeceptJS setup by @artiomnist. [See reference](https://github.com/codeceptjs/CodeceptJS/blob/master/docker/README.md)
-
-## 0.4.16
-
-* Fixed steps output synchronization (regression since 0.4.14).
-* [WebDriverIO][Protractor][SeleniumWebdriver][Nightmare] added `keepCookies` option to keep cookies between tests with `restart: false`.
-* [Protractor] added `waitForTimeout` config option to set default waiting time for all wait* functions.
-* Fixed `_test` hook for helpers by @cjhille.
-
-## 0.4.15
-
-* Fixed regression in recorder sessions: `oldpromise is not defined`.
-
-## 0.4.14
-
-* `_beforeStep` and `_afterStep` hooks in helpers are synchronized. Allows to perform additional actions between steps.
-
-Example: fail if JS error occur in custom helper using WebdriverIO:
-
-```js
-_before() {
- this.err = null;
- this.helpers['WebDriverIO'].browser.on('error', (e) => this.err = e);
-}
-
-_afterStep() {
- if (this.err) throw new Error('Browser JS error '+this.err);
-}
-```
-
-Example: fail if JS error occur in custom helper using Nightmare:
-
-```js
-_before() {
- this.err = null;
- this.helpers['Nightmare'].browser.on('page', (type, message, stack) => {
- this.err = `${message} ${stack}`;
- });
-}
-
-_afterStep() {
- if (this.err) throw new Error('Browser JS error '+this.err);
-}
-```
-
-* Fixed `codecept list` and `codecept def` commands.
-* Added `I.say` method to print arbitrary comments.
-
-```js
-I.say('I am going to publish post');
-I.say('I enter title and body');
-I.say('I expect post is visible on site');
-```
-
-* [Nightmare] `restart` option added. `restart: false` allows to run all tests in a single window, disabled by default. By @nairvijays99
-* [Nightmare] Fixed `resizeWindow` command.
-* [Protractor][SeleniumWebdriver] added `windowSize` config option to resize window on start.
-* Fixed "Scenario.skip causes 'Cannot read property retries of undefined'" by @MasterOfPoppets
-* Fixed providing absolute paths for tests in config by @lennym
-
-## 0.4.13
-
-* Added **retries** option `Feature` and `Scenario` to rerun fragile tests:
-
-```js
-Feature('Complex JS Stuff', {retries: 3});
-
-Scenario('Not that complex', {retries: 1}, (I) => {
- // test goes here
-});
-```
-
-* Added **timeout** option `Feature` and `Scenario` to specify timeout.
-
-```js
-Feature('Complex JS Stuff', {timeout: 5000});
-
-Scenario('Not that complex', {timeout: 1000}, (I) => {
- // test goes here
-});
-```
-
-* [WebDriverIO] Added `uniqueScreenshotNames` option to set unique screenshot names for failed tests. By @APshenkin. See #299
-* [WebDriverIO] `clearField` method improved to accept name/label locators and throw errors.
-* [Nightmare][SeleniumWebdriver][Protractor] `clearField` method added.
-* [Nightmare] Fixed `waitForElement`, and `waitForVisible` methods.
-* [Nightmare] Fixed `resizeWindow` by @norisk-it
-* Added italian [translation](http://codecept.io/translation/#italian).
-
-## 0.4.12
-
-* Bootstrap / Teardown improved with [Hooks](http://codecept.io/configuration/#hooks). Various options for setup/teardown provided.
-* Added `--override` or `-o` option for runner to dynamically override configs. Valid JSON should be passed:
-
-```
-codeceptjs run -o '{ "bootstrap": "bootstrap.js"}'
-codeceptjs run -o '{ "helpers": {"WebDriverIO": {"browser": "chrome"}}}'
-```
-
-* Added [regression tests](https://github.com/codeceptjs/CodeceptJS/tree/master/test/runner) for codeceptjs tests runner.
-
-## 0.4.11
-
-* Fixed regression in 0.4.10
-* Added `bootstrap`/`teardown` config options to accept functions as parameters by @pscanf. See updated [config reference](http://codecept.io/configuration/) #319
-
-## 0.4.10
-
-* [Protractor] Protrctor 4.0.12+ support.
-* Enabled async bootstrap file by @abachar. Use inside `bootstrap.js`:
-
-```js
-module.exports = function(done) {
- // async instructions
- // call done() to continue execution
- // otherwise call done('error description')
-}
-```
-
-* Changed 'pending' to 'skipped' in reports by @timja-kainos. See #315
-
-## 0.4.9
-
-* [SeleniumWebdriver][Protractor][WebDriverIO][Nightmare] fixed `executeScript`, `executeAsyncScript` to work and return values.
-* [Protractor][SeleniumWebdriver][WebDriverIO] Added `waitForInvisible` and `waitForStalenessOf` methods by @Nighthawk14.
-* Added `--config` option to `codeceptjs run` to manually specify config file by @cnworks
-* [Protractor] Simplified behavior of `amOutsideAngularApp` by using `ignoreSynchronization`. Fixes #278
-* Set exit code to 1 when test fails at `Before`/`After` hooks. Fixes #279
-
-
-## 0.4.8
-
-* [Protractor][SeleniumWebdriver][Nightmare] added `moveCursorTo` method.
-* [Protractor][SeleniumWebdriver][WebDriverIO] Added `manualStart` option to start browser manually in the beginning of test. By @cnworks. [PR#250
-* Fixed `codeceptjs init` to work with nested directories and file masks.
-* Fixed `codeceptjs gt` to generate test with proper file name suffix. By @Zougi.
-* [Nightmare] Fixed: Error is thrown when clicking on element which can't be locate. By @davetmik
-* [WebDriverIO] Fixed `attachFile` for file upload. By @giuband and @davetmik
-* [WebDriverIO] Add support for timeouts in config and with `defineTimeouts` method. By @easternbloc #258 and #267 by @davetmik
-* Fixed hanging of CodeceptJS when error is thrown by event dispatcher. Fix by @Zougi and @davetmik
-
-
-## 0.4.7
-
-* Improved docs for `BeforeSuite`; fixed its usage with `restart: false` option by @APshenkin.
-* Added `Nightmare` to list of available helpers on `init`.
-* [Nightmare] Removed double `resizeWindow` implementation.
-
-## 0.4.6
-
-* Added `BeforeSuite` and `AfterSuite` hooks to scenario by @APshenkin. See [updated documentation](http://codecept.io/basics/#beforesuite)
-
-## 0.4.5
-
-* Fixed running `codecept def` command by @jankaspar
-* [Protractor][SeleniumWebdriver] Added support for special keys in `pressKey` method. Fixes #216
-
-## 0.4.4
-
-* Interactive shell fixed. Start it by running `codeceptjs shell`
-* Added `--profile` option to `shell` command to use dynamic configuration.
-* Added `--verbose` option to `shell` command for most complete output.
-
-## 0.4.3
-
-* [Protractor] Regression fixed to ^4.0.0 support
-* Translations included into package.
-* `teardown` option added to config (opposite to `bootstrap`), expects a JS file to be executed after tests stop.
-* [Configuration](http://codecept.io/configuration/) can be set via JavaScript file `codecept.conf.js` instead of `codecept.json`. It should export `config` object:
-
-```js
-// inside codecept.conf.js
-exports.config = {
- // contents of codecept.json
-}
-```
-* Added `--profile` option to pass its value to `codecept.conf.js` as `process.profile` for [dynamic configuration](http://codecept.io/configuration#dynamic-configuration).
-* Documentation for [StepObjects, PageFragments](http://codecept.io/pageobjects#PageFragments) updated.
-* Documentation for [Configuration](http://codecept.io/configuration/) added.
-
-## 0.4.2
-
-* Added ability to localize tests with translation #189. Thanks to @abner
- * [Translation] ru-RU translation added.
- * [Translation] pt-BR translation added.
-* [Protractor] Protractor 4.0.4 compatibility.
-* [WebDriverIO][SeleniumWebdriver][Protractor] Fixed single browser session mode for `restart: false`
-* Fixed using of 3rd party reporters (xunit, mocha-junit-reporter, mochawesome). Added guide.
-* Documentation for [Translation](http://codecept.io/translation/) added.
-* Documentation for [Reports](http://codecept.io/reports/) added.
-
-## 0.4.1
-
-* Added custom steps to step definition list. See #174 by @jayS-de
-* [WebDriverIO] Fixed using `waitForTimeout` option by @stephane-ruhlmann. See #178
-
-## 0.4.0
-
-* **[Nightmare](http://codecept.io/nightmare) Helper** added for faster web testing.
-* [Protractor][SeleniumWebdriver][WebDriverIO] added `restart: false` option to reuse one browser between tests (improves speed).
-* **Protractor 4.0** compatibility. Please upgrade Protractor library.
-* Added `--verbose` option for `run` command to log and print global promise and events.
-* Fixed errors with shutting down and cleanup.
-* Fixed starting interactive shell with `codeceptjs shell`.
-* Fixed handling of failures inside within block
-
-## 0.3.5
-
-* Introduced IDE autocompletion support for Visual Studio Code and others. Added command for generating TypeScript definitions for `I` object. Use it as
-
-```
-codeceptjs def
-```
-
-to generate steps definition file and include it into tests by reference. By @kaflan
-
-## 0.3.4
-
-* [Protractor] version 3.3.0 comptaibility, NPM 3 compatibility. Please update Protractor!
-* allows using absolute path for helpers, output, in config and in command line. By @denis-sokolov
-* Fixes 'Cannot read property '1' of null in generate.js:44' by @seethislight
-
-## 0.3.3
-
-**Fixed global installation**. CodeceptJS can now locate globally located modules.
-CodeceptJS is also recommended for local installation.
-Depending on installation type additional modules (webdriverio, protractor, ...) will be loaded either from local or from global path.
-
-## 0.3.2
-
-* Added `codeceptjs list` command which shows all available methods of `I` object.
-* [Protractor][SeleniumWebdriver] fixed closing browser instances
-* [Protractor][SeleniumWebdriver] `doubleClick` method added
-* [WebDriverIO][Protractor][SeleniumWebdriver] `doubleClick` method to locate clickable elements by text, `context` option added.
-* Fixed using assert in generator without yields #89
-
-## 0.3.1
-
-* Fixed `init` command
-
-## 0.3.0
-
-**Breaking Change**: webdriverio package removed from dependencies list. You will need to install it manually after the upgrade.
-Starting from 0.3.0 webdriverio is not the only backend for running selenium tests, so you are free to choose between Protractor, SeleniumWebdriver, and webdriverio and install them.
-
-* **[Protractor] helper added**. Now you can test AngularJS applications by using its official library within the unigied CodeceptJS API!
-* **[SeleniumWebdriver] helper added**. You can switch to official JS bindings for Selenium.
-* [WebDriverIO] **updated to webdriverio v 4.0**
-* [WebDriverIO] `clearField` method added by @fabioel
-* [WebDriverIO] added `dragAndDrop` by @fabioel
-* [WebDriverIO] fixed `scrollTo` method by @sensone
-* [WebDriverIO] fixed `windowSize: maximize` option in config
-* [WebDriverIO] `seeElement` and `dontSeeElement` check element for visibility by @fabioel and @davertmik
-* [WebDriverIO] `seeElementInDOM`, `dontSeeElementInDOM` added to check element exists on page.
-* [WebDriverIO] fixed saving screenshots on failure. Fixes #70
-* fixed `within` block doesn't end in output not #79
-
-
-## 0.2.8
-
-* [WebDriverIO] added `seeNumberOfElements` by @fabioel
-
-## 0.2.7
-
-* process ends with exit code 1 on error or failure #49
-* fixed registereing global Helper #57
-* fixed handling error in within block #50
-
-## 0.2.6
-
-* Fixed `done() was called multiple times`
-* [WebDriverIO] added `waitToHide` method by @fabioel
-* Added global `Helper` (alias `codecept_helper)`, object use for writing custom Helpers. Generator updated. Changes to #48
-
-## 0.2.5
-
-* Fixed issues with using yield inside a test #45 #47 #43
-* Fixed generating a custom helper. Helper class is now accessible with `codecept_helper` var. Fixes #48
-
-## 0.2.4
-
-* Fixed accessing helpers from custom helper by @pim.
-
-## 0.2.3
-
-* [WebDriverIO] fixed `seeInField` to work with single value elements like: input[type=text], textareas, and multiple: select, input[type=radio], input[type=checkbox]
-* [WebDriverIO] fixed `pressKey`, key modifeiers (Control, Command, Alt, Shift) are released after the action
-
-## 0.2.2
-
-Fixed generation of custom steps file and page objects.
-Please replace `require('codeceptjs/actor')` to `actor` in your `custom_steps.js`.
-Whenever you need to create `I` object (in page objects, custom steps, but not in tests) just call `actor()`;
-
-## 0.2.0
-
-* **within** context hook added
-* `--reporter` option supported
-* [WebDriverIO] added features and methods:
- - elements: `seeElement`, ...
- - popups: `acceptPopup`, `cancelPopup`, `seeInPopup`,...
- - navigation: `moveCursorTo`, `scrollTo`
- - saving screenshots on failure; `saveScreenshot`
- - cookies: `setCookie`, `seeCookie`, ...
- - source: `seeInSource`
- - form: `seeCheckboxIsChecked`, `selectOption` to support multiple selects
- - keyboard: `appendField`, `pressKey`
- - mouse: `rightClick`
-* tests added
-* [WebDriverIO] proxy configuration added by @petehouston
-* [WebDriverIO] fixed `waitForText` method by @roadhump. Fixes #11
-* Fixed creating output dir when it already exists on init by @alfirin
-* Fixed loading of custom helpers
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 000000000..909502386
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,43 @@
+# CodeceptJS ESM Migration Plan
+
+This project is migrating from 3.x to ESM replacing all require() calls with imports.
+
+## Compare with Reference
+
+Each time unsure what to do refer to the same file implementation in **3.x branch**
+3.x branch contains stable version of all core classes that work
+
+## Running Tests
+
+Focus on acceptance tests:
+
+For instance this helps to understand if final migration is ok:
+
+```
+DEBUG="codeceptjs:*" ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --verbose
+
+DEBUG="codeceptjs:*" ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --debug --grep within
+```
+
+Do not say: it works befire running specific acceptance test.
+Tests may stuck so always run them with timeout call:
+
+```
+timeout=30000 ./bin/codecept.js run --config test/acceptance/codecept.Playwright.js --verbose
+```
+
+Web Server for this tests are running on port 8000 and it works but responds 500 for HEAD requests.
+
+## Princinples
+
+All unit tests for Playwright/Puppeteer/WebdriverIO are passing. But acceptance tests are failing due to promises composition. Complexity of promises composition comes from promise chaining and async/await syntax. And `session` mechanism from `promise.js` which allows spawning different promises chains and sync them up in the end.
+
+The full test suite extensively uses plugins so refer to plugins and corresponding helpers as well
+
+We are building test framework. So even passing ests are not indicator of successful usage. Side effects like: timeouts, bad output, errors, memory leaks, etc are affecting performance.
+For instance, if a tests stuck and won't finish this is very bad.
+
+## Coding Style
+
+- Never add comments unless explicitly required.
+- DO not mention plugins or helpers inside core classes
diff --git a/Dockerfile b/Dockerfile
index 05dee4522..a97f90203 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,66 +1,50 @@
-ARG NODE_VERSION=12.10.0
-FROM node:${NODE_VERSION}
+# Download Playwright and its dependencies
+FROM mcr.microsoft.com/playwright:v1.55.0-noble
-# Add our user and group first to make sure their IDs get assigned consistently,
-# regardless of whatever dependencies get added.
-RUN groupadd --system nightmare && useradd --system --create-home --gid nightmare nightmare
+# Set non-interactive mode for apt operations
+ENV DEBIAN_FRONTEND=noninteractive
-# Installing the pre-required packages and libraries for electron & Nightmare
-RUN apt-get update && \
- apt-get install -y libgtk2.0-0 libgconf-2-4 \
- libasound2 libxtst6 libxss1 libnss3 xvfb
+# Update and install required dependencies in a single step to reduce layers
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ libgtk2.0-0 libxtst6 libxss1 libnss3 xvfb \
+ && rm -rf /var/lib/apt/lists/*
-# Install latest chrome dev package.
-# Note: this installs the necessary libs to make the bundled version of Chromium that Puppeteer
-# installs, work.
-RUN apt-get update && apt-get install -y wget --no-install-recommends \
- && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
- && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
- && apt-get update \
- && apt-get install -y google-chrome-unstable \
- --no-install-recommends \
- && apt-get install -y libgbm1 \
- && rm -rf /var/lib/apt/lists/* \
- && apt-get purge --auto-remove -y curl \
- && rm -rf /src/*.deb
-
-# Uncomment to skip the chromium download when installing puppeteer. If you do,
-# you'll need to launch puppeteer with:
-# browser.launch({executablePath: 'google-chrome-unstable'})
-# ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
-
-
-# Add pptr user.
+# Ensure the pptruser exists, otherwise add it for better security
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
&& mkdir -p /home/pptruser/Downloads \
- && chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /home/pptruser
-
-#RUN mkdir /home/codecept
-
+# Copy project files to Docker image
COPY . /codecept
+# Set the working directory and install npm dependencies
+WORKDIR /codecept
+RUN npm install --loglevel=warn
+
+# Set ownership for files to pptruser
RUN chown -R pptruser:pptruser /codecept
-RUN runuser -l pptruser -c 'npm install --loglevel=warn --prefix /codecept'
+# Create symbolic link for CodeceptJS binary
RUN ln -s /codecept/bin/codecept.js /usr/local/bin/codeceptjs
-RUN mkdir /tests
+
+# Create a directory for tests and set as the working directory
+RUN mkdir -p /tests
WORKDIR /tests
-# Allow to pass argument to codecept run via env variable
+# Set required environment variables
+ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
+ENV PUPPETEER_SKIP_DOWNLOAD=true
ENV CODECEPT_ARGS=""
ENV RUN_MULTIPLE=false
ENV NO_OF_WORKERS=""
-# Set HOST ENV variable for Selenium Server
+# Set Selenium and Docker configurations
ENV HOST=selenium
+ENV CODECEPT_DOCKER=1
-# Run user as non privileged.
-# USER pptruser
+# Uncomment the following line to use a non-root user for better security
+USER pptruser
-# Set the entrypoint for Nightmare
+# Set the entrypoint script and default CMD
ENTRYPOINT ["/codecept/docker/entrypoint"]
-
-# Run tests
-CMD ["bash", "/codecept/docker/run.sh"]
+CMD ["bash", "/codecept/docker/run.sh"]
\ No newline at end of file
diff --git a/README.md b/README.md
index e858a93b5..f92fd287c 100644
--- a/README.md
+++ b/README.md
@@ -1,39 +1,49 @@
-[](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url] [](https://travis-ci.org/Codeception/CodeceptJS) [](https://www.codacy.com/app/DavertMik/CodeceptJS?utm_source=github.com&utm_medium=referral&utm_content=Codeception/CodeceptJS&utm_campaign=badger) [](https://houndci.com)
+[](https://stand-with-ukraine.pp.ua)
-# CodeceptJS
+[](https://join.slack.com/t/codeceptjs/shared_invite/enQtMzA5OTM4NDM2MzA4LWE4MThhN2NmYTgxNTU5MTc4YzAyYWMwY2JkMmZlYWI5MWQ2MDM5MmRmYzZmYmNiNmY5NTAzM2EwMGIwOTNhOGQ) [](https://codecept.discourse.group) [![NPM version][npm-image]][npm-url] [](https://hub.docker.com/r/codeceptjs/codeceptjs)
+[](https://github.com/codeceptjs/CodeceptJS/edit/3.x/docs/ai.md) [](https://github.com/codeceptjs/CodeceptJS/blob/main/docs/mcp.md) [](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)
-Reference: [Helpers API](https://github.com/codeceptjs/CodeceptJS/blob/master/docs) | [Demo](https://github.com/codeceptjs/codeceptjs-demo)
+## Build Status
+
+| Type | Engine | Status |
+| --------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| 🌐 Web | Playwright | [](https://github.com/codeceptjs/CodeceptJS/actions/workflows/playwright.yml) |
+| 🌐 Web | Puppeteer | [](https://github.com/codeceptjs/CodeceptJS/actions/workflows/puppeteer.yml) |
+| 🌐 Web | WebDriver | [](https://github.com/codeceptjs/CodeceptJS/actions/workflows/webdriver.yml) |
+| 📱 Mobile | Appium | [](https://github.com/codeceptjs/CodeceptJS/actions/workflows/appium_Android.yml) |
+
+# CodeceptJS [](https://stand-with-ukraine.pp.ua)
+
+Reference: [Helpers API](https://github.com/codeceptjs/CodeceptJS/tree/master/docs/helpers)
## Supercharged E2E Testing
CodeceptJS is a new testing framework for end-to-end testing with WebDriver (or others).
-It abstracts browser interaction to simple steps that are written from a user perspective.
+It abstracts browser interaction to simple steps that are written from a user's perspective.
A simple test that verifies the "Welcome" text is present on a main page of a site will look like:
```js
-Feature('CodeceptJS demo');
+Feature('CodeceptJS demo')
-Scenario('check Welcome page on site', (I) => {
- I.amOnPage('/');
- I.see('Welcome');
-});
+Scenario('check Welcome page on site', ({ I }) => {
+ I.amOnPage('/')
+ I.see('Welcome')
+})
```
CodeceptJS tests are:
-* **Synchronous**. You don't need to care about callbacks or promises or test scenarios which are linear. But, your tests should be linear.
-* Written from **user's perspective**. Every action is a method of `I`. That makes test easy to read, write and maintain even for non-tech persons.
-* Backend **API agnostic**. We don't know which WebDriver implementation is running this test. We can easily switch from WebDriverIO to Protractor or PhantomJS.
+- **Synchronous**. You don't need to care about callbacks or promises or test scenarios which are linear. But, your tests should be linear.
+- Written from **user's perspective**. Every action is a method of `I`. That makes test easy to read, write and maintain even for non-tech persons.
+- Backend **API agnostic**. We don't know which WebDriver implementation is running this test.
-CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently CodeceptJS has these helpers:
+CodeceptJS uses **Helper** modules to provide actions to `I` object. Currently, CodeceptJS has these helpers:
-* [**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing.
-* [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver protocol.
-* [**Protractor**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Protractor.md) - helper empowered by [Protractor](http://protractortest.org/) to run tests via WebDriver protocol.
-* [**TestCafe**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/TestCafe.md) - cheap and fast cross-browser test automation.
-* [**Nightmare**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Nightmare.md) - uses Electron and NightmareJS to run tests.
-* [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
-* [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
+- [**Playwright**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Playwright.md) - is a Node library to automate the Chromium, WebKit and Firefox browsers with a single API.
+- [**Puppeteer**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Puppeteer.md) - uses Google Chrome's Puppeteer for fast headless testing.
+- [**WebDriver**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) - uses [webdriverio](http://webdriver.io/) to run tests via WebDriver or Devtools protocol.
+- [**Appium**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Appium.md) - for **mobile testing** with Appium
+- [**Detox**](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/Detox.md) - This is a wrapper on top of Detox library, aimed to unify testing experience for CodeceptJS framework. Detox provides a grey box testing for mobile applications, playing especially well for React Native apps.
And more to come...
@@ -41,31 +51,34 @@ And more to come...
CodeceptJS is a successor of [Codeception](http://codeception.com), a popular full-stack testing framework for PHP.
With CodeceptJS your scenario-driven functional and acceptance tests will be as simple and clean as they can be.
-You don't need to worry about asynchronous nature of NodeJS or about various APIs of Selenium, Puppeteer, Protractor, TestCafe, etc. as CodeceptJS unifies them and makes them work as they are synchronous.
+You don't need to worry about asynchronous nature of NodeJS or about various APIs of Playwright, Selenium, Puppeteer, etc. as CodeceptJS unifies them and makes them work as they are synchronous.
## Features
-* Based on [Mocha](https://mochajs.org/) testing framework.
-* Designed for scenario driven acceptance testing in BDD-style
-* Uses ES6 natively without transpiler.
-* Also plays nice with TypeScript.
-* Smart locators: use names, labels, matching text, CSS or XPath to locate elements.
-* Interactive debugging shell: pause test at any point and try different commands in a browser.
-* Easily create tests, pageobjects, stepobjects with CLI generators.
+- 🪄 **AI-powered** with GPT features to assist and heal failing tests.
+- ☕ Based on [Mocha](https://mochajs.org/) testing framework.
+- 💼 Designed for scenario driven acceptance testing in BDD-style.
+- 💻 Uses ES6 natively without transpiler.
+- Also plays nice with TypeScript.
+- > Smart locators: use names, labels, matching text, CSS or XPath to locate elements.
+- 🌐 Interactive debugging shell: pause test at any point and try different commands in a browser.
+- ⚡ **Parallel testing** with dynamic test pooling for optimal load balancing and performance.
+- 📊 **Built-in HTML Reporter** with interactive dashboard, step-by-step execution details, and comprehensive test analytics.
+- Easily create tests, pageobjects, stepobjects with CLI generators.
-## Install
+## Installation
```sh
-npm install codeceptjs --save
+npm i codeceptjs --save
```
-Move to directory where you'd like to have your tests (and codeceptjs config) stored, and run
+Move to directory where you'd like to have your tests (and CodeceptJS config) stored, and execute:
```sh
npx codeceptjs init
```
-to create and configure test environment. It is recommended to select WebDriverIO from the list of helpers, if you need to write Selenium WebDriver tests.
+to create and configure test environment. It is recommended to select WebDriver from the list of helpers, if you need to write Selenium WebDriver tests.
After that create your first test by executing:
@@ -87,33 +100,35 @@ npx codeceptjs def .
Later you can even automagically update Type Definitions to include your own custom [helpers methods](docs/helpers.md).
-Note that CodeceptJS requires Node.js version `8.9.1+` or later.
+Note:
+
+- CodeceptJS requires Node.js version `12+` or later.
## Usage
-Learn CodeceptJS by examples. Let's assume we have CodeceptJS installed and WebDriverIO helper enabled.
+Learn CodeceptJS by examples. Let's assume we have CodeceptJS installed and WebDriver helper enabled.
### Basics
Let's see how we can handle basic form testing:
```js
-Feature('CodeceptJS Demonstration');
-
-Scenario('test some forms', (I) => {
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
- I.fillField('Email', 'hello@world.com');
- I.fillField('Password', '123456');
- I.checkOption('Active');
- I.checkOption('Male');
- I.click('Create User');
- I.see('User is valid');
- I.dontSeeInCurrentUrl('/documentation');
-});
+Feature('CodeceptJS Demonstration')
+
+Scenario('test some forms', ({ I }) => {
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
+ I.fillField('Email', 'hello@world.com')
+ I.fillField('Password', secret('123456'))
+ I.checkOption('Active')
+ I.checkOption('Male')
+ I.click('Create User')
+ I.see('User is valid')
+ I.dontSeeInCurrentUrl('/documentation')
+})
```
-All actions are performed by I object; assertions functions start with `see` function.
-In this examples all methods of `I` are taken from WebDriver helper, see [reference](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) to learn how to use them.
+All actions are performed by `I` object; assertions functions start with `see` function.
+In these examples all methods of `I` are taken from WebDriver helper, see [reference](https://github.com/codeceptjs/CodeceptJS/blob/master/docs/helpers/WebDriver.md) to learn how to use them.
Let's execute this test with `run` command. Additional option `--steps` will show us the running process. We recommend use `--steps` or `--debug` during development.
@@ -128,7 +143,7 @@ CodeceptJS Demonstration --
test some forms
• I am on page "http://simple-form-bootstrap.plataformatec.com.br/documentation"
• I fill field "Email", "hello@world.com"
- • I fill field "Password", "123456"
+ • I fill field "Password", "****"
• I check option "Active"
• I check option "Male"
• I click "Create User"
@@ -137,7 +152,7 @@ CodeceptJS Demonstration --
✓ OK in 17752ms
```
-CodeceptJS has an ultimate feature to help you develop and debug you test.
+CodeceptJS has an ultimate feature to help you develop and debug your test.
You can **pause execution of test in any place and use interactive shell** to try different actions and locators.
Just add `pause()` call at any place in a test and run it.
@@ -150,15 +165,15 @@ npx codeceptjs shell
### Actions
We filled form with `fillField` methods, which located form elements by their label.
-The same way you can locate element by name, CSS or XPath locators in tests:
+The same way you can locate element by name, `CSS` or `XPath` locators in tests:
```js
// by name
-I.fillField('user_basic[email]', 'hello@world.com');
+I.fillField('user_basic[email]', 'hello@world.com')
// by CSS
-I.fillField('#user_basic_email', 'hello@world.com');
+I.fillField('#user_basic_email', 'hello@world.com')
// don't make us guess locator type, specify it
-I.fillField({css: '#user_basic_email'}, 'hello@world.com');
+I.fillField({ css: '#user_basic_email' }, 'hello@world.com')
```
Other methods like `checkOption`, and `click` work in a similar manner. They can take labels or CSS or XPath locators to find elements to interact.
@@ -169,9 +184,9 @@ Assertions start with `see` or `dontSee` prefix. In our case we are asserting th
However, we can narrow the search to particular element by providing a second parameter:
```js
-I.see('User is valid');
+I.see('User is valid')
// better to specify context:
-I.see('User is valid', '.alert-success');
+I.see('User is valid', '.alert-success')
```
In this case 'User is valid' string will be searched only inside elements located by CSS `.alert-success`.
@@ -179,18 +194,16 @@ In this case 'User is valid' string will be searched only inside elements locate
### Grabbers
In case you need to return a value from a webpage and use it directly in test, you should use methods with `grab` prefix.
-They are expected to be used inside async/await functions, and their results will be available in test:
+They are expected to be used inside `async/await` functions, and their results will be available in test:
```js
-const assert = require('assert');
-
-Feature('CodeceptJS Demonstration');
+Feature('CodeceptJS Demonstration')
-Scenario('test page title', async (I) => {
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
- const title = await I.grabTitle();
- assert.equal(title, 'Example application with SimpleForm and Twitter Bootstrap');
-});
+Scenario('test page title', async ({ I }) => {
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
+ const title = await I.grabTitle()
+ I.expectEqual(title, 'Example application with SimpleForm and Twitter Bootstrap') // Avaiable with Expect helper. -> https://codecept.io/helpers/Expect/
+})
```
The same way you can grab text, attributes, or form values and use them in next test steps.
@@ -200,21 +213,78 @@ The same way you can grab text, attributes, or form values and use them in next
Common preparation steps like opening a web page, logging in a user, can be placed in `Before` or `Background`:
```js
-Feature('CodeceptJS Demonstration');
+const { I } = inject()
+
+Feature('CodeceptJS Demonstration')
+
+Before(() => {
+ // or Background
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
+})
+
+Scenario('test some forms', () => {
+ I.click('Create User')
+ I.see('User is valid')
+ I.dontSeeInCurrentUrl('/documentation')
+})
+
+Scenario('test title', () => {
+ I.seeInTitle('Example application')
+})
+```
-Before((I) => { // or Background
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
-});
+## HTML Reports
-Scenario('test some forms', (I) => {
- I.click('Create User');
- I.see('User is valid');
- I.dontSeeInCurrentUrl('/documentation');
-});
+Generate beautiful HTML reports using **[@testomatio/reporter](https://github.com/testomatio/reporter)** package.
-Scenario('test title', (I) => {
- I.seeInTitle('Example application');
-});
+### Installation
+
+```sh
+npm install @testomatio/reporter --save-dev
+```
+
+### Configuration
+
+Add the `testomatio` plugin to your `codecept.conf.js`:
+
+```js
+plugins: {
+ testomatio: {
+ enabled: true,
+ require: '@testomatio/reporter/codecept',
+ html: true,
+ reportDir: 'output/report',
+ },
+}
+```
+
+### Usage
+
+Run tests normally:
+
+```sh
+npx codeceptjs run
+```
+
+The report will be saved to `output/report/testomatio-report.html` by default. You can also keep using `TESTOMATIO_HTML_REPORT_SAVE=1` and related environment variables if you prefer env-based setup.
+
+### Features
+
+- Modern, responsive interface with real-time statistics
+- Detailed test information with step-by-step breakdown
+- Screenshots, videos, and artifacts display
+- BDD/Gherkin support with proper scenario formatting
+- Customizable output location and filename
+- Optional integration with [Testomat.io](https://testomat.io) cloud
+
+### Customization
+
+```sh
+# Custom output folder in codecept.conf.js
+# reportDir: './reports'
+
+# Integrate with Testomat.io cloud
+TESTOMATIO=your_api_key npx codeceptjs run
```
## PageObjects
@@ -223,92 +293,62 @@ CodeceptJS provides the most simple way to create and use page objects in your t
You can create one by running
```sh
-codeceptjs generate pageobject
+npx codeceptjs generate pageobject
```
-It will create a page object file for you and add it to config.
+It will create a page object file for you and add it to the config.
Let's assume we created one named `docsPage`:
```js
-const { I } = inject();
+const { I } = inject()
module.exports = {
fields: {
email: '#user_basic_email',
- password: '#user_basic_password'
+ password: '#user_basic_password',
},
- submitButton: {css: '#new_user_basic input[type=submit]'},
+ submitButton: { css: '#new_user_basic input[type=submit]' },
sendForm(email, password) {
- I.fillField(this.fields.email, email);
- I.fillField(this.fields.password, password);
- I.click(this.submitButton);
- }
+ I.fillField(this.fields.email, email)
+ I.fillField(this.fields.password, password)
+ I.click(this.submitButton)
+ },
}
```
You can easily inject it to test by providing its name in test arguments:
```js
-Feature('CodeceptJS Demonstration');
-
-Before((I) => { // or Background
- I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation');
-});
-
-Scenario('test some forms', (I, docsPage) => {
- docsPage.sendForm('hello@world.com','123456');
- I.see('User is valid');
- I.dontSeeInCurrentUrl('/documentation');
-});
+Feature('CodeceptJS Demonstration')
+
+Before(({ I }) => {
+ // or Background
+ I.amOnPage('http://simple-form-bootstrap.plataformatec.com.br/documentation')
+})
+
+Scenario('test some forms', ({ I, docsPage }) => {
+ docsPage.sendForm('hello@world.com', '123456')
+ I.see('User is valid')
+ I.dontSeeInCurrentUrl('/documentation')
+})
```
-When using typescript, replace `module.exports` with `export` for autocompletion.
-
+When using Typescript, replace `module.exports` with `export` for autocompletion.
## Contributing
- - ### [Contributing Guide](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CONTRIBUTING.md)
- - ### [Code of conduct](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CODE_OF_CONDUCT.md)
-
+- ### [Contributing Guide](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CONTRIBUTING.md)
+- ### [Code of conduct](https://github.com/codeceptjs/CodeceptJS/blob/master/.github/CODE_OF_CONDUCT.md)
## Contributors
-Thanks all to those who are and will have contributing to this awesome project!
-
-[//]: contributor-faces
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-[//]: contributor-faces
+Thanks to our awesome contributors! 🎉
+
+
+
+
+Made with [contrib.rocks](https://contrib.rocks).
## License
diff --git a/bin/codecept.js b/bin/codecept.js
index b10873546..e270e2920 100755
--- a/bin/codecept.js
+++ b/bin/codecept.js
@@ -1,137 +1,183 @@
#!/usr/bin/env node
-const program = require('commander');
-const Codecept = require('../lib/codecept');
-const { print, error } = require('../lib/output');
-
-if (process.versions.node && process.versions.node.split('.') && process.versions.node.split('.')[0] < 8) {
- error('NodeJS >= 8 is required to run.');
- print();
- print('Please upgrade your NodeJS engine');
- print(`Current NodeJS version: ${process.version}`);
- process.exit(1);
+import { Command } from 'commander'
+const program = new Command()
+import Codecept from '../lib/codecept.js'
+import output from '../lib/output.js'
+const { print, error } = output
+import { printError } from '../lib/command/utils.js'
+import { resolveImportModulePath } from '../lib/utils.js'
+
+const commandFlags = {
+ ai: {
+ flag: '--ai',
+ description: 'enable AI assistant',
+ },
+ verbose: {
+ flag: '--verbose',
+ description: 'output internal logging information',
+ },
+ debug: {
+ flag: '--debug',
+ description: 'output additional information',
+ },
+ config: {
+ flag: '-c, --config [file]',
+ description: 'configuration file to be used',
+ },
+ profile: {
+ flag: '--profile [value]',
+ description: 'configuration profile to be used',
+ },
+ steps: {
+ flag: '--steps',
+ description: 'show step-by-step execution',
+ },
}
-program.usage(' [options]');
-program.version(Codecept.version());
+const errorHandler =
+ fn =>
+ async (...args) => {
+ try {
+ await fn(...args)
+ } catch (e) {
+ printError(e)
+ process.exitCode = 1
+ }
+ }
+
+const dynamicImport = async modulePath => {
+ const resolvedPath = resolveImportModulePath(modulePath)
+ const module = await import(resolvedPath)
+ return module.default || module
+}
+
+const commandHandler = modulePath =>
+ errorHandler(async (...args) => {
+ const handler = await dynamicImport(modulePath)
+ return handler(...args)
+ })
+
+const commandHandlerWithProperty = (modulePath, property) =>
+ errorHandler(async (...args) => {
+ const module = await dynamicImport(modulePath)
+ return module[property](...args)
+ })
-program.command('init [path]')
+if (process.versions.node && process.versions.node.split('.') && process.versions.node.split('.')[0] < 12) {
+ error('NodeJS >= 12 is required to run.')
+ print()
+ print('Please upgrade your NodeJS engine')
+ print(`Current NodeJS version: ${process.version}`)
+ process.exit(1)
+}
+
+program.usage(' [options]')
+program.version(Codecept.version())
+
+program
+ .command('init [path]')
.description('Creates dummy config in current dir or [path]')
- .action(require('../lib/command/init'));
+ .option('-y, --yes', 'skip prompts and use defaults (Playwright + chromium, BASE_URL env for url)')
+ .action(commandHandler('../lib/command/init.js'))
+
+program
+ .command('check')
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .description('Checks configuration and environment before running tests')
+ .option('-t, --timeout [ms]', 'timeout for checks in ms, 50000 by default')
+ .action(commandHandler('../lib/command/check.js'))
-program.command('migrate [path]')
- .description('Migrate json config to js config in current dir or [path]')
- .action(require('../lib/command/configMigrate'));
+program.command('migrate [path]').description('Migrate json config to js config in current dir or [path]').action(commandHandler('../lib/command/configMigrate.js'))
-program.command('shell [path]')
+program
+ .command('shell [path]')
.alias('sh')
.description('Interactive shell')
- .option('--verbose', 'output internal logging information')
- .option('--profile [value]', 'configuration profile to be used')
- .action(require('../lib/command/interactive'));
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
+ .option(commandFlags.profile.flag, commandFlags.profile.description)
+ .option(commandFlags.ai.flag, commandFlags.ai.description)
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .action(commandHandler('../lib/command/interactive.js'))
-program.command('list [path]')
+program
+ .command('list [path]')
.alias('l')
.description('List all actions for I.')
- .action(require('../lib/command/list'));
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .option('--docs', 'show documentation for each action')
+ .option('--action ', 'show docs for a single action (e.g. amOnPage or I.amOnPage)')
+ .action(commandHandler('../lib/command/list.js'))
-program.command('def [path]')
+program
+ .command('def [path]')
.description('Generates TypeScript definitions for all I actions.')
- .option('-c, --config [file]', 'configuration file to be used')
+ .option(commandFlags.config.flag, commandFlags.config.description)
.option('-o, --output [folder]', 'target folder to paste definitions')
- .action(require('../lib/command/definitions'));
+ .action(commandHandler('../lib/command/definitions.js'))
-program.command('gherkin:init [path]')
+program
+ .command('gherkin:init [path]')
.alias('bdd:init')
.description('Prepare CodeceptJS to run feature files.')
- .option('-c, --config [file]', 'configuration file to be used')
- .action(require('../lib/command/gherkin/init'));
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .action(commandHandler('../lib/command/gherkin/init.js'))
-program.command('gherkin:steps [path]')
+program
+ .command('gherkin:steps [path]')
.alias('bdd:steps')
.description('Prints all defined gherkin steps.')
- .option('-c, --config [file]', 'configuration file to be used')
- .action(require('../lib/command/gherkin/steps'));
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .action(commandHandler('../lib/command/gherkin/steps.js'))
-program.command('gherkin:snippets [path]')
+program
+ .command('gherkin:snippets [path]')
.alias('bdd:snippets')
.description('Generate step definitions from steps.')
.option('--dry-run', "don't save snippets to file")
- .option('-c, --config [file]', 'configuration file to be used')
+ .option(commandFlags.config.flag, commandFlags.config.description)
.option('--feature [file]', 'feature files(s) to scan')
.option('--path [file]', 'file in which to place the new snippets')
- .action(require('../lib/command/gherkin/snippets'));
+ .action(commandHandler('../lib/command/gherkin/snippets.js'))
-program.command('generate:test [path]')
- .alias('gt')
- .description('Generates an empty test')
- .action(require('../lib/command/generate').test);
+program.command('generate:test [path]').alias('gt').description('Generates an empty test').action(commandHandlerWithProperty('../lib/command/generate.js', 'test'))
-program.command('generate:pageobject [path]')
- .alias('gpo')
- .description('Generates an empty page object')
- .action(require('../lib/command/generate').pageObject);
+program.command('generate:pageobject [path]').alias('gpo').description('Generates an empty page object').action(commandHandlerWithProperty('../lib/command/generate.js', 'pageObject'))
-program.command('generate:object [path]')
+program
+ .command('generate:object [path]')
.alias('go')
.option('--type, -t [kind]', 'type of object to be created')
.description('Generates an empty support object (page/step/fragment)')
- .action(require('../lib/command/generate').pageObject);
+ .action(commandHandlerWithProperty('../lib/command/generate.js', 'pageObject'))
-program.command('generate:helper [path]')
- .alias('gh')
- .description('Generates a new helper')
- .action(require('../lib/command/generate').helper);
+program.command('generate:helper [path]').alias('gh').description('Generates a new helper').action(commandHandlerWithProperty('../lib/command/generate.js', 'helper'))
-program.command('run [test]')
- .description('Executes tests')
-
- // codecept-only options
- .option('--steps', 'show step-by-step execution')
- .option('--debug', 'output additional information')
- .option('--verbose', 'output internal logging information')
- .option('-o, --override [value]', 'override current config options')
- .option('--profile [value]', 'configuration profile to be used')
- .option('-c, --config [file]', 'configuration file to be used')
- .option('--features', 'run only *.feature files and skip tests')
- .option('--tests', 'run only JS test files and skip features')
- .option('-p, --plugins ', 'enable plugins, comma-separated')
-
- // mocha options
- .option('--colors', 'force enabling of colors')
- .option('--no-colors', 'force disabling of colors')
- .option('-G, --growl', 'enable growl notification support')
- .option('-O, --reporter-options ', 'reporter-specific options')
- .option('-R, --reporter ', 'specify the reporter to use')
- .option('-S, --sort', 'sort test files')
- .option('-b, --bail', 'bail after first test failure')
- .option('-d, --debug', "enable node's debugger, synonym for node --debug")
- .option('-g, --grep ', 'only run tests matching ')
- .option('-f, --fgrep ', 'only run tests containing ')
- .option('-i, --invert', 'inverts --grep and --fgrep matches')
- .option('--full-trace', 'display the full stack trace')
- .option('--compilers :,...', 'use the given module(s) to compile files')
- .option('--debug-brk', "enable node's debugger breaking on the first line")
- .option('--inline-diffs', 'display actual/expected differences inline within each string')
- .option('--no-exit', 'require a clean shutdown of the event loop: mocha will not call process.exit')
- .option('--recursive', 'include sub directories')
- .option('--trace', 'trace function calls')
- .option('--child ', 'option for child processes')
+program.command('generate:heal [path]').alias('gr').description('Generates basic heal recipes').action(commandHandlerWithProperty('../lib/command/generate.js', 'heal'))
- .action(require('../lib/command/run'));
+program
+ .command('generate:prompt [path]')
+ .alias('gp')
+ .description('Generates AI prompt template (writeStep, healStep, generatePageObject)')
+ .action(commandHandlerWithProperty('../lib/command/generate.js', 'prompt'))
-program.command('run-rerun [test]')
- .description('Executes tests in more than one test suite run')
+program
+ .command('run [test]')
+ .description('Executes tests')
// codecept-only options
- .option('--steps', 'show step-by-step execution')
- .option('--debug', 'output additional information')
- .option('--verbose', 'output internal logging information')
+ .option(commandFlags.ai.flag, commandFlags.ai.description)
+ .option(commandFlags.steps.flag, commandFlags.steps.description)
+ .option(commandFlags.debug.flag, commandFlags.debug.description)
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
.option('-o, --override [value]', 'override current config options')
- .option('--profile [value]', 'configuration profile to be used')
- .option('-c, --config [file]', 'configuration file to be used')
+ .option(commandFlags.profile.flag, commandFlags.profile.description)
+ .option(commandFlags.config.flag, commandFlags.config.description)
.option('--features', 'run only *.feature files and skip tests')
.option('--tests', 'run only JS test files and skip features')
+ .option('--no-timeouts', 'disable all timeouts')
.option('-p, --plugins ', 'enable plugins, comma-separated')
+ .option('--shuffle', 'Shuffle the order in which test files run')
+ .option('--shard ', 'run only a fraction of tests (e.g., --shard 1/4)')
// mocha options
.option('--colors', 'force enabling of colors')
@@ -141,7 +187,7 @@ program.command('run-rerun [test]')
.option('-R, --reporter ', 'specify the reporter to use')
.option('-S, --sort', 'sort test files')
.option('-b, --bail', 'bail after first test failure')
- .option('-d, --debug', "enable node's debugger, synonym for node --debug")
+ .option('--inspec', "enable node's debugger, synonym for node --debug")
.option('-g, --grep ', 'only run tests matching ')
.option('-f, --fgrep ', 'only run tests containing ')
.option('-i, --invert', 'inverts --grep and --fgrep matches')
@@ -153,37 +199,43 @@ program.command('run-rerun [test]')
.option('--recursive', 'include sub directories')
.option('--trace', 'trace function calls')
.option('--child ', 'option for child processes')
+ .action(commandHandler('../lib/command/run.js'))
- .action(require('../lib/command/run-rerun'));
-
-program.command('run-workers ')
+program
+ .command('run-workers [selectedRuns...]')
.description('Executes tests in workers')
- .option('-c, --config [file]', 'configuration file to be used')
+ .option(commandFlags.config.flag, commandFlags.config.description)
.option('-g, --grep ', 'only run tests matching ')
.option('-i, --invert', 'inverts --grep matches')
.option('-o, --override [value]', 'override current config options')
.option('--suites', 'parallel execution of suites not single tests')
- .option('--debug', 'output additional information')
- .option('--verbose', 'output internal logging information')
+ .option('--by ', 'test distribution strategy: "test" (pre-assign individual tests), "suite" (pre-assign test suites), or "pool" (dynamic distribution for optimal load balancing, recommended)')
+ .option(commandFlags.debug.flag, commandFlags.debug.description)
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
.option('--features', 'run only *.feature files and skip tests')
.option('--tests', 'run only JS test files and skip features')
- .option('--profile [value]', 'configuration profile to be used')
+ .option(commandFlags.profile.flag, commandFlags.profile.description)
+ .option(commandFlags.ai.flag, commandFlags.ai.description)
.option('-p, --plugins ', 'enable plugins, comma-separated')
- .action(require('../lib/command/run-workers'));
+ .option('-O, --reporter-options ', 'reporter-specific options')
+ .option('-R, --reporter ', 'specify the reporter to use')
+ .action(commandHandler('../lib/command/run-workers.js'))
-program.command('run-multiple [suites...]')
+program
+ .command('run-multiple [suites...]')
.description('Executes tests multiple')
- .option('-c, --config [file]', 'configuration file to be used')
- .option('--profile [value]', 'configuration profile to be used')
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .option(commandFlags.profile.flag, commandFlags.profile.description)
.option('--all', 'run all suites')
.option('--features', 'run only *.feature files and skip tests')
.option('--tests', 'run only JS test files and skip features')
+ .option(commandFlags.ai.flag, commandFlags.ai.description)
.option('-g, --grep ', 'only run tests matching ')
.option('-f, --fgrep ', 'only run tests containing ')
.option('-i, --invert', 'inverts --grep and --fgrep matches')
- .option('--steps', 'show step-by-step execution')
- .option('--verbose', 'output internal logging information')
- .option('--debug', 'output additional information')
+ .option(commandFlags.steps.flag, commandFlags.steps.description)
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
+ .option(commandFlags.debug.flag, commandFlags.debug.description)
.option('-p, --plugins ', 'enable plugins, comma-separated')
.option('-o, --override [value]', 'override current config options')
.option('-O, --reporter-options ', 'reporter-specific options')
@@ -193,35 +245,77 @@ program.command('run-multiple [suites...]')
// mocha options
.option('--colors', 'force enabling of colors')
- .action(require('../lib/command/run-multiple'));
+ .action(commandHandler('../lib/command/run-multiple.js'))
-program.command('info [path]')
- .description('Print debugging information concerning the local environment')
- .option('-c, --config', 'your config file path')
- .action(require('../lib/command/info'));
+program.command('info [path]').description('Print debugging information concerning the local environment').option('-c, --config', 'your config file path').action(commandHandler('../lib/command/info.js'))
-program.command('dry-run [test]')
+program
+ .command('dry-run [test]')
.description('Prints step-by-step scenario for a test without actually running it')
.option('-p, --plugins ', 'enable plugins, comma-separated')
- .option('--bootstrap', 'enable bootstrap script for dry-run')
- .option('-c, --config [file]', 'configuration file to be used')
+ .option('--bootstrap', 'enable bootstrap & teardown scripts for dry-run')
+ .option(commandFlags.config.flag, commandFlags.config.description)
.option('--all', 'run all suites')
.option('--features', 'run only *.feature files and skip tests')
.option('--tests', 'run only JS test files and skip features')
.option('-g, --grep ', 'only run tests matching ')
.option('-f, --fgrep ', 'only run tests containing ')
.option('-i, --invert', 'inverts --grep and --fgrep matches')
- .option('--steps', 'show step-by-step execution')
- .option('--verbose', 'output internal logging information')
- .option('--debug', 'output additional information')
- .action(require('../lib/command/dryRun'));
+ .option(commandFlags.steps.flag, commandFlags.steps.description)
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
+ .option(commandFlags.debug.flag, commandFlags.debug.description)
+ .option('--no-ansi', 'disable colored / ANSI-styled output')
+ .option('--numbers', 'prefix each step with a per-test index number')
+ .action(commandHandler('../lib/command/dryRun.js'))
+
+program
+ .command('run-rerun [test]')
+ .description('Executes tests in more than one test suite run')
+
+ // codecept-only options
+ .option(commandFlags.steps.flag, commandFlags.steps.description)
+ .option(commandFlags.debug.flag, commandFlags.debug.description)
+ .option(commandFlags.verbose.flag, commandFlags.verbose.description)
+ .option('-o, --override [value]', 'override current config options')
+ .option(commandFlags.profile.flag, commandFlags.profile.description)
+ .option(commandFlags.config.flag, commandFlags.config.description)
+ .option('--features', 'run only *.feature files and skip tests')
+ .option('--tests', 'run only JS test files and skip features')
+ .option('-p, --plugins ', 'enable plugins, comma-separated')
+
+ // mocha options
+ .option('--colors', 'force enabling of colors')
+ .option('--no-colors', 'force disabling of colors')
+ .option('-G, --growl', 'enable growl notification support')
+ .option('-O, --reporter-options ', 'reporter-specific options')
+ .option('-R, --reporter ', 'specify the reporter to use')
+ .option('-S, --sort', 'sort test files')
+ .option('-b, --bail', 'bail after first test failure')
+ .option('--inspect', "enable node's debugger, synonym for node --debug")
+ .option('-g, --grep ', 'only run tests matching ')
+ .option('-f, --fgrep ', 'only run tests containing ')
+ .option('-i, --invert', 'inverts --grep and --fgrep matches')
+ .option('--full-trace', 'display the full stack trace')
+ .option('--compilers :,...', 'use the given module(s) to compile files')
+ .option('--debug-brk', "enable node's debugger breaking on the first line")
+ .option('--inline-diffs', 'display actual/expected differences inline within each string')
+ .option('--no-exit', 'require a clean shutdown of the event loop: mocha will not call process.exit')
+ .option('--recursive', 'include sub directories')
+ .option('--trace', 'trace function calls')
+ .option('--child ', 'option for child processes')
+
+ .action(async (...args) => {
+ const runRerun = await dynamicImport('../lib/command/run-rerun.js')
+ return runRerun(...args)
+ })
-program.on('command:*', (cmd) => {
- console.log(`\nUnknown command ${cmd}\n`);
- program.outputHelp();
-});
+program.on('command:*', cmd => {
+ console.log(`\nUnknown command ${cmd}\n`)
+ program.outputHelp()
+})
if (process.argv.length <= 2) {
- program.outputHelp();
+ program.outputHelp()
+} else {
+ program.parse(process.argv)
}
-program.parse(process.argv);
diff --git a/bin/codeceptq.js b/bin/codeceptq.js
new file mode 100755
index 000000000..a5546e658
--- /dev/null
+++ b/bin/codeceptq.js
@@ -0,0 +1,49 @@
+#!/usr/bin/env node
+import { Command } from 'commander'
+import query from '../lib/command/query.js'
+
+const program = new Command()
+
+program
+ .name('codeceptq')
+ .description('Query HTML with CodeceptJS locators (CSS, XPath, fuzzy text, semantic).\n\nReads HTML from stdin or --file and prints matching elements with line numbers.')
+ .argument('', 'locator string (CSS, XPath, or text for semantic match)')
+ .argument('[context]', 'scope locator — restrict matches to descendants of context')
+ .option('--field', 'treat locator as form field (input/textarea/select)')
+ .option('--click', 'treat locator as clickable element (link, button, role=button, ...)')
+ .option('--clickable', 'alias for --click')
+ .option('--checkable', 'treat locator as checkbox/radio')
+ .option('--select', 'treat locator as