# Releases
# 3.6.10
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π Bug Fixes fix(cli): missing failure counts when there is failedHooks (#4633 (opens new window)) - by kobenguyent (opens new window)
# 3.6.9
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π Hot Fixes
fix: could not run tests due to missing invisi-data
lib - by kobenguyent (opens new window)
# 3.6.8
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(cli): mask sensitive data in logs (#4630 (opens new window)) - by kobenguyent (opens new window)
export const config: CodeceptJS.MainConfig = {
tests: '**/*.e2e.test.ts',
retry: 4,
output: './output',
maskSensitiveData: true,
emptyOutputFolder: true,
...
I login {"username":"[email protected]","password": "****"}
I send post request "https://localhost:8000/login", {"username":"[email protected]","password": "****"}
βΊ **[Request]** {"baseURL":"https://localhost:8000/login","method":"POST","data":{"username":"[email protected]","password": "****"},"headers":{}}
βΊ **[Response]** {"access-token": "****"}
- feat(REST): DELETE request supports payload (#4493 (opens new window)) - by schaudhary111 (opens new window)
I.sendDeleteRequestWithPayload('/api/users/1', { author: 'john' });
π Bug Fixes
- fix(playwright): Different behavior of see* and waitFor* when used in within (#4557 (opens new window)) - by kobenguyent (opens new window)
- fix(cli): dry run returns no tests when using a regex grep (#4608 (opens new window)) - by kobenguyent (opens new window)
> codeceptjs dry-run --steps --grep "(?=.*Checkout process)"
- fix: Replace deprecated faker.name with faker.person (#4581 (opens new window)) - by thomashohn (opens new window)
- fix(wdio): Remove dependency to devtools (#4563 (opens new window)) - by thomashohn (opens new window)
- fix(typings): wrong defineParameterType (#4548 (opens new window)) - by kobenguyent (opens new window)
- fix(typing):
Locator.build
complains the empty locator (#4543 (opens new window)) - by kobenguyent (opens new window) - fix: add hint to
I.seeEmailAttachment
treats parameter as regular expression (#4629 (opens new window)) - by ngraf (opens new window)
Add hint to "I.seeEmailAttachment" that under the hood parameter is treated as RegExp.
When you don't know it, it can cause a lot of pain, wondering why your test fails with I.seeEmailAttachment('Attachment(1).pdf') although it looks just fine, but actually I.seeEmailAttachment('Attachment\\(1\\).pdf is required to make the test green, in case the attachment is called "Attachment(1).pdf" with special character in it.
- fix(playwright): waitForText fails when text contains double quotes (#4528 (opens new window)) - by DavertMik (opens new window)
- fix(mock-server-helper): move to stand-alone package: https://www.npmjs.com/package/@codeceptjs/mock-server-helper (#4536 (opens new window)) - by kobenguyent (opens new window)
- fix(appium): issue with async on runOnIos and runOnAndroid (#4525 (opens new window)) - by kobenguyent (opens new window)
- fix: push ws messages to array (#4513 (opens new window)) - by kobenguyent (opens new window)
π Documentation
- fix(docs): typo in ai.md (#4501 (opens new window)) - by tomaculum (opens new window)
# 3.6.6
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(locator): add withAttrEndsWith, withAttrStartsWith, withAttrContains (#4334 (opens new window)) - by Maksym-Artemenko (opens new window)
- feat: soft assert (#4473 (opens new window)) - by kobenguyent (opens new window)
- Soft assert
Zero-configuration when paired with other helpers like REST, Playwright:
// inside codecept.conf.js
{
helpers: {
Playwright: {...},
SoftExpectHelper: {},
}
}
// in scenario
I.softExpectEqual('a', 'b')
I.flushSoftAssertions() // Throws an error if any soft assertions have failed. The error message contains all the accumulated failures.
- feat(cli): print failed hooks (#4476 (opens new window)) - by kobenguyent (opens new window)
run command
run workers command
π Bug Fixes
- fix(AI): minor AI improvements - by DavertMik (opens new window)
- fix(AI): add missing await in AI.js (#4486 (opens new window)) - by tomaculum (opens new window)
- fix(playwright): no async save video page (#4472 (opens new window)) - by kobenguyent (opens new window)
- fix(rest): httpAgent condition (#4484 (opens new window)) - by kobenguyent (opens new window)
- fix: DataCloneError error when
I.executeScript
command is used withrun-workers
(#4483 (opens new window)) - by code4muktesh (opens new window) - fix: no error thrown from rerun script (#4494 (opens new window)) - by lin-brian-l (opens new window)
// fix the validation of httpAgent config. we could now pass ca, instead of key/cert.
{
helpers: {
REST: {
endpoint: 'http://site.com/api',
prettyPrintJson: true,
httpAgent: {
ca: fs.readFileSync(__dirname + '/path/to/ca.pem'),
rejectUnauthorized: false,
keepAlive: true
}
}
}
}
π Documentation
- doc(AI): minor AI improvements - by DavertMik (opens new window)
# 3.6.5
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(helper): playwright > wait for disabled (#4412 (opens new window)) - by kobenguyent (opens new window)
it('should wait for input text field to be disabled', () =>
I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled('#text', 1)))
it('should wait for input text field to be enabled by xpath', () =>
I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled("//*[@name = 'test']", 1)))
it('should wait for a button to be disabled', () =>
I.amOnPage('/form/wait_disabled').then(() => I.waitForDisabled('#text', 1)))
Waits for element to become disabled (by default waits for 1sec).
Element can be located by CSS or XPath.
**[param](https://github.com/param)** {CodeceptJS.LocatorOrString} locator element located by CSS|XPath|strict locator. **[param](https://github.com/param)** {number} [sec=1] (optional) time in seconds to wait, 1 by default. **[returns](https://github.com/returns)** {void} automatically synchronized promise through #recorder
π Bug Fixes
- fix(AI): AI is not triggered (#4422 (opens new window)) - by kobenguyent (opens new window)
- fix(plugin): stepByStep > report doesn't sync properly (#4413 (opens new window)) - by kobenguyent (opens new window)
- fix: Locator > Unsupported pseudo selector 'has' (#4448 (opens new window)) - by anils92 (opens new window)
π Documentation
- docs: setup azure open ai using bearer token (#4434 (opens new window)) - by kobenguyent (opens new window)
# 3.6.4
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(rest): print curl (#4396 (opens new window)) - by kobenguyent (opens new window)
Config:
...
REST: {
...
printCurl: true,
...
}
...
βΊ [CURL Request] curl --location --request POST https://httpbin.org/post -H ...
- feat(AI): Generate PageObject, added types, shell improvement (#4319 (opens new window)) - by DavertMik (opens new window)
- added
askForPageObject
method to generate PageObjects on the fly - improved AI types
- interactive shell improved to restore history
- added
π Bug Fixes
- fix(heal): wrong priority (#4394 (opens new window)) - by kobenguyent (opens new window)
π Documentation
- AI docs improvements by DavertMik (opens new window)
# 3.6.3
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(plugin): coverage with WebDriver - devtools (#4349 (opens new window)) - by KobeNguyent (opens new window)
π Bug Fixes
- fix(cli): stale process (#4367 (opens new window)) - by Horsty80 (opens new window) kobenguyent (opens new window)
- fix(runner): screenshot error in beforeSuite/AfterSuite (#4385 (opens new window)) - by kobenguyent (opens new window)
- fix(cli): gherkin command init with TypeScript (#4366 (opens new window)) - by andonary (opens new window)
- fix(webApi): error message of dontSeeCookie (#4357 (opens new window)) - by a-stankevich (opens new window)
π Documentation
- fix(doc): Expect helper is not described correctly (#4370 (opens new window)) - by kobenguyent (opens new window)
- fix(docs): some strange characters (#4387 (opens new window)) - by kobenguyent (opens new window)
- fix: Puppeteer helper doc typo (#4369 (opens new window)) - by yoannfleurydev (opens new window)
# 3.6.2
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat(REST): support httpAgent conf (#4328 (opens new window)) - by KobeNguyent (opens new window)
Support the httpAgent conf to create the TSL connection via REST helper
{
helpers: {
REST: {
endpoint: 'http://site.com/api',
prettyPrintJson: true,
httpAgent: {
key: fs.readFileSync(__dirname + '/path/to/keyfile.key'),
cert: fs.readFileSync(__dirname + '/path/to/certfile.cert'),
rejectUnauthorized: false,
keepAlive: true
}
}
}
}
- feat(wd): screenshots for sessions (#4322 (opens new window)) - by KobeNguyent (opens new window)
Currently only screenshot of the active session is saved, this PR aims to save the screenshot of every session for easy debugging
Scenario('should save screenshot for sessions **[WebDriverIO](https://github.com/WebDriverIO)** **[Puppeteer](https://github.com/Puppeteer)** **[Playwright](https://github.com/Playwright)**', async ({ I }) => {
await I.amOnPage('/form/bug1467');
await I.saveScreenshot('original.png');
await I.amOnPage('/');
await I.saveScreenshot('main_session.png');
session('john', async () => {
await I.amOnPage('/form/bug1467');
event.dispatcher.emit(event.test.failed, this);
});
const fileName = clearString('should save screenshot for active session **[WebDriverIO](https://github.com/WebDriverIO)** **[Puppeteer](https://github.com/Puppeteer)** **[Playwright](https://github.com/Playwright)**');
const [original, failed] = await I.getSHA256Digests([
`${output_dir}/original.png`,
`${output_dir}/john_${fileName}.failed.png`,
]);
// Assert that screenshots of same page in same session are equal
await I.expectEqual(original, failed);
// Assert that screenshots of sessions are created
const [main_original, session_failed] = await I.getSHA256Digests([
`${output_dir}/main_session.png`,
`${output_dir}/john_${fileName}.failed.png`,
]);
await I.expectNotEqual(main_original, session_failed);
});
- feat: locate element with withClassAttr (#4321 (opens new window)) - by KobeNguyent (opens new window)
Find an element with class attribute
// find div with class contains 'form'
locate('div').withClassAttr('text');
- fix(playwright): set the record video resolution (#4311 (opens new window)) - by KobeNguyent (opens new window) You could now set the recording video resolution
url: siteUrl,
windowSize: '300x500',
show: false,
restart: true,
browser: 'chromium',
trace: true,
video: true,
recordVideo: {
size: {
width: 400,
height: 600,
},
},
π Bug Fixes
- fix: several issues of stepByStep report (#4331 (opens new window)) - by KobeNguyent (opens new window)
π Documentation
- fix: wrong format docs (#4330 (opens new window)) - by KobeNguyent (opens new window)
- fix(docs): wrong method is mentioned (#4320 (opens new window)) - by KobeNguyent (opens new window)
- fix: ChatGPT docs - by davert (opens new window)
# 3.6.1
- Fixed regression in interactive pause.
# 3.6.0
π©οΈ Features
- Introduced healers to improve stability of failed tests. Write functions that can perform actions to fix a failing test:
heal.addRecipe('reloadPageIfModalIsNotVisisble', {
steps: [
'click',
],
fn: async ({ error, step }) => {
// this function will be executed only if test failed with
// "model is not visible" message
if (error.message.include('modal is not visible')) return;
// we return a function that will refresh a page
// and tries to perform last step again
return async ({ I }) => {
I.reloadPage();
I.wait(1);
await step.run();
};
// if a function succeeds, test continues without an error
},
});
Breaking Change AI features refactored. Read updated AI guide:
- removed dependency on
openai
- added support for Azure OpenAI, Claude, Mistal, or any AI via custom request function
--ai
option added to explicitly enable AI features- heal plugin decoupled from AI to run custom heal recipes
- improved healing for async/await scenarios
- token limits added
- token calculation introduced
OpenAI
helper renamed toAI
- removed dependency on
feat(puppeteer): network traffic manipulation. See #4263 (opens new window) by KobeNguyenT (opens new window)
startRecordingTraffic
grabRecordedNetworkTraffics
flushNetworkTraffics
stopRecordingTraffic
seeTraffic
dontSeeTraffic
feat(Puppeteer): recording WS messages. See #4264 (opens new window) by KobeNguyenT (opens new window)
Recording WS messages:
I.startRecordingWebSocketMessages();
I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.greaterThan(0);
flushing WS messages:
I.startRecordingWebSocketMessages();
I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
I.flushWebSocketMessages();
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.equal(0);
Examples:
// recording traffics and verify the traffic
I.startRecordingTraffic();
I.amOnPage('https://codecept.io/');
I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// check the traffic with advanced params
I.amOnPage('https://openai.com/blog/chatgpt');
I.startRecordingTraffic();
I.seeTraffic({
name: 'sentry event',
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
parameters: {
width: '1919',
height: '1138',
},
});
- Introduce the playwright locator:
_react
,_vue
,data-testid
attribute. See #4255 (opens new window) by KobeNguyenT (opens new window)
Scenario('using playwright locator **[Playwright](https://github.com/Playwright)**', () => {
I.amOnPage('https://codecept.io/test-react-calculator/');
I.click('7');
I.click({ pw: '_react=t[name = "="]' });
I.seeElement({ pw: '_react=t[value = "7"]' });
I.click({ pw: '_react=t[name = "+"]' });
I.click({ pw: '_react=t[name = "3"]' });
I.click({ pw: '_react=t[name = "="]' });
I.seeElement({ pw: '_react=t[value = "10"]' });
});
Scenario('using playwright data-testid attribute **[Playwright](https://github.com/Playwright)**', () => {
I.amOnPage('/');
const webElements = await I.grabWebElements({ pw: '[data-testid="welcome"]' });
assert.equal(webElements[0]._selector, '[data-testid="welcome"] >> nth=0');
assert.equal(webElements.length, 1);
});
- feat(puppeteer): mockRoute support. See #4262 (opens new window) by KobeNguyenT (opens new window)
Network requests & responses can be mocked and modified. Use mockRoute
which strictly follows Puppeteer's setRequestInterception API (opens new window).
I.mockRoute('https://reqres.in/api/comments/1', request => {
request.respond({
status: 200,
headers: { 'Access-Control-Allow-Origin': '*' },
contentType: 'application/json',
body: '{"name": "this was mocked" }',
});
})
I.mockRoute('**/*.{png,jpg,jpeg}', route => route.abort());
// To disable mocking for a route call `stopMockingRoute`
// for previously mocked URL
I.stopMockingRoute('**/*.{png,jpg,jpeg}');
To master request intercepting use HTTPRequest object (opens new window) passed into mock request handler.
π Bug Fixes
- Fixed double help message #4278 (opens new window) by masiuchi (opens new window)
- waitNumberOfVisibleElements always failed when passing num as 0. See #4274 (opens new window) by KobeNguyenT (opens new window)
# 3.5.15
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat: improve code coverage plugin (#4252 (opens new window)) - by KobeNguyenT (opens new window) We revamp the coverage plugin to make it easier to use
Once all the tests are completed, codecept
will create and store coverage in output/coverage
folder, as shown below.
Open index.html
in your browser to view the full interactive coverage report.
π Bug Fixes
- fix: bump puppeteer to v22.x (#4249 (opens new window)) - by KobeNguyenT (opens new window)
- fix: improve dry-run command (#4225 (opens new window)) - by KobeNguyenT (opens new window)
dry-run command now supports test level grep.
Tests from /Users/t/Desktop/projects/codeceptjs-rest-demo:@jaja
GET tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/GET_test.ts -- 4 tests
β Verify getting a single user **[jaja](https://github.com/jaja)**
β Verify getting list of users **[jaja](https://github.com/jaja)**
PUT tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/PUT_test.ts -- 4 tests
β Verify creating new user **[Jaja](https://github.com/Jaja)**
Total: 2 suites | 3 tests
--- DRY MODE: No tests were executed ---
β codeceptjs-rest-demo git:(master) β npx codeceptjs dry-run
Tests from /Users/t/Desktop/projects/codeceptjs-rest-demo:
DELETE tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/DELETE_test.ts -- 4 tests
β Verify deleting a user
GET tests -- /Users/t/Desktop/projects/codeceptjs-rest-demo/src/GET_test.ts -- 4 tests
β Verify a successful call
β Verify a not found call
β Verify getting a single user **[jaja](https://github.com/jaja)**
β Verify getting list of users **[jaja](https://github.com/jaja)**
POST tests -- /Users/tDesktop/projects/codeceptjs-rest-demo/src/POST_test.ts -- 4 tests
β Verify creating new user
β Verify uploading a file
PUT tests -- /Users/tDesktop/projects/codeceptjs-rest-demo/src/PUT_test.ts -- 4 tests
β Verify creating new user **[Jaja](https://github.com/Jaja)**
Total: 4 suites | 8 tests
--- DRY MODE: No tests were executed ---
- Several internal fixes and improvements for github workflows
# 3.5.14
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π Bug Fixes
- Hotfix Fixed missing
joi
package - by KobeNguyenT (opens new window)
# 3.5.13
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat: mock server helper (#4155 (opens new window)) - by KobeNguyenT (opens new window)
- feat(webdriver): network traffics manipulation (#4166 (opens new window)) - by KobeNguyenT (opens new window) [Webdriver] Added commands to check network traffics - supported only with devtoolsProtocol
startRecordingTraffic
grabRecordedNetworkTraffics
flushNetworkTraffics
stopRecordingTraffic
seeTraffic
dontSeeTraffic
Examples:
// recording traffics and verify the traffic
I.startRecordingTraffic();
I.amOnPage('https://codecept.io/');
I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// check the traffic with advanced params
I.amOnPage('https://openai.com/blog/chatgpt');
I.startRecordingTraffic();
I.seeTraffic({
name: 'sentry event',
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
parameters: {
width: '1919',
height: '1138',
},
});
- feat(webapi): add waitForCookie (#4169 (opens new window)) - by KobeNguyenT (opens new window) Waits for the specified cookie in the cookies.
I.waitForCookie("token");
π Bug Fixes
- fix(appium): update performSwipe with w3c protocol v2 (#4181 (opens new window)) - by MykaLev (opens new window)
- fix(webapi): selectOption method (#4157 (opens new window)) - by dyaroman (opens new window)
- fix: waitForText doesnt throw error when text doesnt exist (#4195 (opens new window)) - by KobeNguyenT (opens new window)
- fix: use this.options instead of this.config (#4186 (opens new window)) - by KobeNguyenT (opens new window)
- fix: config path without selenium (#4184 (opens new window)) - by KobeNguyenT (opens new window)
- fix: bring to front condition in _setPage (#4173 (opens new window)) - by KobeNguyenT (opens new window)
- fix: complicated locator (#4170 (opens new window)) - by KobeNguyenT (opens new window)
Adding of
':nth-child'
into the array
const limitation = [':nth-of-type', ':first-of-type', ':last-of-type', ':nth-last-child', ':nth-last-of-type', ':checked', ':disabled', ':enabled', ':required', ':lang'];
fixes the issue. Then an old conversion way over css-to-xpath
is used.
π Documentation
- fix(docs): missing docs for codecept UI (#4175 (opens new window)) - by KobeNguyenT (opens new window)
- fix(docs): Appium documentation sidebar menu links (#4188 (opens new window)) - by mirao (opens new window)
π©οΈ Several bugfixes and improvements for Codecept-UI
- Several internal improvements
- fix: title is not showing when visiting a test
- fix: handle erros nicely
# 3.5.12
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
feat: upgrade wdio (#4123 (opens new window)) - by KobeNguyenT (opens new window)
π©οΈ With the release of WebdriverIO version
v8.14.0
, and onwards, all driver management hassles are now a thing of the past π. Read more here (opens new window). One of the significant advantages of this update is that you can now get rid of any driver services you previously had to manage, such aswdio-chromedriver-service
,wdio-geckodriver-service
,wdio-edgedriver-service
,wdio-safaridriver-service
, and even@wdio/selenium-standalone-service
.
For those who require custom driver options, fear not; WebDriver Helper allows you to pass in driver options through custom WebDriver configuration. If you have a custom grid, use a cloud service, or prefer to run your own driver, there's no need to worry since WebDriver Helper will only start a driver when there are no other connection information settings like hostname or port specified.
Example:
{
helpers: {
WebDriver : {
smartWait: 5000,
browser: "chrome",
restart: false,
windowSize: "maximize",
timeouts: {
"script": 60000,
"page load": 10000
}
}
}
}
Testing Chrome locally is now more convenient than ever. You can define a browser channel, and WebDriver Helper will take care of downloading the specified browser version for you. For example:
{
helpers: {
WebDriver : {
smartWait: 5000,
browser: "chrome",
browserVersion: '116.0.5793.0', // or 'stable', 'beta', 'dev' or 'canary'
restart: false,
windowSize: "maximize",
timeouts: {
"script": 60000,
"page load": 10000
}
}
}
}
- feat: wdio with devtools protocol (#4105 (opens new window)) - by KobeNguyenT (opens new window)
Running with devtools protocol
{
helpers: {
WebDriver : {
url: "http://localhost",
browser: "chrome",
devtoolsProtocol: true,
desiredCapabilities: {
chromeOptions: {
args: [ "--headless", "--disable-gpu", "--no-sandbox" ]
}
}
}
}
}
- feat: add a locator builder method withTextEquals() (#4100 (opens new window)) - by mirao (opens new window)
Find an element with exact text
locate('button').withTextEquals('Add');
- feat: waitForNumberOfTabs (#4124 (opens new window)) - by KobeNguyenT (opens new window)
Waits for number of tabs.
I.waitForNumberOfTabs(2);
- feat: I.say would be added to Test.steps array (#4145 (opens new window)) - by KobeNguyenT (opens new window)
Currently I.say
is not added into the Test.steps
array. This PR aims to add this to steps array so that we could use it to print steps in ReportPortal for instance.
π Bug Fixes
- fix: reduce the package size to 2MB (#4138 (opens new window)) - by KobeNguyenT (opens new window)
- fix(webapi): see attributes on elements (#4147 (opens new window)) - by KobeNguyenT (opens new window)
- fix: some assertion methods (#4144 (opens new window)) - by KobeNguyenT (opens new window)
Improve the error message for seeElement
, dontSeeElement
, seeElementInDOM
, dontSeeElementInDOM
The current error message doesn't really help when debugging issue also causes some problem described in #4140 (opens new window)
Actual
expected visible elements '[ELEMENT]' to be empty
+ expected - actual
-[
- "ELEMENT"
-]
+[]
Updated
Error: Element "h1" is still visible
at seeElementError (lib/helper/errors/ElementAssertion.js:9:9)
at Playwright.dontSeeElement (lib/helper/Playwright.js:1472:7)
- fix: css to xpath backward compatibility (#4141 (opens new window)) - by KobeNguyenT (opens new window)
- css-to-xpath (opens new window): old lib, which works perfectly unless you have hyphen in locator. (https://github.com/codeceptjs/CodeceptJS/issues/3563)
- csstoxpath (opens new window): new lib, to solve the issue locator with hyphen but also have some limitations (opens new window)
- fix: grabRecordedNetworkTraffics throws error when being called twice (#4143 (opens new window)) - by KobeNguyenT (opens new window)
- fix: missing steps of test when running with workers (#4127 (opens new window)) - by KobeNguyenT (opens new window)
Scenario('Verify getting list of users', async () => {
let res = await I.getUserPerPage(2);
res.data = []; // this line causes the issue
await I.expectEqual(res.data.data[0].id, 7);
});
at this time, res.data.data[0].id would throw undefined error and somehow the test is missing all its steps.
- fix: process.env.profile when --profile isn't set in run-multiple mode (#4131 (opens new window)) - by mirao (opens new window)
process.env.profile
is the string "undefined" instead of type undefined when no --profile is specified in the mode "run-multiple"
- fix: session doesn't respect the context options (#4111 (opens new window)) - by KobeNguyenT (opens new window)
Helpers: Playwright
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement
Repro -- **[1]** Starting recording promises
Timeouts:
βΊ **[Session]** Starting singleton browser session
Reproduce issue
I am on page "https://example.com"
βΊ [Browser:Error] Failed to load resource: the server responded with a status of 404 ()
βΊ [New Context] {}
user1: I am on page "https://example.com"
user1: I execute script () => {
return { width: window.screen.width, height: window.screen.height };
}
sessionScreen is {"width":375,"height":667}
β OK in 1890ms
OK | 1 passed // 4s
fix(plugin): retryTo issue (#4117 (opens new window)) - by KobeNguyenT (opens new window)
fix(types): CustomLocator typing broken for custom strict locators (#4120 (opens new window)) - by KobeNguyenT (opens new window)
fix: wrong output for skipped tests - by KobeNguyenT (opens new window)
fix: no retry failed step after tryto block (#4103 (opens new window)) - by KobeNguyenT (opens new window)
fix: deprecate some JSON Wire Protocol commands (#4104 (opens new window)) - by KobeNguyenT (opens new window)
deprecate some JSON Wire Protocol commands: grabGeoLocation
, setGeoLocation
- fix: cannot locate complicated locator (#4101 (opens new window)) - by KobeNguyenT (opens new window)
Locator issue due to the lib changes
The locator locate(".ps-menu-button").withText("Authoring").inside(".ps-submenu-root:nth-child(3)") is translated to
3.5.8: //*[contains(concat(' ', normalize-space(./@class), ' '), ' ps-menu-button ')][contains(., 'Authoring')][ancestor::*[(contains(concat(' ', normalize-space(./@class), ' '), ' ps-submenu-root ') and count(preceding-sibling::*) = 2)]] and works well
3.5.11: //*[contains(@class, "ps-menu-button")][contains(., 'Authoring')][ancestor::*[3][contains(@class, "ps-submenu-root")]] and doesn't work (no clickable element found). Even if you test it in browser inspector, it doesn't work.
# 3.5.11
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat: other locators from playwright (#4090 (opens new window)) - by KobeNguyenT (opens new window)
- CodeceptJS - Playwright now supports other locators like
- React (https://playwright.dev/docs/other-locators#react-locator),
- Vue (https://playwright.dev/docs/other-locators#vue-locator)
- CodeceptJS - Playwright now supports other locators like
π Bug Fixes
- fix: step object is broken when step arg is a function (#4092 (opens new window)) - by KobeNguyenT (opens new window)
- fix: step object is broken when step arg contains joi object (#4084 (opens new window)) - by KobeNguyenT (opens new window)
- fix(expect helper): custom error message as optional param (#4082 (opens new window)) - by KobeNguyenT (opens new window)
- fix(puppeteer): hide deprecation info (#4075 (opens new window)) - by KobeNguyenT (opens new window)
- fix: seeattributesonelements throws error when attribute doesn't exist (#4073 (opens new window)) - by KobeNguyenT (opens new window)
- fix: typo in agrs (#4077 (opens new window)) - by KobeNguyenT (opens new window)
- fix: retryFailedStep is disabled for non tryTo steps (#4069 (opens new window)) - by KobeNguyenT (opens new window)
- fix(typings): scrollintoview complains scrollintoviewoptions (#4067 (opens new window)) - by KobeNguyenT (opens new window)
π Documentation
- fix(docs): some doc blocks are broken (#4076 (opens new window)) - by KobeNguyenT (opens new window)
- fix(docs): expect docs (#4058 (opens new window)) - by KobeNguyenT (opens new window)
# 3.5.10
β€οΈ Thanks all to those who contributed to make this release! β€οΈ
π©οΈ Features
- feat: expose WebElement (#4043 (opens new window)) - by KobeNguyenT (opens new window)
Now we expose the WebElements that are returned by the WebHelper and you could make the subsequence actions on them.
// Playwright helper would return the Locator
I.amOnPage('/form/focus_blur_elements');
const webElements = await I.grabWebElements('#button');
webElements[0].click();
- feat(playwright): support HAR replaying (#3990 (opens new window)) - by KobeNguyenT (opens new window)
Replaying from HAR
// Replay API requests from HAR.
// Either use a matching response from the HAR,
// or abort the request if nothing matches.
I.replayFromHar('./output/har/something.har', { url: "*/**/api/v1/fruits" });
I.amOnPage('https://demo.playwright.dev/api-mocking');
I.see('CodeceptJS'); **[Parameters]** harFilePath [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) Path to recorded HAR file
opts [object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)? [Options for replaying from HAR](https://playwright.dev/docs/api/class-page#page-route-from-har)
- feat(playwright): support HAR recording (#3986 (opens new window)) - by KobeNguyenT (opens new window)
A HAR file is an HTTP Archive file that contains a record of all the network requests that are made when a page is loaded.
It contains information about the request and response headers, cookies, content, timings, and more.
You can use HAR files to mock network requests in your tests. HAR will be saved to output/har.
More info could be found here https://playwright.dev/docs/api/class-browser#browser-new-context-option-record-har.
...
recordHar: {
mode: 'minimal', // possible values: 'minimal'|'full'.
content: 'embed' // possible values: "omit"|"embed"|"attach".
}
...
- improvement(playwright): support partial string for option (#4016 (opens new window)) - by KobeNguyenT (opens new window)
await I.amOnPage('/form/select');
await I.selectOption('Select your age', '21-');
π Bug Fixes
- fix(playwright): proceedSee could not find the element (#4006 (opens new window)) - by hatufacci (opens new window)
- fix(appium): remove the vendor prefix of 'bstack:options' (#4053 (opens new window)) - by mojtabaalavi (opens new window)
- fix(workers): event improvements (#3953 (opens new window)) - by KobeNguyenT (opens new window)
Emit the new event: event.workers.result.
CodeceptJS also exposes the env var `process.env.RUNS_WITH_WORKERS` when running tests with run-workers command so that you could handle the events better in your plugins/helpers.
const { event } = require('codeceptjs');
module.exports = function() {
// this event would trigger the `_publishResultsToTestrail` when running `run-workers` command
event.dispatcher.on(event.workers.result, async () => {
await _publishResultsToTestrail();
});
// this event would not trigger the `_publishResultsToTestrail` multiple times when running `run-workers` command
event.dispatcher.on(event.all.result, async () => {
// when running `run` command, this env var is undefined
if (!process.env.RUNS_WITH_WORKERS) await _publishResultsToTestrail();
});
}
- fix: ai html updates (#3962 (opens new window)) - by DavertMik (opens new window)
replaced minify library with a modern and more secure fork. Fixes [email protected] Regular Expression Denial of Service vulnerability [#3829](https://github.com/codeceptjs/CodeceptJS/issues/3829)
AI class is implemented as singleton
refactored heal.js plugin to work on edge cases
add configuration params on number of fixes performed by ay heal
improved recorder class to add more verbose log
improved recorder class to ignore some of errors
- fix(appium): closeApp supports both Android/iOS (#4046 (opens new window)) - by KobeNguyenT (opens new window)
- fix: some security vulnerability of some packages (#4045 (opens new window)) - by KobeNguyenT (opens new window)
- fix: seeAttributesOnElements check condition (#4029 (opens new window)) - by KobeNguyenT (opens new window)
- fix: waitForText locator issue (#4039 (opens new window)) - by KobeNguyenT (opens new window)
Fixed this error:
locator.isVisible: Unexpected token "s" while parsing selector ":has-text('Were you able to resolve the resident's issue?') >> nth=0"
at Playwright.waitForText (node_modules\codeceptjs\lib\helper\Playwright.js:2584:79)
- fix: move to sha256 (#4038 (opens new window)) - by KobeNguyenT (opens new window)
- fix: respect retries from retryfailedstep plugin in helpers (#4028 (opens new window)) - by KobeNguyenT (opens new window)
Currently inside the _before() of helpers for example Playwright, the retries is set there, however, when retryFailedStep plugin is enabled, the retries of recorder is still using the value from _before() not the value from retryFailedStep plugin.
Fix:
- introduce the process.env.FAILED_STEP_RETIRES which could be access everywhere as the helper won't know anything about the plugin.
- set default retries of Playwright to 3 to be on the same page with Puppeteer.
- fix: examples in test title (#4030 (opens new window)) - by KobeNguyenT (opens new window)
When test title doesn't have the data in examples:
Feature: Faker examples
Scenario Outline: Below are the users
Examples:
| user | role |
| John | admin |
| Tim | client |
Faker examples --
**[1]** Starting recording promises
Timeouts:
Below are the users {"user":"John","role":"admin"}
β OK in 4ms
Below are the users {"user":"Tim","role":"client"}
β OK in 1ms
When test title includes the data in examples:
Feature: Faker examples
Scenario Outline: Below are the users - <user> - <role>
Examples:
| user | role |
| John | admin |
| Tim | client |
Faker examples --
**[1]** Starting recording promises
Timeouts:
Below are the users - John - admin
β OK in 4ms
Below are the users - Tim - client
β OK in 1ms
- fix: disable retryFailedStep when using with tryTo (#4022 (opens new window)) - by KobeNguyenT (opens new window)
- fix: locator builder returns error when class name contains hyphen (#4024 (opens new window)) - by KobeNguyenT (opens new window)
- fix: seeCssPropertiesOnElements failed when font-weight is a number (#4026 (opens new window)) - by KobeNguyenT (opens new window)
- fix(appium): missing await on some steps of runOnIOS and runOnAndroid (#4018 (opens new window)) - by KobeNguyenT (opens new window)
- fix(cli): no error of failed tests when using retry with scenario only (#4020 (opens new window)) - by KobeNguyenT (opens new window)
- fix: set getPageTimeout to 30s (#4031 (opens new window)) - by KobeNguyenT (opens new window)
- fix(appium): expose switchToContext (#4015 (opens new window)) - by KobeNguyenT (opens new window)
- fix: promise issue (#4013 (opens new window)) - by KobeNguyenT (opens new window)
- fix: seeCssPropertiesOnElements issue with improper condition (#4057 (opens new window)) - by KobeNguyenT (opens new window)
π Documentation
- docs: Update clearCookie documentation for Playwright helper (#4005 (opens new window)) - by Hellosager (opens new window)
- docs: improve the example code for autoLogin (#4019 (opens new window)) - by KobeNguyenT (opens new window)
# 3.5.8
Thanks all to those who contributed to make this release!
π Bug Fixes fix(appium): type of setNetworkConnection() (#3994 (opens new window)) - by mirao (opens new window) fix: improve the way to show deprecated appium v1 message (#3992 (opens new window)) - by KobeNguyenT (opens new window) fix: missing exit condition of some wait functions - by KobeNguyenT (opens new window)
# 3.5.7
Thanks all to those who contributed to make this release!
π Bug Fixes
- Bump playwright to 1.39.0 - run
npx playwright install
to install the browsers as starting from 1.39.0 browsers are not installed automatically (#3924 (opens new window)) - by KobeNguyenT (opens new window) - fix(playwright): some wait functions draw error due to switchTo iframe (#3918 (opens new window)) - by KobeNguyenT (opens new window)
- fix(appium): AppiumTestDistribution/appium-device-farm requires 'platformName' (#3950 (opens new window)) - by rock-tran (opens new window)
- fix: autologin with empty fetch (#3947 (opens new window)) - by andonary (opens new window)
- fix(cli): customLocator draws error in dry-mode (#3940 (opens new window)) - by KobeNguyenT (opens new window)
- fix: ensure docs include returns (opens new window) Promise
where appropriate (#3954 (opens new window)) - by fwouts (opens new window) - fix: long text in data table cuts off (#3936 (opens new window)) - by KobeNguyenT (opens new window)
#language: de
FunktionalitΓ€t: Faker examples
Szenariogrundriss: Atualizar senha do usuΓ‘rio
Angenommen que estou logado via REST com o usuΓ‘rio "<customer>"
| protocol | https: |
| hostname | https://cucumber.io/docs/gherkin/languages/ |
Faker examples --
Atualizar senha do usuΓ‘rio {"product":"{{vehicle.vehicle}}","customer":"Dr. {{name.findName}}","price":"{{commerce.price}}","cashier":"cashier 2"}
On Angenommen: que estou logado via rest com o usuΓ‘rio "dr. {{name.find name}}"
protocol | https:
hostname | https://cucumber.io/docs/gherkin/languages/
Dr. {{name.findName}}
β OK in 13ms
- fix(playwright): move to waitFor (#3933 (opens new window)) - by KobeNguyenT (opens new window)
- fix: relax grabCookie type (#3919 (opens new window)) - by KobeNguyenT (opens new window)
- fix: proceedSee error when being called inside within (#3939 (opens new window)) - by KobeNguyenT (opens new window)
- fix: rename haveRequestHeaders of ppt and pw helpers (#3937 (opens new window)) - by KobeNguyenT (opens new window)
Renamed haveRequestHeaders of Puppeteer, Playwright helper so that it would not confuse the REST helper.
Puppeteer: setPuppeteerRequestHeaders
Playwright: setPlaywrightRequestHeaders
- improvement: handle the way to load apifactory nicely (#3941 (opens new window)) - by KobeNguyenT (opens new window)
With this fix, we could now use the following syntax:
export = new Factory()
.attr('name', () => faker.name.findName())
.attr('job', () => 'leader');
export default new Factory()
.attr('name', () => faker.name.findName())
.attr('job', () => 'leader');
modules.export = new Factory()
.attr('name', () => faker.name.findName())
.attr('job', () => 'leader');
π Documentation
- docs(appium): update to v2 (#3932 (opens new window)) - by KobeNguyenT (opens new window)
- docs: improve BDD Gherkin docs (#3938 (opens new window)) - by KobeNguyenT (opens new window)
- Other docs improvements
π©οΈ Features
- feat(puppeteer): support trace recording - by KobeNguyenT (opens new window)
[Trace Recording Customization]
Trace recording provides complete information on test execution and includes screenshots, and network requests logged during run. Traces will be saved to output/trace
trace: enables trace recording for failed tests; trace are saved into output/trace folder
keepTraceForPassedTests: - save trace for passed tests
- feat: expect helper (#3923 (opens new window)) - by KobeNguyenT (opens new window)
* This helper allows performing assertions based on Chai.
*
* ### Examples
*
* Zero-configuration when paired with other helpers like REST, Playwright:
*
* ```js
* // inside codecept.conf.js
*{
* helpers: {
* Playwright: {...},
* ExpectHelper: {},
* }
Expect Helper
#expectEqual
#expectNotEqual
#expectContain
#expectNotContain
#expectStartsWith
#expectNotStartsWith
#expectEndsWith
#expectNotEndsWith
#expectJsonSchema
#expectHasProperty
#expectHasAProperty
#expectToBeA
#expectToBeAn
#expectMatchRegex
#expectLengthOf
#expectTrue
#expectEmpty
#expectFalse
#expectAbove
#expectBelow
#expectLengthAboveThan
#expectLengthBelowThan
#expectLengthBelowThan
#expectDeepMembers
#expectDeepIncludeMembers
#expectDeepEqualExcluding
#expectLengthBelowThan
- feat: run-workers with multiple browsers output folders - by KobeNguyenT (opens new window)
- feat: introduce new Playwright methods - by hatufacci (opens new window)
- grabCheckedElementStatus
- grabDisabledElementStatus
- feat: gherkin supports i18n (#3934 (opens new window)) - by KobeNguyenT (opens new window)
#language: de
FunktionalitΓ€t: Checkout-Prozess
Um Produkte zu kaufen
Als Kunde
MΓΆchte ich in der Lage sein, mehrere Produkte zu kaufen
**[i18n](https://github.com/i18n)**
Szenariogrundriss: Bestellrabatt
Angenommen ich habe ein Produkt mit einem Preis von <price>$ in meinem Warenkorb
Und der Rabatt fΓΌr Bestellungen ΓΌber $20 betrΓ€gt 10 %
Wenn ich zur Kasse gehe
Dann sollte ich den Gesamtpreis von "<total>" $ sehen
Beispiele:
| price | total |
| 10 | 10.0 |
- feat(autoLogin): improve the check method (#3935 (opens new window)) - by KobeNguyenT (opens new window)
Instead of asserting on page elements for the current user in check, you can use the session you saved in fetch
autoLogin: {
enabled: true,
saveToFile: true,
inject: 'login',
users: {
admin: {
login: async (I) => { // If you use async function in the autoLogin plugin
const phrase = await I.grabTextFrom('#phrase')
I.fillField('username', 'admin'),
I.fillField('password', 'password')
I.fillField('phrase', phrase)
},
check: (I, session) => {
// Throwing an error in `check` will make CodeceptJS perform the login step for the user
if (session.profile.email !== [email protected]) {
throw new Error ('Wrong user signed in');
}
},
}
}
}
Scenario('login', async ( {I, login} ) => {
await login('admin') // you should use `await`
})
# 3.5.6
Thanks all to those who contributed to make this release!
π Bug Fixes
- fix: switchTo/within block doesn't switch to expected iframe (#3892 (opens new window)) - by KobeNguyenT (opens new window)
- fix: highlight element doesn't work as expected (#3896 (opens new window)) - by KobeNguyenT (opens new window)
verbose/ highlight TRUE TRUE -> highlight element
verbose/ highlight TRUE FALSE -> no highlight element
verbose/ highlight FALSE TRUE -> no highlight element
verbose/ highlight FALSE FALSE -> no highlight element
- fix: masked value issue in data table (#3885 (opens new window)) - by KobeNguyenT (opens new window)
const accounts = new DataTable(['role', 'username', 'password']);
accounts.add([
'ROLE_A',
process.env['FIRST_USERNAME'],
secret(process.env['FIRST_PASSWORD']),
]);
accounts.add([
'ROLE_B',
process.env['SECOND_USERNAME'],
secret(process.env['SECOND_PASSWORD']),
]);
Data(accounts)
.Scenario(
'ScenarioTitle',
({ I, pageObject, current }) => {
I.say("Given I'am logged in");
I.amOnPage('/');
loginPage.**sendForm**(current.username, current.password);
)
// output
The test feature --
The scenario | {"username":"Username","password": ***}
'The real password: theLoggedPasswordInCleartext'
I.fillField('somePasswordLocator', '****')
β OK in 7ms
The scenario | {"username":"theSecondUsername","password": ***}
'The real password: theLoggedPasswordInCleartext'
I.fillField('somePasswordLocator', '****')
β OK in 1ms
- fix: debug info causes error (#3882 (opens new window)) - by KobeNguyenT (opens new window)
π Documentation
- fix: get rid of complaining when using session without await and returning nothing. (#3899 (opens new window)) - by KobeNguyenT (opens new window)
- fix(FileSystem): a typo in writeToFile() (#3897 (opens new window)) - by mirao (opens new window)
π©οΈ Features
- feat(translation): add more french keywords and fix deprecated waitForClickable (#3906 (opens new window)) - by andonary (opens new window)
- Add some french keywords for translation
- I.waitForClickable has the same "attends" than I.wait. Using "attends" leads to use the deprecated waitForClickable. Fix it by using different words.
# 3.5.5
π Bug Fixes
- fix(browserstack): issue with vendor prefix (#3845 (opens new window)) - by KobeNguyenT (opens new window)
export const caps = {
androidCaps: {
appiumV2: true,
host: "hub-cloud.browserstack.com",
port: 4444,
user: process.env.BROWSERSTACK_USER,
key: process.env.BROWSERSTACK_KEY,
'app': `bs://c700ce60cf13ae8ed97705a55b8e022f1hjhkjh3c5827c`,
browser: '',
desiredCapabilities: {
'appPackage': data.packageName,
'deviceName': process.env.DEVICE || 'Google Pixel 3',
'platformName': process.env.PLATFORM || 'android',
'platformVersion': process.env.OS_VERSION || '10.0',
'automationName': process.env.ENGINE || 'UIAutomator2',
'newCommandTimeout': 300000,
'androidDeviceReadyTimeout': 300000,
'androidInstallTimeout': 90000,
'appWaitDuration': 300000,
'autoGrantPermissions': true,
'gpsEnabled': true,
'isHeadless': false,
'noReset': false,
'noSign': true,
'bstack:options' : {
"appiumVersion" : "2.0.1",
},
}
},
}
- switchTo/within now supports strict locator (#3847 (opens new window)) - by KobeNguyenT (opens new window)
I.switchTo({ css: 'iframe[id^=number-frame]' }) // support the strict locator
I.amOnPage('/iframe');
within({
frame: { css: '#number-frame-1234' }, // support the strict locator
}, () => {
I.fillField('user[login]', 'User');
I.fillField('user[email]', '[email protected]');
I.fillField('user[password]', '[email protected]');
I.click('button');
});
- Improve the IntelliSense when using other languages (#3848 (opens new window)) - by andonary (opens new window)
include: {
Je: './steps_file.js'
}
- bypassCSP support for Playwright helper (#3865 (opens new window)) - by sammeel (opens new window)
helpers: {
Playwright: {
bypassCSP: true
}
- fix: missing requests when recording network (#3834 (opens new window)) - by KobeNguyenT (opens new window)
π©οΈ Features and Improvements
- Show environment info in verbose mode (#3858 (opens new window)) - by KobeNguyenT (opens new window)
Environment information:-
codeceptVersion: "3.5.4"
nodeInfo: 18.16.0
osInfo: macOS 13.5
cpuInfo: (8) arm64 Apple M1 Pro
chromeInfo: 116.0.5845.179
edgeInfo: 116.0.1938.69
firefoxInfo: Not Found
safariInfo: 16.6
helpers: {
"Playwright": {
"url": "https://github.com",
"show": false,
"browser": "chromium",
"waitForNavigation": "load",
"waitForTimeout": 30000,
"trace": false,
"keepTraceForPassedTests": true
},
"CDPHelper": {
"require": "./helpers/CDPHelper.ts"
},
"OpenAI": {
"chunkSize": 8000
},
"ExpectHelper": {
"require": "codeceptjs-expect"
},
"REST": {
"endpoint": "https://reqres.in",
"timeout": 20000
},
"AllureHelper": {
"require": "./helpers/AllureHelper.ts"
}
}
plugins: {
"screenshotOnFail": {
"enabled": true
},
"tryTo": {
"enabled": true
},
"retryFailedStep": {
"enabled": true
},
"retryTo": {
"enabled": true
},
"eachElement": {
"enabled": true
},
"pauseOnFail": {}
}
***************************************
If you have questions ask them in our Slack: http://bit.ly/chat-codeceptjs
Or ask them on our discussion board: https://codecept.discourse.group/
Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues
***************************************
CodeceptJS v3.5.4 #StandWithUkraine
- some typings improvements (#3855 (opens new window)) - by nikzupancic (opens new window)
- support the puppeteer 21.1.1 (#3856 (opens new window)) - by KobeNguyenT (opens new window)
- fix: support secret value for some methods (#3837 (opens new window)) - by KobeNguyenT (opens new window)
await I.amOnPage('/form/field_values');
await I.dontSeeInField('checkbox[]', secret('not seen one'));
await I.seeInField('checkbox[]', secret('see test one'));
await I.dontSeeInField('checkbox[]', secret('not seen two'));
await I.seeInField('checkbox[]', secret('see test two'));
await I.dontSeeInField('checkbox[]', secret('not seen three'));
await I.seeInField('checkbox[]', secret('see test three'));
π©οΈ Several bugfixes and improvements for Codecept-UI
- Mask the secret value in UI
- Improve UX/UI
- PageObjects are now showing in UI
# 3.5.4
π Bug Fixes:
- [Playwright] When passing
userDataDir
, it throws error after test execution (#3814 (opens new window)) - by KobeNguyenT (opens new window) - [CodeceptJS-CLI] Improve command to generate types (#3788 (opens new window)) - by KobeNguyenT (opens new window)
- Heal plugin fix (#3820 (opens new window)) - by davert (opens new window)
- Fix for error in using
all
withrun-workers
(#3805 (opens new window)) - by KobeNguyenT (opens new window)
helpers: {
Playwright: {
url: 'https://github.com',
show: false,
browser: 'chromium',
waitForNavigation: 'load',
waitForTimeout: 30_000,
trace: true,
keepTraceForPassedTests: true
},
},
multiple: {
profile1: {
browsers: [
{
browser: "chromium",
}
]
},
},
- Highlight elements issues (#3779 (opens new window)) (#3778 (opens new window)) - by philkas (opens new window)
- Support
 
symbol inI.see
method (#3815 (opens new window)) - by KobeNguyenT (opens new window)
// HTML code uses instead of space
<div class="dJHe_" style="color: rgb(255, 255, 255);">My Text!</div>
I.see("My Text!") // this test would work with both and space
π Documentation
- Improve the configuration of electron testing when the app is build with electron-forge (#3802 (opens new window)) - by KobeNguyenT (opens new window)
const path = require("path");
exports.config = {
helpers: {
Playwright: {
browser: "electron",
electron: {
executablePath: require("electron"),
args: [path.join(__dirname, ".webpack/main/index.js")],
},
},
},
// rest of config
}
π©οΈ Features
# [Playwright] new features and improvements
- Parse the response in recording network steps (#3771 (opens new window)) - by KobeNguyenT (opens new window)
const traffics = await I.grabRecordedNetworkTraffics();
expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
expect(traffics[0].response.status).to.equal(200);
expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
expect(traffics[1].url).to.equal('https://reqres.in/api/comments/1');
expect(traffics[1].response.status).to.equal(200);
expect(traffics[1].response.body).to.contain({ name: 'this was another mocked' });
- Grab metrics (#3809 (opens new window)) - by KobeNguyenT (opens new window)
const metrics = await I.grabMetrics();
// returned metrics
[
{ name: 'Timestamp', value: 1584904.203473 },
{ name: 'AudioHandlers', value: 0 },
{ name: 'AudioWorkletProcessors', value: 0 },
{ name: 'Documents', value: 22 },
{ name: 'Frames', value: 10 },
{ name: 'JSEventListeners', value: 366 },
{ name: 'LayoutObjects', value: 1240 },
{ name: 'MediaKeySessions', value: 0 },
{ name: 'MediaKeys', value: 0 },
{ name: 'Nodes', value: 4505 },
{ name: 'Resources', value: 141 },
{ name: 'ContextLifecycleStateObservers', value: 34 },
{ name: 'V8PerContextDatas', value: 4 },
{ name: 'WorkerGlobalScopes', value: 0 },
{ name: 'UACSSResources', value: 0 },
{ name: 'RTCPeerConnections', value: 0 },
{ name: 'ResourceFetchers', value: 22 },
{ name: 'AdSubframes', value: 0 },
{ name: 'DetachedScriptStates', value: 2 },
{ name: 'ArrayBufferContents', value: 1 },
{ name: 'LayoutCount', value: 0 },
{ name: 'RecalcStyleCount', value: 0 },
{ name: 'LayoutDuration', value: 0 },
{ name: 'RecalcStyleDuration', value: 0 },
{ name: 'DevToolsCommandDuration', value: 0.000013 },
{ name: 'ScriptDuration', value: 0 },
{ name: 'V8CompileDuration', value: 0 },
{ name: 'TaskDuration', value: 0.000014 },
{ name: 'TaskOtherDuration', value: 0.000001 },
{ name: 'ThreadTime', value: 0.000046 },
{ name: 'ProcessTime', value: 0.616852 },
{ name: 'JSHeapUsedSize', value: 19004908 },
{ name: 'JSHeapTotalSize', value: 26820608 },
{ name: 'FirstMeaningfulPaint', value: 0 },
{ name: 'DomContentLoaded', value: 1584903.690491 },
{ name: 'NavigationStart', value: 1584902.841845 }
]
- Grab WebSocket (WS) messages (#3789 (opens new window)) - by KobeNguyenT (opens new window)
flushWebSocketMessages
grabWebSocketMessages
startRecordingWebSocketMessages
stopRecordingWebSocketMessages
await I.startRecordingWebSocketMessages();
I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
I.flushNetworkTraffics();
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.equal(0);
await I.startRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.greaterThan(0);
await I.startRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const wsMessages = I.grabWebSocketMessages();
await I.stopRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const afterWsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.equal(afterWsMessages.length);
- Move from
ElementHandle
toLocator
. This change is quite major, but it happened under hood, so should not affect your code. (#3738 (opens new window)) - by KobeNguyenT (opens new window)
# 3.5.3
π©οΈ Features
- [Playwright] Added commands to check network traffic #3748 (opens new window) - by ngraf (opens new window) KobeNguyenT (opens new window)
startRecordingTraffic
grabRecordedNetworkTraffics
blockTraffic
mockTraffic
flushNetworkTraffics
stopRecordingTraffic
seeTraffic
grabTrafficUrl
dontSeeTraffic
Examples:
// recording traffics and verify the traffic
await I.startRecordingTraffic();
I.amOnPage('https://codecept.io/');
await I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// block the traffic
I.blockTraffic('https://reqres.in/api/comments/*');
await I.amOnPage('/form/fetch_call');
await I.startRecordingTraffic();
await I.click('GET COMMENTS');
await I.see('Can not load data!');
// check the traffic with advanced params
I.amOnPage('https://openai.com/blog/chatgpt');
await I.startRecordingTraffic();
await I.seeTraffic({
name: 'sentry event',
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
parameters: {
width: '1919',
height: '1138',
},
});
π Bugfix
- [retryStepPlugin] Fix retry step when using global retry #3768 (opens new window) - by KobeNguyenT (opens new window)
π Deprecated
- Nightmare and Protractor helpers have been deprecated
# 3.5.2
π Bug Fixes
- [Playwright] reverted
clearField
to previous implementation - [OpenAI] fixed running helper in pause mode. #3755 (opens new window) by KobeNguyenT (opens new window)
# 3.5.1
π©οΈ Features
- [Puppeteer][WebDriver][TestCafe] Added methods by KobeNguyenT (opens new window) in #3737 (opens new window)
blur
focus
- Improved BDD output to print steps without
I.
commands` by davertmik (opens new window) #3739 (opens new window) - Improved
codecept init
setup for Electron tests by KobeNguyenT (opens new window). See #3733 (opens new window)
π Bug Fixes
- Fixed serializing of custom errors making tests stuck. Fix #3739 (opens new window) by davertmik (opens new window).
π Documentation
- Fixed Playwright docs by Horsty80 (opens new window)
- Fixed ai docs by ngraf (opens new window)
- Various fixes by KobeNguyenT (opens new window)
# 3.5.0
π©οΈ Features
πͺ AI Powered Test Automation - use OpenAI as a copilot for test automation. #3713 (opens new window) By davertmik (opens new window)
- AI guide added
- added support for OpenAI in
pause()
- added
heal
plugin for self-healing tests - added
OpenAI
helper
[Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with
highlightElement
option set (#3672 (opens new window)) - by KobeNguyenT (opens new window)
[Playwright] Support for APIs in Playwright (#3665 (opens new window)) - by Egor Bodnar
clearField
replaced to use new Playwright APIblur
addedfocus
added
Added support for multiple browsers in
run-workers
(#3606 (opens new window)) by karanshah-browserstack (opens new window) :
Multiple browsers configured as profiles:
exports.config = {
helpers: {
WebDriver: {
url: 'http://localhost:3000',
}
},
multiple: {
profile1: {
browsers: [
{
browser: "firefox",
},
{
browser: "chrome",
}
]
},
And executed via run-workers
with all
argument
npx codeceptjs run-workers 2 all
- [Appium] Add Appium v2 support (#3622 (opens new window)) - by KobeNguyenT (opens new window)
- Improve
gpo
command to create page objects as modules or as classes (#3625 (opens new window)) - by KobeNguyenT (opens new window) - Added
emptyOutputFolder
config to clean up output before running tests (#3604 (opens new window)) - by KobeNguyenT (opens new window) - Add
secret()
function support toappend()
andtype()
(#3615 (opens new window)) - by anils92 (opens new window) - [Playwright] Add
bypassCSP
option to helper's config (#3641 (opens new window)) - by KobeNguyenT (opens new window) - Print number of tests for each suite in dryRun (#3620 (opens new window)) - by KobeNguyenT (opens new window)
π Bug Fixes
- Support
--grep
in dry-run command (#3673 (opens new window)) - by KobeNguyenT (opens new window) - Fix typings improvements in playwright (#3650 (opens new window)) - by KobeNguyenT (opens new window)
- Fixed global retry #3667 (opens new window) by KobeNguyenT (opens new window)
- Fixed creating JavaScript test using "codeceptjs gt" (#3611 (opens new window)) - by Jaromir Obr
# 3.4.1
- Updated mocha to v 10.2. Fixes #3591 (opens new window)
- Fixes executing a faling Before hook. Resolves #3592 (opens new window)
# 3.4.0
- Updated to latest mocha and modern Cucumber
- Allure plugin moved to @codeceptjs/allure-legacy (opens new window) package. This happened because allure-commons package v1 was not updated and caused vulnarabilities. Fixes #3422 (opens new window). We don't plan to maintain allure v2 plugin so it's up to community to take this initiative. Current allure plugin will print a warning message without interfering the run, so it won't accidentally fail your builds.
- Added ability to retry Before (opens new window), BeforeSuite, After, AfterSuite hooks by davertmik (opens new window):
Feature('flaky Before & BeforeSuite', { retryBefore: 2, retryBeforeSuite: 3 })
- Flexible retries configuration (opens new window) introduced by davertmik (opens new window):
retry: [
{
// enable this config only for flaky tests
grep: '@flaky',
Before: 3 // retry Before 3 times
Scenario: 3 // retry Scenario 3 times
},
{
// retry less when running slow tests
grep: '@slow'
Scenario: 1
Before: 1
}, {
// retry all BeforeSuite 3 times
BeforeSuite: 3
}
]
- Flexible timeout configuration (opens new window) introduced by davertmik (opens new window):
timeout: [
10, // default timeout is 10secs
{ // but increase timeout for slow tests
grep: '@slow',
Feature: 50
},
]
- JsDoc: Removed promise from
I.say
. See #3535 (opens new window) by danielrentz (opens new window) - [Playwright]
handleDownloads
requires now a filename param. See #3511 (opens new window) by PeterNgTr (opens new window) - [WebDriver] Added support for v8, removed support for webdriverio v5 and lower. See #3578 (opens new window) by PeterNgTr (opens new window)
# 3.3.7
π©οΈ Features
- Promise-based typings for TypeScript definitions in #3465 (opens new window) by nlespiaucq (opens new window). If you use TypeScript or use linters check how it may be useful to you (opens new window).
- Translation improved to use custom vocabulary (opens new window).
- [Playwright] Added methods in #3398 (opens new window) by mirao (opens new window)
restartBrowser
- to restart a browser (with different config)_createContextPage
- to create a new browser context with a page from a helper
- Added Cucumber custom types for BDD in #3435 (opens new window) by Likstern (opens new window)
- Propose using JSONResponse helper when initializing project for API testing. #3455 (opens new window) by PeterNgTr (opens new window)
- When translation enabled, generate tests using localized aliases. By davertmik (opens new window)
- [Appium] Added
checkIfAppIsInstalled
in #3507 (opens new window) by PeterNgTr (opens new window)
π Bugfixes
- Fixed #3462 (opens new window)
TypeError: Cannot read properties of undefined (reading 'setStatus')
by dwentland24 (opens new window) in #3438 (opens new window) - Fixed creating steps file for TypeScript setup #3459 (opens new window) by PeterNgTr (opens new window)
- Fixed issue of after all event in
run-rerun
command after complete execution #3464 (opens new window) by jain-neeeraj (opens new window) - [Playwright][WebDriver][Appium] Do not change
waitForTimeout
value on validation. See #3478 (opens new window) by pmajewski24 (opens new window). Fixes #2589 (opens new window) - [Playwright][WebDriver][Protractor][Puppeteer][TestCafe] Fixes
Element "{null: undefined}" was not found
andelement ([object Object]) still not present
messages when using object locators. See #3501 (opens new window) and #3502 (opens new window) by pmajewski24 (opens new window) - [Playwright] Improved file names when downloading file in #3449 (opens new window) by PeterNgTr (opens new window). Fixes #3412 (opens new window) and #3409 (opens new window)
- Add default value to
profile
env variable. See #3443 (opens new window) by dwentland24 (opens new window). Resolves #3339 (opens new window) - [Playwright] Using system-native path separator when saving artifacts in #3460 (opens new window) by PeterNgTr (opens new window)
- [Playwright] Saving videos and traces from multiple sessions in #3505 (opens new window) by davertmik (opens new window)
- [Playwright] Fixed
amOnPage
to navigate toabout:blank
by zaxoavoki (opens new window) in #3470 (opens new window) Fixes #2311 (opens new window) - Various typing improvements by AWolf81 (opens new window) PeterNgTr (opens new window) mirao (opens new window)
π Documentation
- Updated Quickstart (opens new window) with detailed explanation of questions in init
- Added Translation guide
- Updated TypeScript (opens new window) guide for promise-based typings
- Reordered guides list on a website
# 3.3.6
run-rerun
(opens new window) command was re-introduced by dwentland24 (opens new window) in #3436 (opens new window). Use it to perform run multiple times and detect flaky tests- Enabled
retryFailedStep
by default in@codeceptjs/configure
v 0.10. See https://github.com/codeceptjs/configure/pull/26 - [Playwright] Fixed properties types "waitForNavigation" and "firefox" by mirao (opens new window) in #3401 (opens new window)
- [REST] Changed "endpoint" to optional by mirao (opens new window) in #3404 (opens new window)
- [REST] Use
secret
for form encoded string by PeterNgTr (opens new window):
const secretData = secret('name=john&password=123456');
const response = await I.sendPostRequest('/user', secretData);
- [Playwright]Fixed docs related to fixed properties types "waitForNavigation" and "firefox" by mirao (opens new window) in #3407 (opens new window)
- [Playwright]Fixed parameters of startActivity() by mirao (opens new window) in #3408 (opens new window)
- Move semver to prod dependencies by timja (opens new window) in #3413 (opens new window)
- check if browser is W3C instead of Android by mikk150 (opens new window) in #3414 (opens new window)
- Pass service configs with options and caps as array for browsers⦠by 07souravkunda (opens new window) in #3418 (opens new window)
- fix for type of "webdriver.port" by ngraf (opens new window) in #3421 (opens new window)
- fix for type of "webdriver.smartWait" by pmajewski24 (opens new window) in #3426 (opens new window)
- fix(datatable): mask secret text by PeterNgTr (opens new window) in #3432 (opens new window)
- fix(playwright) - video name and missing type by PeterNgTr (opens new window) in #3430 (opens new window)
- fix for expected type of "bootstrap", "teardown", "bootstrapAll" and "teardownAll" by ngraf (opens new window) in #3424 (opens new window)
- Improve generate pageobject
gpo
command to work with TypeScript by PeterNgTr (opens new window) in #3411 (opens new window) - Fixed dry-run to always return 0 code and exit
- Added minimal version notice for NodeJS >= 12
- fix(utils): remove . of test title to avoid confusion by PeterNgTr (opens new window) in #3431 (opens new window)
# 3.3.5
π©οΈ Features
- Added TypeScript types for CodeceptJS config.
Update codecept.conf.js
to get intellisense when writing config file:
/**@type {CodeceptJS.MainConfig}**/
exports.config = {
//...
}
- Added TS types for helpers config:
- Playwright
- Puppeteer
- WebDriver
- REST
- Added TypeScript option for installation via
codeceptjs init
to initialize new projects in TS (by PeterNgTr (opens new window) and davertmik (opens new window)) - Includes
node-ts
automatically when using TypeScript setup.
π Bugfixes
- [Puppeteer] Fixed support for Puppeteer > 14.4 by PeterNgTr (opens new window)
- Don't report files as existing when non-directory is in path by jonathanperret (opens new window). See #3374 (opens new window)
- Fixed TS type for
secret
function by PeterNgTr (opens new window) - Fixed wrong order for async MetaSteps by dwentland24 (opens new window). See #3393 (opens new window)
- Fixed same param substitution in BDD step. See #3385 (opens new window) by snehabhandge (opens new window)
π Documentation
- Updated configuration options (opens new window) to match TypeScript types
- Updated TypeScript documentation (opens new window) on simplifying TS installation
- Added codecept-tesults plugin documentation by ajeetd (opens new window)
# 3.3.4
- Added support for masking fields in objects via
secret
function:
I.sendPostRequest('/auth', secret({ name: 'jon', password: '123456' }, 'password'));
- Added a guide about using of
secret
function - [Appium] Use
touchClick
when interacting with elements in iOS. See #3317 (opens new window) by mikk150 (opens new window) - [Playwright] Added
cdpConnection
option to connect over CDP. See #3309 (opens new window) by Hmihaly (opens new window) - [customLocator plugin] Allowed to specify multiple attributes for custom locator. Thanks to aruiz-caritsqa (opens new window)
plugins: {
customLocator: {
enabled: true,
prefix: '$',
attribute: ['data-qa', 'data-test'],
}
}
- [retryTo plugin] Fixed #3147 (opens new window) using
pollInterval
option. See #3351 (opens new window) by cyonkee (opens new window) - [Playwright] Fixed grabbing of browser console messages and window resize in new tab. Thanks to mirao (opens new window)
- [REST] Added
prettyPrintJson
option to print JSON in nice way by PeterNgTr (opens new window) - [JSONResponse] Updated response validation to iterate over array items if response is array. Thanks to PeterNgTr (opens new window)
// response.data == [
// { user: { name: 'jon', email: '[email protected]' } },
// { user: { name: 'matt', email: '[email protected]' } },
//]
I.seeResponseContainsKeys(['user']);
I.seeResponseContainsJson({ user: { email: '[email protected]' } });
I.seeResponseContainsJson({ user: { email: '[email protected]' } });
I.dontSeeResponseContainsJson({ user: 2 });
# 3.3.3
- Fixed
DataCloneError: () => could not be cloned
when running data tests in run-workers - πΊπ¦ Added #StandWithUkraine notice to CLI
# 3.3.2
- [REST] Fixed override of headers/token in
haveRequestHeaders()
andamBearerAuthenticated()
. See #3304 (opens new window) by mirao (opens new window) - Reverted typings change introduced in #3245 (opens new window). More details on this (opens new window)
# 3.3.1
π©οΈ Features:
- Add option to avoid duplicate gherkin step definitions (#3257 (opens new window)) - raywiis (opens new window)
- Added
step.*
for run-workers #3272 (opens new window). Thanks to abhimanyupandian (opens new window) - Fixed loading tests for
codecept run
using glob patterns. By jayudey-wf (opens new window)
npx codeceptjs run test-dir/*"
- [Playwright] Possible breaking change. By default
timeout
is changed to 5000ms. The value set in 3.3.0 was too low. Please settimeout
explicitly to not depend on release values. - [Playwright] Added for color scheme option by PeterNgTr (opens new window)
helpers: {
Playwright : {
url: "http://localhost",
colorScheme: "dark",
}
}
π Bugfixes:
- [Playwright] Fixed
Cannot read property 'video' of undefined
- Fixed haveRequestHeaders() and amBearerAuthenticated() of REST helper (#3260 (opens new window)) - mirao (opens new window)
- Fixed: allure attachment fails if screenshot failed #3298 (opens new window) by ruudvanderweijde (opens new window)
- Fixed #3105 (opens new window) using autoLogin() plugin with TypeScript. Fix #3290 (opens new window) by PeterNgTr (opens new window)
- [Playwright] Added extra params for click and dragAndDrop to type definitions by mirao (opens new window)
π Documentation
- Improving the typings in many places
- Improving the return type of helpers for TS users (#3245 (opens new window)) - nlespiaucq (opens new window)
# 3.3.0
π©οΈ Features:
- API Testing introduced
- Introduced
JSONResponse
helper which connects to REST, GraphQL or Playwright helper - [REST] Added
amBearerAuthenticated
method - [REST] Added
haveRequestHeaders
method - Added dependency on
joi
andchai
- Introduced
- [Playwright] Added
timeout
option to set timeout (opens new window) for all Playwright actions. If an action fails, Playwright keeps retrying it for a time set by timeout. - [Playwright] Possible breaking change. By default
timeout
is set to 1000ms. Previous default was set by Playwright internally to 30s. This was causing contradiction to CodeceptJS retries, so triggered up to 3 retries for 30s of time. This timeout option was lowered so retryFailedStep plugin would not cause long delays. - [Playwright] Updated
restart
config option to include 3 restart strategies:- 'context' or false - restarts browser context (opens new window) but keeps running browser. Recommended by Playwright team to keep tests isolated.
- 'browser' or true - closes browser and opens it again between tests.
- 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with
keepCookies
andkeepBrowserState
options. This behavior was default prior CodeceptJS 3.1
- [Playwright] Extended methods to provide more options from engine. These methods were updated so additional options can be be passed as the last argument:
// use Playwright click options as 3rd argument
I.click('canvas', '.model', { position: { x: 20, y: 40 } })
// check option also has options
I.checkOption('Agree', '.signup', { position: { x: 5, y: 5 } })
eachElement
plugin introduced. It allows you to iterate over elements and perform some action on them using direct engines API
await eachElement('click all links in .list', '.list a', (el) => {
await el.click();
})
- [Playwright] Added support to
playwright-core
package ifplaywright
is not installed. See #3190 (opens new window), fixes #2663 (opens new window). - [Playwright] Added
makeApiRequest
action to perform API requests. Requires Playwright >= 1.18 - Added support to
codecept.config.js
for name consistency across other JS tools. See motivation at #3195 (opens new window) by JiLiZART (opens new window) - [ApiDataFactory] Added options arg to
have
method. See #3197 (opens new window) by JJlokidoki (opens new window) - Improved pt-br translations to include keywords: 'Funcionalidade', 'CenΓ‘rio', 'Antes', 'Depois', 'AntesDaSuite', 'DepoisDaSuite'. See #3206 (opens new window) by danilolutz (opens new window)
- [allure plugin] Introduced
addStep
method to add comments and attachments. See #3104 (opens new window) by EgorBodnar (opens new window)
π Bugfixes:
- Fixed #3212 (opens new window): using Regex flags for Cucumber steps. See #3214 (opens new window) by anils92 (opens new window)
π Documentation
- Added Testomat.io reporter
- Added api testing guides
- Added internal api guides
- [Appium] Fixed documentation for
performSwipe
- [Playwright] update docs for
usePlaywrightTo
method by dbudzins (opens new window)
# 3.2.3
- Documentation improvements by maojunxyz (opens new window)
- Guard mocha cli reporter from registering step logger multiple times #3180 (opens new window) by nikocanvacom (opens new window)
- [Playwright] Fixed "tracing.stop: tracing.stop: ENAMETOOLONG: name too long" by hatufacci (opens new window)
- Fixed #2889 (opens new window): return always the same error contract from simplifyTest. See #3168 (opens new window) by andremoah (opens new window)
# 3.2.2
- [Playwright] Reverted removal of retry on context errors. Fixes #3130 (opens new window)
- Timeout improvements by nikocanvacom (opens new window):
- Added priorites to timeouts
- Added
overrideStepLimits
to stepTimeout plugin (opens new window) to override steps timeouts set bylimitTime
. - Fixed step timeout not working due to override by NaN by test timeout #3126 (opens new window)
- [Appium] Fixed logging error when
manualStart
is true. See #3140 (opens new window) by nikocanvacom (opens new window)
# 3.2.1
β»οΈ This release fixes hanging of tests by reducing timeouts for automatic retries on failures.
- [retryFailedStep plugin] New Defaults: retries steps up to 3 times with factor of 1.5 (previously 5 with factor 2)
- [Playwright] - disabled retry on failed context actions (not needed anymore)
- [Puppeteer] - reduced retries on context failures to 3 times.
- [Playwright] Handling
crash
event to automatically close crashed pages.
# 3.2.0
π©οΈ Features:
Timeouts (opens new window) implemented
- global timeouts (via
timeout
config option).- Breaking change: timeout option expects timeout in seconds, not in milliseconds as it was previously.
- test timeouts (via
Scenario
andFeature
options)- Breaking change:
Feature().timeout()
andScenario().timeout()
calls has no effect and are deprecated
- Breaking change:
// set timeout for every test in suite to 10 secs
Feature('tests with timeout', { timeout: 10 });
// set timeout for this test to 20 secs
Scenario('a test with timeout', { timeout: 20 }, ({ I }) => {});
- step timeouts (See #3059 (opens new window) by nikocanvacom (opens new window))
// set step timeout to 5 secs
I.limitTime(5).click('Link');
stepTimeout
plugin introduced to automatically add timeouts for each step (#3059 (opens new window) by nikocanvacom (opens new window)).
retryTo plugin introduced to rerun a set of steps on failure:
// editing in text in iframe
// if iframe was not loaded - retry 5 times
await retryTo(() => {
I.switchTo('#editor frame');
I.fillField('textarea', 'value');
}, 5);
- [Playwright] added
locale
configuration - [WebDriver] upgraded to webdriverio v7
π Bugfixes:
- Fixed allure plugin "Unexpected endStep()" error in #3098 (opens new window) by abhimanyupandian (opens new window)
- [Puppeteer] always close remote browser on test end. See #3054 (opens new window) by mattonem (opens new window)
- stepbyStepReport Plugin: Disabled screenshots after test has failed. See #3119 (opens new window) by ioannisChalkias (opens new window)
# 3.1.3
π©οΈ Features:
- BDD Improvement. Added
DataTableArgument
class to work with table data structures.
const { DataTableArgument } = require('codeceptjs');
//...
Given('I have an employee card', (table) => {
const dataTableArgument = new DataTableArgument(table);
const hashes = dataTableArgument.hashes();
// hashes = [{ name: 'Harry', surname: 'Potter', position: 'Seeker' }];
const rows = dataTableArgument.rows();
// rows = [['Harry', 'Potter', Seeker]];
}
See updated BDD section (opens new window) for more API options. Thanks to EgorBodnar (opens new window)
- Support
cjs
file extensions for config file:codecept.conf.cjs
. See #3052 (opens new window) by kalvenschraut (opens new window) - API updates: Added
test.file
andsuite.file
properties totest
andsuite
objects to use in helpers and plugins.
π Bugfixes:
- [Playwright] Fixed resetting
test.artifacts
for failing tests. See #3033 (opens new window) by jancorvus (opens new window). Fixes #3032 (opens new window) - [Playwright] Apply
basicAuth
credentials to all opened browser contexts. See #3036 (opens new window) by nikocanvacom (opens new window). Fixes #3035 (opens new window) - [WebDriver] Updated
webdriverio
default version to^6.12.1
. See #3043 (opens new window) by sridhareaswaran (opens new window) - [Playwright]
I.haveRequestHeaders
affects all tabs. See #3049 (opens new window) by jancorvus (opens new window) - BDD: Fixed unhandled empty feature files. Fix #3046 (opens new window) by abhimanyupandian (opens new window)
- Fixed
RangeError: Invalid string length
inrecorder.js
when running huge amount of tests. - [Appium] Fixed definitions for
touchPerform
,hideDeviceKeyboard
,removeApp
by mirao (opens new window)
π Documentation:
- Added Testrail reporter Reports Docs (opens new window)
# 3.1.2
π©οΈ Features:
- Added
coverage
plugin to generate code coverage for Playwright & Puppeteer. By anirudh-modi (opens new window) - Added
subtitle
plugin to generate subtitles for videos recorded with Playwright. By anirudh-modi (opens new window) - Configuration:
config.tests
to accept array of file patterns. See #2994 (opens new window) by monsteramba (opens new window)
exports.config = {
tests: ['./*_test.js','./sampleTest.js'],
// ...
}
- Notification is shown for test files without
Feature()
. See #3011 (opens new window) by PeterNgTr (opens new window)
π Bugfixes:
- [Playwright] Fixed #2986 (opens new window) error is thrown when deleting a missing video. Fix by hatufacci (opens new window)
- Fixed false positive result when invalid function is called in a helper. See #2997 (opens new window) by abhimanyupandian (opens new window)
- [Appium] Removed full page mode for
saveScreenshot
. See #3002 (opens new window) by nlespiaucq (opens new window) - [Playwright] Fixed #3003 (opens new window) saving trace for a test with a long name. Fix by hatufacci (opens new window)
π± Other:
- Deprecated
puppeteerCoverage
plugin in favor ofcoverage
plugin.
# 3.1.1
- [Appium] Fixed #2759 (opens new window)
grabNumberOfVisibleElements
,grabAttributeFrom
,grabAttributeFromAll
to allow id locators.
# 3.1.0
- [Plawyright] Updated to Playwright 1.13
- [Playwright] Possible breaking change:
BrowserContext
is initialized before each test and closed after. This behavior matches recommendation from Playwright team to use different contexts for tests. - [Puppeteer] Updated to Puppeteer 10.2.
- [Protractor] Helper deprecated
π©οΈ Features:
- [Playwright] Added recording of video (opens new window) and traces (opens new window) by davertmik (opens new window)
- [Playwritght] Mocking requests (opens new window) implemented via
route
API of Playwright by davertmik (opens new window) - [Playwright] Added support for React locators (opens new window) in #2912 (opens new window) by AAAstorga (opens new window)
π Bugfixes:
- [Puppeteer] Fixed #2244 (opens new window)
els[0]._clickablePoint is not a function
by karunandrii (opens new window). - [Puppeteer] Fixed
fillField
to check for invisible elements. See #2916 (opens new window) by anne-open-xchange (opens new window) - [Playwright] Reset of dialog event listener before registration of new one. #2946 (opens new window) by nikocanvacom (opens new window)
- Fixed running Gherkin features with
run-multiple
using chunks. See #2900 (opens new window) by andrenoberto (opens new window) - Fixed #2937 (opens new window) broken typings for subfolders on Windows by jancorvus (opens new window)
- Fixed issue where cucumberJsonReporter not working with fakerTransform plugin. See #2942 (opens new window) by ilangv (opens new window)
- Fixed #2952 (opens new window) finished job with status code 0 when playwright cannot connect to remote wss url. By davertmik (opens new window)
# 3.0.7
π Documentation fixes:
- Remove broken link from
Nightmare helper
. See #2860 (opens new window) by Arhell (opens new window) - Fixed broken links in
playwright.md
. See #2848 (opens new window) by johnhoodjr (opens new window) - Fix mocha-multi config example. See #2881 (opens new window) by rimesc (opens new window)
- Fix small errors in email documentation file. See #2884 (opens new window) by mkrtchian (opens new window)
- Improve documentation for
Sharing Data Between Workers
section. See #2891 (opens new window) by ngraf (opens new window)
π©οΈ Features:
- [WebDriver] Shadow DOM Support for
Webdriver
. See #2741 (opens new window) by gkushang (opens new window) - [Release management] Introduce the versioning automatically, it follows the semantics versioning. See #2883 (opens new window) by PeterNgTr (opens new window)
- Adding opts into
Scenario.skip
that it would be useful for building reports. See #2867 (opens new window) by AlexKo4 (opens new window) - Added support for attaching screenshots to cucumberJsonReporter (opens new window) See #2888 (opens new window) by fijijavis (opens new window)
- Supported config file for
codeceptjs shell
command. See #2895 (opens new window) by PeterNgTr (opens new window):
npx codeceptjs shell -c foo.conf.js
Bug fixes:
- [GraphQL] Use a helper-specific instance of Axios to avoid contaminating global defaults. See #2868 (opens new window) by vanvoljg (opens new window)
- A default system color is used when passing non supported system color when using I.say(). See #2874 (opens new window) by PeterNgTr (opens new window)
- [Playwright] Avoid the timout due to calling the click on invisible elements. See #2875 (opens new window) by cbayer97
# 3.0.6
- [Playwright] Added
electron
as a browser to config. See #2834 (opens new window) by cbayer97 (opens new window) - [Playwright] Implemented
launchPersistentContext
to be able to launch persistent remote browsers. See #2817 (opens new window) by brunoqueiros (opens new window). Fixes #2376 (opens new window). - Fixed printing logs and stack traces for
run-workers
. See #2857 (opens new window) by haveac1gar (opens new window). Fixes #2621 (opens new window), #2852 (opens new window) - Emit custom messages from worker to the main thread. See #2824 (opens new window) by jccguimaraes (opens new window)
- Improved workers processes output. See #2804 (opens new window) by drfiresign (opens new window)
- BDD. Added ability to use an array of feature files inside config in
gherkin.features
. See #2814 (opens new window) by jbergeronjr (opens new window)
"features": [
"./features/*.feature",
"./features/api_features/*.feature"
],
- Added
getQueueId
to reporter to rerun a specific promise. See #2837 (opens new window) by jonatask (opens new window) - Added
fakerTransform
plugin to use faker data in Gherkin scenarios. See #2854 (opens new window) by adrielcodeco (opens new window)
Scenario Outline: ...
Given ...
When ...
Then ...
Examples:
| productName | customer | email | anythingMore |
| {{commerce.product}} | Dr. {{name.findName}} | {{internet.email}} | staticData |
- [REST] Use class instance of axios, not the global instance, to avoid contaminating global configuration. #2846 (opens new window) by vanvoljg (opens new window)
- [Appium] Added
tunnelIdentifier
config option to provide tunnel for SauceLabs. See #2832 (opens new window) by gurjeetbains (opens new window)
# 3.0.5
Features:
- Official Docker image for CodeceptJS v3 (opens new window). New Docker image is based on official Playwright image and supports Playwright, Puppeteer, WebDriver engines. Thanks VikentyShevyrin (opens new window)
- Better support for Typescript
codecept.conf.ts
configuration files. See #2750 (opens new window) by elaichenkov (opens new window) - Propagate more events for custom parallel script. See #2796 (opens new window) by jccguimaraes (opens new window)
- [mocha-junit-reporter] Now supports attachments, see documentation for details. See #2675 (opens new window) by Shard (opens new window)
- CustomLocators interface for TypeScript to extend from LocatorOrString. See #2798 (opens new window) by danielrentz (opens new window)
- [REST] Mask sensitive data from log messages.
I.sendPatchRequest('/api/users.json', secret({ "email": "[email protected]" }));
See #2786 (opens new window) by PeterNgTr (opens new window)
Bug fixes:
- Fixed reporting of nested steps with PageObjects and BDD scenarios. See #2800 (opens new window) by davertmik (opens new window). Fixes #2720 (opens new window) #2682 (opens new window)
- Fixed issue with
codeceptjs shell
which was broken since 3.0.0. See #2743 (opens new window) by stedman (opens new window) - [Gherkin] Fixed issue suppressed or hidden errors in tests. See #2745 (opens new window) by ktryniszewski-mdsol (opens new window)
- [Playwright] fix grabCssPropertyFromAll serialization by using property names. See #2757 (opens new window) by elaichenkov (opens new window)
- [Allure] fix report for multi sessions. See #2771 (opens new window) by cbayer97 (opens new window)
- [WebDriver] Fix locator object debug log messages in smart wait. See 2748 by elaichenkov (opens new window)
Documentation fixes:
- Fixed some broken examples. See #2756 (opens new window) by danielrentz (opens new window)
- Fixed Typescript typings. See #2747 (opens new window), #2758 (opens new window) and #2769 (opens new window) by elaichenkov (opens new window)
- Added missing type for xFeature. See #2754 (opens new window) by PeterNgTr (opens new window)
- Fixed code example in Page Object documentation. See #2793 (opens new window) by mkrtchian (opens new window)
Library updates:
- Updated Axios to 0.21.1. See by sseide (opens new window)
- Updated pollyjs (opens new window)/core pollyjs (opens new window)/adapter-puppeteer. See #2760 (opens new window) by Anikethana (opens new window)
# 3.0.4
- Hotfix Fixed
init
script by addingcross-spawn
package. By vipulgupta2048 (opens new window) - Fixed handling error during initialization of
run-multiple
. See #2730 (opens new window) by wagoid (opens new window)
# 3.0.3
- Playwright 1.7 support
- [Playwright] Fixed handling null context in click. See #2667 (opens new window) by matthewjf (opens new window)
- [Playwright] Fixed
Cannot read property '$$' of null
when locating elements. See #2713 (opens new window) by matthewjf (opens new window) - Command
npx codeceptjs init
improved- auto-installing required packages
- better error messages
- fixed generating type definitions
- Data Driven Tests improvements: instead of having one skipped test for data driven scenarios when using xData you get a skipped test for each entry in the data table. See #2698 (opens new window) by Georgegriff (opens new window)
- [Puppeteer] Fixed that
waitForFunction
was not working with number values. See #2703 (opens new window) by MumblesNZ (opens new window) - Enabled autocompletion for custom helpers. #2695 (opens new window) by PeterNgTr (opens new window)
- Emit test.after on workers. Fix #2693 (opens new window) by jccguimaraes (opens new window)
- TypeScript: Allow .ts config files. See #2708 (opens new window) by elukoyanov (opens new window)
- Fixed definitions generation errors by elukoyanov (opens new window). See #2707 (opens new window) and #2718 (opens new window)
- Fixed handing error in _after function; for example, browser is closed during test and tests executions is stopped, but error was not logged. See #2715 (opens new window) by elukoyanov (opens new window)
- Emit hook.failed in workers. Fix #2723 (opens new window) by jccguimaraes (opens new window)
- [wdio plugin] Added
seleniumArgs
andseleniumInstallArgs
config options for plugin. See #2687 (opens new window) by andrerleao (opens new window) - [allure plugin] Added
addParameter
method in #2717 (opens new window) by jancorvus (opens new window). Fixes #2716 (opens new window) - Added mocha-based
--reporter-options
and--reporter <name>
commands torun-workers
command by in #2691 (opens new window) Ameterezu (opens new window) - Fixed infinite loop for junit reports. See #2691 (opens new window) Ameterezu (opens new window)
- Added status, start/end time, and match line for BDD steps. See #2678 (opens new window) by ktryniszewski-mdsol (opens new window)
- [stepByStepReport plugin] Fixed "helper.saveScreenshot is not a function". Fix #2688 (opens new window) by andrerleao (opens new window)
# 3.0.2
- [Playwright] Fix connection close with remote browser. See #2629 (opens new window) by dipiash (opens new window)
- [REST] set maxUploadFileSize when performing api calls. See #2611 (opens new window) by PeterNgTr (opens new window)
- Duplicate Scenario names (combined with Feature name) are now detected via a warning message.
Duplicate test names can cause
codeceptjs run-workers
to not function. See #2656 (opens new window) by Georgegriff (opens new window) - Documentation fixes
Bug Fixes:
- --suites flag now should function correctly for
codeceptjs run-workers
. See #2655 (opens new window) by Georgegriff (opens new window) - [autoLogin plugin] Login methods should now function as expected with
codeceptjs run-workers
. See #2658 (opens new window) by Georgegriff (opens new window), resolves #2620 (opens new window)
# 3.0.1
β¨οΈ Hot fix:
- Lock the mocha version to avoid the errors. See #2624 (opens new window) by PeterNgTr
π Bug Fix:
Fixed error handling in Scenario.js. See #2607 (opens new window) by haveac1gar
Changing type definition in order to allow the use of functions with any number of any arguments. See #2616 (opens new window) by akoltun
Some updates/changes on documentations
# 3.0.0
π LEARN HOW TO UPGRADE TO CODECEPTJS 3 β‘ (opens new window)
- Playwright set to be a default engine.
- NodeJS 12+ required
- BREAKING CHANGE: Syntax for tests has changed.
// Previous
Scenario('title', (I, loginPage) => {});
// Current
Scenario('title', ({ I, loginPage }) => {});
- BREAKING Replaced bootstrap/teardown scripts to accept only functions or async functions. Async function with callback (with done parameter) should be replaced with async/await. See our upgrade guide (opens new window).
- TypeScript guide and boilerplate project (opens new window)
- tryTo and pauseOnFail plugins installed by default
- Introduced one-line installer:
npx create-codeceptjs .
Read changelog to learn more about version π
# 3.0.0-rc
- Moved Helper class into its own package (opens new window) to simplify publishing standalone helpers.
- Fixed typings for
I.say
andI.retry
by Vorobeyko (opens new window) - Updated documentation:
# 3.0.0-beta.4
π Bug Fix:
- PageObject was broken when using "this" inside a simple object.
- The typings for all WebDriver methods work correctly.
- The typings for "this.helper" and helper constructor work correctly, too.
𧀠Internal:
- Our TS Typings will be tested now! We strarted using dtslint (opens new window) to check all typings and all rules for linter. Example:
const psp = wd.grabPageScrollPosition() // $ExpectType Promise<PageScrollPosition>
psp.then(
result => {
result.x // $ExpectType number
result.y // $ExpectType number
}
)
- And last: Reducing package size from 3.3Mb to 2.0Mb
# 3.0.0-beta-3
- BREAKING Replaced bootstrap/teardown scripts to accept only functions or async functions. Async function with callback (with done parameter) should be replaced with async/await. See our upgrde guide (opens new window).
- Test artifacts introduced. Each test object has
artifacts
property, to keep attachment files. For instance, a screenshot of a failed test is attached to a test as artifact. - Improved output for test execution
- Changed colors for steps output, simplified
- Added stack trace for test failures
- Removed
Event emitted
from log in--verbose
mode - List artifacts of a failed tests
- Steps & metasteps refactored by Vorobeyko (opens new window). Logs to arguments passed to page objects:
// TEST:
MyPage.hasFiles('first arg', 'second arg');
// OUTPUT:
MyPage: hasFile "First arg", "Second arg"
I see file "codecept.js"
I see file "codecept.po.json"
- Introduced official TypeScript boilerplate (opens new window). Started by Vorobeyko (opens new window).
# 3.0.0-beta
- NodeJS 12+ required
- BREAKING CHANGE: Syntax for tests has changed.
// Previous
Scenario('title', (I, loginPage) => {});
// Current
Scenario('title', ({ I, loginPage }) => {});
BREAKING CHANGE: [WebDriver][Protractor][Puppeteer][Playwright][Nightmare]
grab*
functions unified:grab*From
=> returns single value from element or throws error when no matchng elements foundgrab*FromAll
=> returns array of values, or empty array when no matching elements
Public API for workers introduced by koushikmohan1996 (opens new window). Customize parallel execution (opens new window) with workers by building custom scripts.
[Playwright] Added
usePlaywrightTo
method to access Playwright API in tests directly:
I.usePlaywrightTo('do something special', async ({ page }) => {
// use page or browser objects here
});
- [Puppeteer] Introduced
usePuppeteerTo
method to access Puppeteer API:
I.usePuppeteerTo('do something special', async ({ page, browser }) => {
// use page or browser objects here
});
- [WebDriver] Introduced
useWebDriverTo
method to access webdriverio API:
I.useWebDriverTo('do something special', async ({ browser }) => {
// use browser object here
});
- [Protractor] Introduced
useProtractorTo
method to access protractor API tryTo
plugin introduced. Allows conditional action execution:
const isSeen = await tryTo(() => {
I.see('Some text');
});
// we are not sure if cookie bar is displayed, but if so - accept cookies
tryTo(() => I.click('Accept', '.cookies'));
- Possible breaking change In semantic locators
[
char indicates CSS selector.
# 2.6.11
- [Playwright] Playwright 1.4 compatibility
- [Playwright] Added
ignoreHTTPSErrors
config option (default: false). See #2566 (opens new window) by gurjeetbains - Added French translation by vimar (opens new window)
- [WebDriver] Updated
dragSlider
to work in WebDriver W3C protocol. Fixes #2557 (opens new window) by suniljaiswal01
# 2.6.10
- Fixed saving options for suite via
Feature('title', {key: value})
by Diokuz (opens new window). See #2553 (opens new window) and Docs (opens new window)
# 2.6.9
- [Puppeteer][Playwright] SessionStorage is now cleared in after hook. See #2524 (opens new window)
- When helper load failed the error stack is now logged by SkReD (opens new window). See #2541 (opens new window)
- Small documentation fixes.
# 2.6.8
- [WebDriver][Protractor][Playwright][Puppeteer][Nightmare]
saveElementScreenshot
method added to make screenshot of an element. By suniljaiswal01 (opens new window) - [Playwright][Puppeteer] Added
type
method to type a text using keyboard with an optional delay. - [WebDriver] Added optional
delay
argument totype
method to slow down typing. - [Puppeteer] Fixed
amOnPage
freeze whengetPageTimeout
is 0"; set 30 sec as default timeout by Vorobeyko (opens new window). - Fixed printing step with null argument in custom helper by sjana-aj (opens new window). See #2494 (opens new window)
- Fix missing screenshot on failure when REST helper is in use #2513 (opens new window) by PeterNgTr (opens new window)
- Improve error logging in the
screenshotOnFail
plugin #2512 (opens new window) by pablopaul (opens new window)
# 2.6.7
- Add REST helper into
standardActingHelpers
array #2474 (opens new window) by PeterNgTr (opens new window) - Add missing
--invert
option forrun-workers
command #2504 (opens new window) by pablopaul (opens new window) - [WebDriver] Introduce
forceRightClick
method #2485 (opens new window) bylsuniljaiswal01 - [Playwright] Fix
setCookie
method #2491 (opens new window) by bmbarker90 (opens new window) - [TypeScript] Update compilerOptions.target to es2017 #2483 (opens new window) by shanplourde (opens new window)
- [Mocha] Honor reporter configuration #2465 (opens new window) by trinhpham (opens new window)
# 2.6.6
- Puppeteer 4.0 support. Important: MockRequest helper won't work with Puppeter > 3.3
- Added
xFeature
andFeature.skip
to skip all tests in a suite. By Georgegriff (opens new window) - [Appium] Fixed #2428 (opens new window) Android native locator support by idxn (opens new window)
- [WebDriver] Fixed
waitNumberOfVisibleElements
to actually filter visible elements. By ilangv (opens new window) - [Puppeteer] Fixed handling error which is not an Error object. Fixes
cannot read property indexOf of undefined
error. Fix #2436 (opens new window) by Georgegriff (opens new window) - [Puppeteer] Print error on page crash by Georgegriff (opens new window)
# 2.6.5
- Added
test.skipped
event to run-workers, fixing allure reports with skipped tests in workers #2391 (opens new window). Fix #2387 (opens new window) by koushikmohan1996 (opens new window) - [Playwright] Fixed calling
waitFor*
methods with custom locators #2314 (opens new window). Fix #2389 (opens new window) by Georgegriff (opens new window)
# 2.6.4
- [Playwright] Playwright 1.0 support by Georgegriff (opens new window).
# 2.6.3
- [stepByStepReport plugin] Fixed when using plugin with BeforeSuite. Fixes #2337 (opens new window) by mirao (opens new window)
- [allure plugin] Fixed reporting of tests skipped by failure in before hook. Refer to #2349 (opens new window) & #2354 (opens new window). Fix by koushikmohan1996 (opens new window)
# 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 (opens new window)
- [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 (opens new window)
- [WebDriver] Fixed
waitForEnabled
fix for webdriver 6. Fix by dsharapkou (opens new window) - Workers: Fixed negative failure result if use scenario with the same names. Fix by Vorobeyko (opens new window)
- [MockRequest] Updated documentation to match new helper version
- Fixed: skipped tests are not reported if a suite failed in
before
. Refer #2349 (opens new window) & #2354 (opens new window). Fix by koushikmohan1996 (opens new window)
# 2.6.1
- [screenshotOnFail plugin] Fixed saving screenshot of active session.
- [screenshotOnFail plugin] Fix issue #2301 (opens new window) when having the flag
uniqueScreenshotNames
=true results inundefined
in screenshot file name by PeterNgTr (opens new window) - [WebDriver] Fixed
waitForElement
not applying the optional second argument to override the default timeout in webdriverio 6. Fix by Mooksc (opens new window) - [WebDriver] Updated
waitUntil
method which is used by all of the wait* functions. This updates thewaitForElement
by the same convention used to updatewaitForVisible
andwaitInUrl
to be compatible with both WebDriverIO v5 & v6. See #2313 (opens new window) by Mooksc (opens new window)
# 2.6.0
- [Playwright] Updated to Playwright 0.12 by Georgegriff (opens new window).
Upgrade playwright to ^0.12:
npm i playwright@^0.12 --save
Notable changes (opens new window):
- Fixed opening two browsers on start
executeScript
- passed function now accepts only one argument. Pass in objects or arrays if you need multtple arguments:
// 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
- deprecatedwaitForClickable
- deprecatedforceClick
- added- Added support for custom locators. See #2277 (opens new window)
- Introduced device emulation:
- globally via
emulate
config option - per session
- globally via
[WebDriver] Updated to webdriverio v6 by PeterNgTr (opens new window).
Read release notes (opens new window), 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 by gkushang (opens new window)
I.click({ shadow: ['my-app', 'recipe-hello', 'button'] });
- Fixed parallel execution of
run-workers
for Gherkin scenarios by koushikmohan1996 (opens new window) - [MockRequest] Updated and moved to standalone package (opens new window):
- 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 (opens new window) - Gherkin improvement: setting different tags per examples. See #2208 (opens new window) by acuper (opens new window)
- [TestCafe] Updated
click
to take first visible element. Fixes #2226 (opens new window) by theTainted (opens new window) - [Puppeteer][WebDriver] Updated
waitForClickable
method to check for element overlapping. See #2261 (opens new window) by PiQx (opens new window) - [Puppeteer] Dropped
puppeteer-firefox
support, as Puppeteer supports Firefox natively. - [REST] Rrespect Content-Type header. See #2262 (opens new window) by pmarshall-legacy (opens new window)
- [allure plugin] Fixes BeforeSuite failures in allure reports. See #2248 (opens new window) by Georgegriff (opens new window)
- [WebDriver][Puppeteer][Playwright] A screenshot of for an active session is saved in multi-session mode. See #2253 (opens new window) by ChexWarrior (opens new window)
- Fixed
--profile
option by pablopaul (opens new window). Profile value to be passed intorun-multiple
andrun-workers
:
npx codecept run-workers 2 --profile firefox
Value is available at process.env.profile
(previously process.profile
). See #2302 (opens new window). Fixes #1968 (opens new window) #1315 (opens new window)
- commentStep Plugin introduced. Allows to annotate logical parts of a test:
__`Given`;
I.amOnPage('/profile')
__`When`;
I.click('Logout');
__`Then`;
I.see('You are logged out');
# 2.5.0
- Experimental: Playwright helper introduced.
Playwright (opens new window) 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 (opens new window) by ian-bartholomew (opens new window)
- [Puppeteer] Fixed
waitForText
when there is nobody
element on page (redirect). See #2181 (opens new window) by Vorobeyko (opens new window) - [Selenoid plugin] Fixed overriding current capabilities by adding deepMerge. Fixes #2183 (opens new window) by koushikmohan1996 (opens new window)
- Added types for
Scenario.todo
by Vorobeyko (opens new window) - Added types for Mocha by Vorobeyko (opens new window). Fixed typing conflicts with Jest
- [FileSystem] Added methods by nitschSB (opens new window)
waitForFile
seeFileContentsEqualReferenceFile
- Added
--colors
option torun
andrun-multiple
so you force colored output in dockerized environment. See #2189 (opens new window) by mirao (opens new window) - [WebDriver] Added
type
command to enter value without focusing on a field. See #2198 (opens new window) by xMutaGenx (opens new window) - Fixed
codeceptjs gt
command to respect config pattern for tests. See #2200 (opens new window) and #2204 (opens new window) by matheo (opens new window)
# 2.4.3
- Hotfix for interactive pause
# 2.4.2
- Interactive pause improvements by koushikmohan1996 (opens new window)
- allows using in page objects and variables:
pause({ loginPage, a })
- enables custom commands inside pause with
=>
prefix:=> loginPage.open()
- allows using in page objects and variables:
- Selenoid plugin added by by koushikmohan1996 (opens new window)
- 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 (opens new window)
- Added translation ability to Scenario, Feature and other context methods by koushikmohan1996 (opens new window)
- π’ Please help us translate context methods to your language! See italian translation (opens new window) as an example and send patches to vocabularies (opens new window).
- allurePlugin: Added
say
comments to allure reports by PeterNgTr (opens new window). - Fixed no custom output folder created when executed with run-worker. Fix by PeterNgTr (opens new window)
- [Puppeteer] Fixed error description for context element not found. See #2065 (opens new window). Fix by PeterNgTr (opens new window)
- [WebDriver] Fixed
waitForClickable
to wait for exact number of seconds by mirao (opens new window). Resolves #2166 (opens new window) - Fixed setting
compilerOptions
injsconfig.json
file on init by PeterNgTr (opens new window) - [Filesystem] Added method by nitschSB (opens new window)
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 plugin for new setups.
- enabled @codeceptjs/configure 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. Sponsored by Paul Vincent Beigang and his book "Practical End 2 End Testing with CodeceptJS (opens new window)".
- Added
run-rerun
command to run tests multiple times to detect and fix flaky tests. By Ilrilan (opens new window) and Vorobeyko (opens new window). - Added
Scenario.todo()
to declare tests as pending. See #2100 (opens new window) by Vorobeyko (opens new window) - Added support for absolute path for
output
dir. See #2049 (opens new window) by elukoyanov (opens new window) - Fixed error in
npx codecept init
caused by callingconsole.print
. See #2071 (opens new window) by Atinux (opens new window). - [Filesystem] Methods added by aefluke (opens new window):
seeFileNameMatching
grabFileNames
- [Puppeteer] Fixed grabbing attributes with hyphen by Holorium (opens new window)
- [TestCafe] Fixed
grabAttributeFrom
method by elukoyanov (opens new window) - [MockRequest] Added support for Polly config options (opens new window) by ecrmnn (opens new window)
- [TestCafe] Fixes exiting with zero code on failure. Fixed #2090 (opens new window) with #2106 (opens new window) by koushikmohan1996 (opens new window)
- [WebDriver][Puppeteer] Added basicAuth support via config. Example:
basicAuth: {username: 'username', password: 'password'}
. See #1962 (opens new window) by PeterNgTr (opens new window) - [WebDriver][Appium] Added
scrollIntoView
by pablopaul (opens new window) - Fixed #2118 (opens new window): No error stack trace for syntax error by senthillkumar (opens new window)
- Added
parse()
method to data table inside Cucumber tests. Use it to obtain rows and hashes for test data. See #2082 (opens new window) by Sraime (opens new window)
# 2.3.6
- Create better Typescript definition file through JSDoc. By lemnis (opens new window)
run-workers
now can use glob pattern. By Ilrilan (opens new window)
// 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 (opens new window) - Fixed some typos in documantation. By pablopaul (opens new window) atomicpages (opens new window) EricTendian (opens new window)
- Added PULL_REQUEST template.
- [Puppeteer][WebDriver] Added
waitForClickable
for waiting clickable element on page. - [TestCafe] Added support for remote connection. By jvdieten (opens new window)
- [Puppeteer] Fixed
waitForText
XPath context now works correctly. By Heavik (opens new window) - [TestCafe] Fixed
clearField
clear field now awaits TestCafe's promise. By orihomie (opens new window) - [Puppeteer] Fixed fails when executing localStorage on services pages. See #2026 (opens new window)
- Fixed empty tags in test name. See #2038 (opens new window)
# 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 (opens new window). - [Puppeteer] Fixed switching to iframe without an ID by johnyb (opens new window). See #1974 (opens new window)
- Added
--profile
option torun-workers
by orihomie (opens new window) - Added a tag definition to
FeatureConfig
andScenarioConfig
by sseliverstov (opens new window)
# 2.3.3
- customLocator plugin introduced. Adds a locator strategy for special test attributes on elements.
// 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 (opens new window): 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
andpressKeyDown
to press and release modifier keys likeControl
orShift
. By martomo (opens new window). - [Puppeteer][WebDriver] Added
grabElementBoundingRect
by PeterNgTr (opens new window). - [Puppeteer] Fixed speed degradation introduced in #1306 (opens new window) with accessibility locators support. See #1953 (opens new window).
- Added
Config.addHook
to add a function that will update configuration on load. - Started
@codeceptjs/configure
(opens new window) package with a collection of common configuration patterns. - [TestCafe] port's management removed (left on TestCafe itself) by orihomie (opens new window). Fixes #1934 (opens new window).
- [REST] Headers are no more declared as singleton variable. Fixes #1959 (opens new window)
- Updated Docker image to include run tests in workers with
NUMBER_OF_WORKERS
env variable. By PeterNgTr (opens new window).
# 2.3.2
- [Puppeteer] Fixed Puppeteer 1.20 support by davertmik (opens new window)
- Fixed
run-workers
to run with complex configs. See #1887 (opens new window) by nitschSB (opens new window) - Added
--suites
option torun-workers
to split suites by workers (tests of the same suite goes to teh same worker). Thanks nitschSB (opens new window). - Added a guide on Email Testing (opens new window).
- [retryFailedStepPlugin] Improved to ignore wait* steps and others. Also added option to ignore this plugin per test bases. See updated documentation (opens new window). By davertmik (opens new window)
- Fixed using PageObjects as classes by Vorobeyko (opens new window). See #1896 (opens new window)
- [WebDriver] Fixed opening more than one tab. See #1875 (opens new window) by jplegoff (opens new window). Fixes #1874 (opens new window)
- Fixed #1891 (opens new window) when
I.retry()
affected retries of next steps. By davertmik (opens new window)
# 2.3.1
- [MockRequest] Polly helper was renamed to MockRequest.
- [MockRequest][WebDriver] Mocking requests (opens new window) is now available in WebDriver. Thanks radhey1851 (opens new window)
- [Puppeteer] Ensure configured user agent and/or window size is applied to all pages. See #1862 (opens new window) by martomo (opens new window)
- Improve handling of xpath locators with round brackets by nitschSB (opens new window). See #1870 (opens new window)
- Use WebDriver capabilities config in wdio plugin. #1869 (opens new window) by quekshuy (opens new window)
# 2.3.0
- Parallel testing by workers (opens new window) introduced by VikalpP (opens new window) and davertmik (opens new window). Use
run-workers
command as faster and simpler alternative torun-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 (opens new window).
- Learn how to use GraphQL helper (opens new window) to access GarphQL API
- And how to combine it with GraphQLDataFactory (opens new window) to generate and persist test data.
- Updated to use Mocha 6. See #1802 (opens new window) by elukoyanov (opens new window)
- Added
dry-run
command to print steps of test scenarios without running them. Fails to execute scenarios withgrab*
methods or custom code. See #1825 (opens new window) for more details.
npx codeceptjs dry-run
- [Appium] Optimization when clicking, searching for fields by accessibility id. See #1777 (opens new window) by gagandeepsingh26 (opens new window)
- [TestCafe] Fixed
switchTo
by KadoBOT (opens new window) - [WebDriver] Added geolocation actions by PeterNgTr (opens new window)
grabGeoLocation()
setGeoLocation()
- [Polly] Check typeof arguments for mock requests by VikalpP (opens new window). Fixes #1815 (opens new window)
- CLI improvements by jamesgeorge007 (opens new window)
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 (opens new window) - Fixed element position bug in locator builder. See #1829 (opens new window) by AnotherAnkor (opens new window)
- Various TypeScript typings updates by elukoyanov (opens new window) and Vorobeyko (opens new window)
- Added
event.step.comment
event for all comment steps likeI.say
or gherking steps.
# 2.2.1
- [WebDriver] A dedicated guide (opens new window) written.
- [TestCafe] A dedicated guide (opens new window) written.
- [Puppeteer] A chapter on mocking (opens new window) written
- [Puppeteer][Nightmare][TestCafe] Window mode is enabled by default on
codeceptjs init
. - [TestCafe] Actions implemented by hubidu (opens new window)
grabPageScrollPosition
scrollPageToTop
scrollPageToBottom
scrollTo
switchTo
- Intellisense improvements. Renamed
tsconfig.json
tojsconfig.json
on init. Fixed autocompletion for Visual Studio Code. - [Polly] Take configuration values from Puppeteer. Fix #1766 (opens new window) by VikalpP (opens new window)
- [Polly] Add preconditions to check for puppeteer page availability by VikalpP (opens new window). Fixes #1767 (opens new window)
- [WebDriver] Use filename for
uploadFile
by VikalpP (opens new window). See #1797 (opens new window) - [Puppeteer] Configure speed of input with
pressKeyDelay
option. By hubidu (opens new window) - Fixed recursive loading of support objects by davertmik (opens new window).
- Fixed support object definitions in steps.d.ts by johnyb (opens new window). Fixes #1795 (opens new window)
- Fixed
Data().Scenario().injectDependencies()
is not a function by andrerleao (opens new window) - Fixed crash when using xScenario & Scenario.skip with tag by VikalpP (opens new window). Fixes #1751 (opens new window)
- Dynamic configuration of helpers can be performed with async function. See #1786 (opens new window) by cviejo (opens new window)
- Added TS definitions for internal objects by Vorobeyko (opens new window)
- BDD improvements:
- Fix for snippets command with a .feature file that has special characters by asselin (opens new window)
- Fix
--path
option ongherkin:snippets
command by asselin (opens new window). See #1790 (opens new window) - Added
--feature
option togherkin:snippets
to enable creating snippets for a subset of .feature files. See #1803 (opens new window) by asselin (opens new window).
- Fixed: dynamic configs not reset after test. Fixes #1776 (opens new window) by cviejo (opens new window).
# 2.2.0
- EXPERIMENTAL TestCafe helper (opens new window) introduced. TestCafe allows to run cross-browser tests it its own very fast engine. Supports all browsers including mobile. Thanks to hubidu (opens new window) for implementation! Please test it and send us feedback.
- [Puppeteer] Mocking requests enabled by introducing Polly.js helper (opens new window). Thanks VikalpP (opens new window)
// use Polly & Puppeteer helpers
I.mockRequest('GET', '/api/users', 200);
I.mockRequest('POST', '/users', { user: { name: 'fake' }});
- EXPERIMENTAL [Puppeteer] Firefox support (opens new window) introduced by ngadiyak (opens new window), see #1740 (opens new window)
- [stepByStepReportPlugin] use md5 hash to generate reports into unique folder. Fix #1744 (opens new window) by chimurai (opens new window)
- Interactive pause improvements:
- print result of
grab
commands - print message for successful assertions
- print result of
run-multiple
(parallel execution) improvements:bootstrapAll
must be called before creating chunks. #1741 (opens new window) by Vorobeyko (opens new window)- Bugfix: If value in config has falsy value then multiple config does not overwrite original value. #1756 (opens new window) by LukoyanovE (opens new window)
- Fixed hooks broken in 2.1.5 by Vorobeyko (opens new window)
- Fix references to support objects when using Dependency Injection. Fix by johnyb (opens new window). See #1701 (opens new window)
- Fix dynamic config applied for multiple helpers by VikalpP (opens new window) #1743 (opens new window)
# 2.1.5
- EXPERIMENTAL Wix Detox support (opens new window) 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 (opens new window) - Fixed hanging error handler inside scenario. See #1721 (opens new window) by haily-lgc (opens new window).
- Fixed by Vorobeyko (opens new window): tests did not fail when an exception was raised in async bootstrap.
- [WebDriver] Added window control methods by emmonspired (opens new window)
grabAllWindowHandles
returns all window handlesgrabCurrentWindowHandle
returns current window handleswitchToWindow
switched to window by its handle
- [Appium] Fixed using
host
as configuration by trinhpham (opens new window) - Fixed
run-multiple
command whentests
config option is undefined (in Gherkin scenarios). By gkushang (opens new window). - German translation introduced by hubidu (opens new window)
# 2.1.4
- [WebDriver][Puppeteer][Protractor][Nightmare] A11y locator support introduced by Holorium (opens new window). 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 (opens new window) added.
- [Puppeteer] Deprecated
downloadFile
- [Puppeteer] Introduced
handleDownloads
replacingdownloadFile
- [puppeteerCoverage plugin] Fixed path already exists error by seta-tuha (opens new window).
- Fixed 'ERROR: ENAMETOOLONG' creating directory names in
run-multiple
with long config. By artvinn (opens new window) - [REST] Fixed url autocompletion combining base and relative paths by LukoyanovE (opens new window)
- [Nightmare][Protractor]
uncheckOption
method introduced by PeterNgTr (opens new window) - [autoLogin plugin] Enable to use without
await
by tsuemura (opens new window) - [Puppeteer] Fixed
UnhandledPromiseRejectionWarning: "Execution context was destroyed...
by adrielcodeco (opens new window) - [WebDriver] Keep browser window dimensions when starting a new session by spiroid (opens new window)
- Replace Ghekrin plceholders with values in files that combine a scenerio outline and table by medtoure18 (opens new window).
- Added Documentation to locate elements in React Native (opens new window) apps. By DimGun (opens new window).
- Adding optional
path
parameter tobdd:snippets
command to append snippets to a specific file. By cthorsen31 (opens new window). - Added optional
output
parameter todef
command by LukoyanovE (opens new window). - [Puppeteer] Added
grabDataFromPerformanceTiming
by PeterNgTr (opens new window). - axios updated to
0.19.0
by SteveShaffer (opens new window) - TypeScript defitions updated by LukoyanovE (opens new window). Added
secret
andinject
function.
# 2.1.3
- Fixed autoLogin plugin to inject
login
function - Fixed using
toString()
in DataTablewhen it is defined by tsuemura (opens new window)
# 2.1.2
- Fixed
inject
to load objects recursively. - Fixed TypeScript definitions for locators by LukoyanovE (opens new window)
- EXPERIMENTAL [WebDriver] ReactJS locators support with webdriverio v5.8+:
// 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
andsession
calls insideretryFailedStep
plugin. Fix by tsuemura (opens new window)
# 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:
// 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 (opens new window):
I.fillField('password', secret('123456'));
- wdioPlugin (opens new window) Added a plugin to support webdriverio services including selenium-standalone, sauce, browserstack, etc. Sponsored by GSasu (opens new window)
- [Appium] Fixed
swipe*
methods by PeterNgTr (opens new window) - BDD Gherkin Improvements:
- Implemented
run-multiple
for feature files. Sponsored by GSasu (opens new window) - Added
--features
and--tests
options torun-multiple
. Sponsored by GSasu (opens new window) - Implemented
Before
andAfter
hooks in step definitions (opens new window)
- Implemented
- Fixed running tests by absolute path. By batalov (opens new window).
- Enabled the adding screenshot to failed test for moch-junit-reporter by PeterNgTr (opens new window).
- [Puppeteer] Implemented
uncheckOption
and fixed behavior ofcheckOption
by aml2610 (opens new window) - [WebDriver] Fixed
seeTextEquals
on empty strings by PeterNgTr (opens new window) - [Puppeteer] Fixed launch with
browserWSEndpoint
config by ngadiyak (opens new window). - [Puppeteer] Fixed switching back to main window in multi-session mode by davertmik (opens new window).
- [autoLoginPlugin] Fixed using async functions for auto login by nitschSB (opens new window)
This release was partly sponsored by GSasu (opens new window). 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 (opens new window).
Use it with FileSystem
helper to test availability of a file:
const fileName = await I.downloadFile('a.file-link');
I.amInPath('output');
I.seeFile(fileName);
Actions
amInPath
andseeFile
are taken from FileSystem (opens new window) helper
- [Puppeteer] Fixed
autoLogin
plugin with Puppeteer by davertmik (opens new window) - [WebDriver]
seeInField
should throw error if element has no value attrubite. By PeterNgTr (opens new window) - [WebDriver] Fixed
seeTextEquals
passes for any string if element is empty by PeterNgTr (opens new window). - [WebDriver] Internal refctoring to use
el.isDisplayed
to match latest webdriverio implementation. Thanks to LukoyanovE (opens new window) - [allure plugin] Add ability enable screenshotDiff plugin (opens new window) by Vorobeyko (opens new window)
- [Appium] Fixed
locator.stringify
call by LukoyanovE (opens new window)
# 2.0.7
- [WebDriver][Protractor][Nightmare]
rightClick
method implemented (fixed) in a standard way. By davertmik (opens new window) - [WebDriver] Updated WebDriver API calls in helper. By PeterNgTr (opens new window)
- [stepByStepReportPlugin] Added
screenshotsForAllureReport
config options to automatically attach screenshots to allure reports. By PeterNgTr (opens new window) - [allurePlugin] Added
addLabel
method by Vorobeyko (opens new window) - Locator Builder: fixed
withChild
andwithDescendant
to match deep nested siblings by Vorobeyko (opens new window).
# 2.0.6
- Introduced Custom Locator Strategies (opens new window).
- Added Visual Testing Guide (opens new window) by puneet0191 (opens new window) and MitkoTschimev (opens new window).
- [Puppeteer]
puppeteerCoverage
(opens new window) plugin added to collect code coverage in JS. By dvillarama (opens new window) - Make override option in
run-multiple
to respect the generated overridden config by kinyat (opens new window) - Fixed deep merge for
container.append()
. Introducedlodash.merge()
. By Vorobeyko (opens new window) - 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 (opens new window) - [WebDriver][Puppeteer][Nightmare][Protractor] Fixed url protocol detection for non-http urls by LukoyanovE (opens new window)
- [WebDriver] Enabled compatibility with
stepByStepReport
by tsuemura (opens new window) - [WebDriver] Fixed
grabHTMLFrom
to return innerHTML value by Holorium (opens new window). Fixed compatibility with WebDriverIO. - [WebDriver]
grabHTMLFrom
to return one HTML vlaue for one element matched, array if multiple elements found by davertmik (opens new window). - [Nightmare] Added
grabHTMLFrom
by davertmik (opens new window) - Fixed
bootstrapAll
andteardownAll
launch with path as argument by LukoyanovE (opens new window) - Fixed
bootstrapAll
andteardownAll
calls from exported object by LukoyanovE (opens new window) - [WebDriver] Added possibility to define conditional checks interval for
waitUntil
by LukoyanovE (opens new window) - Fixed storing current data in data driven tests in a test object. By Vorobeyko (opens new window)
- [WebDriver] Fixed
hostname
config option overwrite when setting a cloud provider. By LukoyanovE (opens new window) - [WebDriver]
dragSlider
method implemented by DavertMik (opens new window) - [WebDrover] Fixed
scrollTo
to use new webdriverio API by PeterNgTr (opens new window) - Added Japanese translation file by tsemura (opens new window)
- Added
Locator.withDescendant()
method to find an element which contains a descendant (child, grandchild) by Vorobeyko (opens new window) - [WebDriver] Fixed configuring capabilities for Selenoid and IE by Vorobeyko (opens new window)
- [WebDriver] Restore original window size when taking full size screenshot by tsuemura (opens new window)
- Enabled
throws()
,fails()
,retry()
,timeout()
,config()
functions for data driven tests. By jjm409 (opens new window)
# 2.0.5
[Broken Release]
# 2.0.4
- [WebDriver][Protractor][Nightmare][Puppeteer]
grabAttributeFrom
returns an array when multiple elements matched. By PeterNgTr (opens new window) - [autoLogin plugin] Fixed merging users config by nealfennimore (opens new window)
- [autoDelay plugin] Added WebDriver to list of supported helpers by mattin4d (opens new window)
- [Appium] Fixed using locators in
waitForElement
,waitForVisible
,waitForInvisible
. By eduardofinotti (opens new window) - [allure plugin] Add tags to allure reports by Vorobeyko (opens new window)
- [allure plugin] Add skipped tests to allure reports by Vorobeyko (opens new window)
- Fixed
Logged Test name | [object Object]
when used Data().Scenario(). By Vorobeyko (opens new window) - Fixed Data().only.Scenario() to run for all datasets. By Vorobeyko (opens new window)
- [WebDriver]
attachFile
to work with hidden elements. Fixed in #1460 (opens new window) by tsuemura (opens new window)
# 2.0.3
- autoLogin plugin (opens new window) 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 inretryFailedStep
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 (opens new window)
- [WebDriver] Updated to webdriverio 5.2.2 by martomo (opens new window)
- Interactive pause improvements by davertmik (opens new window)
- 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 (opens new window)
- added
- [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:
- Install latest webdriverio
npm install webdriverio@5 --save
- Replace
WebDriverIO
=>WebDriver
helper name in config. - Read webdriverio changelog (opens new window). If you were using webdriver API in your helpers, upgrade accordingly.
- 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 withaxios
.Upgrade plan:
- Refer to axios API (opens new window).
- 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 testsUsing
codecept.conf.js
as default configuration formatFixed "enametoolong" error when saving screenshots for data driven tests by PeterNgTr (opens new window)
Updated NodeJS to 10 in Docker image
[Pupeteer] Add support to use WSEndpoint. Allows to execute tests remotely. [See #1350 (opens new window)] by gabrielcaires (opens new window) (https://github.com/codeceptjs/CodeceptJS/pull/1350)
In interactive shell [Enter] goes to next step. Improvement by PeterNgTr (opens new window).
I.say
accepts second parameter as color to print colorful comments. Improvement by PeterNgTr (opens new window).
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 (opens new window)
- Fixed allure reports for hooks by PeterNgTr (opens new window)
# 1.4.6
- [Puppeteer]
dragSlider
action added by PeterNgTr (opens new window) - [Puppeteer] Fixed opening browser in shell mode by allenhwkim (opens new window)
- [Puppeteer] Fixed making screenshot on additional sessions by PeterNgTr (opens new window). Fixes #1266 (opens new window)
- Added
--invert
option torun-multiple
command by LukoyanovE (opens new window) - Fixed steps in Allure reports by PeterNgTr (opens new window)
- Add option
output
to customize output directory in stepByStepReport plugin (opens new window). By fpsthirty (opens new window) - Changed type definition of PageObjects to get auto completion by rhicu (opens new window)
- Fixed steps output for async/arrow functions in CLI by LukoyanovE (opens new window). See #1329 (opens new window)
# 1.4.5
- Add require param to main config. Allows to require Node modules before executing tests. By LukoyanovE (opens new window). For example:
- Use
ts-node/register
to register TypeScript parser - Use
should
to register should-style assertions
- Use
"require": ["ts-node/register", "should"]
- [WebDriverIO] Fix timeouts definition to be compatible with W3C drivers. By LukoyanovE (opens new window)
- Fixed: exception in Before block w/ Mocha causes test not to report failure. See #1292 (opens new window) by PeterNgTr (opens new window)
- Command
run-parallel
now accepts--override
flag. Thanks to ClemCB (opens new window) - Fixed Allure report with Before/BeforeSuite/After/AfterSuite steps. By PeterNgTr (opens new window)
- Added
RUN_MULTIPLE
env variable to Docker config (opens new window). Allows to run tests in parallel inside a container. Thanks to PeterNgTr (opens new window) - [Mochawesome] Fixed showing screenshot on failure. Fix by PeterNgTr (opens new window)
- Fixed running tests filtering by tag names defined via
Scenario.tag()
# 1.4.4
- autoDelay plugin (opens new window) added. Adds tiny delay before and after an action so the page could react to actions performed.
- [Puppeteer] improvements by luismanuel001 (opens new window)
click
no longer waits for navigationclickLink
method added. Performs a click and waits for navigation.
- Bootstrap scripts to be started only for
run
command and ignored onlist
,def
, etc. Fix by LukoyanovE (opens new window)
# 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:
Scenario('update user profile', () => {
// test goes here
}).tag('@slow');
- Fixed attaching Allure screenshot on exception. Fix by DevinWatson (opens new window)
- Improved type definitions for custom steps. By Akxe (opens new window)
- Fixed setting
multiple.parallel.chunks
as environment variable in config. See #1238 (opens new window) by ngadiyak (opens new window)
# 1.4.2
- Fixed setting config for plugins (inclunding setting
outputDir
for allure) by jplegoff (opens new window)
# 1.4.1
- Added
plugins
option torun-multiple
- Minor output fixes
- Added Type Definition for Helper class by Akxe (opens new window)
- Fixed extracing devault extension in generators by Akxe (opens new window)
# 1.4.0
- Allure Reporter Integration (opens new window). Full inegration with Allure Server. Get nicely looking UI for tests,including steps, nested steps, and screenshots. Thanks Natarajan Krishnamurthy krish (opens new window) for sponsoring this feature.
- Plugins API introduced (opens new window). Create custom plugins for CodeceptJS by hooking into event dispatcher, and using promise recorder.
- Official CodeceptJS plugins (opens new window) 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 (opens new window) - Added
override
option torun-multiple
command by svarlet (opens new window)
# 1.3.3
- Added
initGlobals()
function to API of custom runner (opens new window).
# 1.3.2
- Interactve Shell improvements for
pause()
- Added
next
command for step-by-step debug when usingpause()
. - Use
After(pause);
in a to start interactive console after last step.
- Added
- [Puppeteer] Updated to Puppeteer 1.6.0
- Added
waitForRequest
to wait for network request. - Added
waitForResponse
to wait for network response.
- Added
- Improved TypeScript definitions to support custom steps and page objects. By xt1 (opens new window)
- Fixed XPath detection to accept XPath which starts with
./
by BenoitZugmeyer (opens new window)
# 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 (opens new window).
- [WebDriverIO] Added a list of all special keys to WebDriverIO helper by davertmik (opens new window) and xt1 (opens new window).
- Improved TypeScript definitions generator by xt1 (opens new window)
# 1.3.0
- Cucumber-style BDD. Introduced Gherkin support (opens new window). Thanks to David Vins (opens new window) and Omedym (opens new window) for sponsoring this feature.
Basic feature file:
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:
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
.
- to see high-level steps only run tests with
- PageObjects simplified to remove
_init()
extra method. Try updated generators and see updated guide (opens new window). - [Puppeteer] Multiple sessions (opens new window) 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 (opens new window)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 (opens new window) - [WebDriverIO][Protractor][Puppeteer][Nightmare]
waitForFunction
added. Waits for client-side JavaScript function to return true by GREENpoint (opens new window). - [Puppeteer]
waitUntil
deprecated in favor ofwaitForFunction
. - Added
filter
function to DataTable. - Send non-nested array of files to custom parallel execution chunking by mikecbrant (opens new window).
- Fixed invalid output directory path for run-multiple by mikecbrant (opens new window).
- [WebDriverIO]
waitUntil
timeout accepts time in seconds (as all other wait* functions). Fix by truesrc (opens new window). - [Nightmare] Fixed
grabNumberOfVisibleElements
to work similarly toseeElement
. Thx to stefanschenk (opens new window) and Jinbo Jinboson. - [Protractor] Fixed alert handling error with message 'no such alert' by truesrc (opens new window).
# 1.2.1
- Fixed running
I.retry()
on multiple steps. - Fixed parallel execution wih chunks.
- [Puppeteer] Fixed
grabNumberOfVisibleElements
to return0
instead of throwing error if no elements are found.
# 1.2.0
- [WebDriverIO][Protractor]Multiple Sessions (opens new window). Run several browser sessions in one test. Introduced
session
command, which opens additional browser window and closes it after a test.
Scenario('run in different browsers', (I) => {
I.amOnPage('/hello');
I.see('Hello!');
session('john', () => {
I.amOnPage('/bye');
I.dontSee(