codeceptjs
Advanced tools
Changelog
2.6.2
forceClick
method to emulate click event instead of using native events.handleDownloads
method to download file. Please note, this method has slightly different API than the same one in Puppeteer.waitForEnabled
fix for webdriver 6. Fix by @dsharapkoubefore
. Refer #2349 & #2354. Fix by @koushikmohan1996Changelog
2.6.1
uniqueScreenshotNames
=true results in undefined
in screenshot file name by @PeterNgTrwaitForElement
not applying the optional second argument to override the default timeout in webdriverio 6. Fix by @MookscwaitUntil
method which is used by all of the wait* functions. This updates the waitForElement
by the same convention used to update waitForVisible
and waitInUrl
to be compatible with both WebDriverIO v5 & v6. See #2313 by @MookscChangelog
2.6.0
Upgrade playwright to ^0.12:
npm i playwright@^0.12 --save
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
- addedemulate
config option[WebDriver] Updated to webdriverio v6 by @PeterNgTr.
Read release notes, 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
I.click({ shadow: ['my-app', 'recipe-hello', 'button'] });
run-workers
for Gherkin scenarios by @koushikmohan1996mockServer
method to use flexible PollyJS API to define mocksscreenshotOnFail
plugin by @amonkcclick
to take first visible element. Fixes #2226 by @theTaintedwaitForClickable
method to check for element overlapping. See #2261 by @PiQxpuppeteer-firefox
support, as Puppeteer supports Firefox natively.--profile
option by @pablopaul. Profile value to be passed into run-multiple
and run-workers
:npx codecept run-workers 2 --profile firefox
Value is available at process.env.profile
(previously process.profile
). See #2302. Fixes #1968 #1315
__`Given`;
I.amOnPage('/profile')
__`When`;
I.click('Logout');
__`Then`;
I.see('You are logged out');
Changelog
2.5.0
Playwright is an alternative to Puppeteer which works very similarly to it but adds cross-browser support with Firefox and Webkit. Until v1.0 Playwright API is not stable but we introduce it to CodeceptJS so you could try it.
waitForText
when there is no body
element on page (redirect). See #2181 by @VorobeykoScenario.todo
by @VorobeykowaitForFile
seeFileContentsEqualReferenceFile
--colors
option to run
and run-multiple
so you force colored output in dockerized environment. See #2189 by @miraotype
command to enter value without focusing on a field. See #2198 by @xMutaGenxcodeceptjs gt
command to respect config pattern for tests. See #2200 and #2204 by @matheoChangelog
2.4.2
pause({ loginPage, a })
=>
prefix: => loginPage.open()
say
comments to allure reports by @PeterNgTr.waitForClickable
to wait for exact number of seconds by @mirao. Resolves #2166compilerOptions
in jsconfig.json
file on init by @PeterNgTrseeFileContentsEqualReferenceFile
waitForFile
Changelog
2.4.0
npx codecept init
:
run-rerun
command to run tests multiple times to detect and fix flaky tests. By @Ilrilan and @Vorobeyko.Scenario.todo()
to declare tests as pending. See #2100 by @Vorobeykooutput
dir. See #2049 by @elukoyanovnpx codecept init
caused by calling console.print
. See #2071 by @Atinux.seeFileNameMatching
grabFileNames
grabAttributeFrom
method by @elukoyanovbasicAuth: {username: 'username', password: 'password'}
. See #1962 by @PeterNgTrscrollIntoView
by @pablopaulparse()
method to data table inside Cucumber tests. Use it to obtain rows and hashes for test data. See #2082 by @SraimeChangelog
2.3.6
run-workers
now can use glob pattern. By @Ilrilan// Example:
exports.config = {
tests: '{./workers/base_test.workers.js,./workers/test_grep.workers.js}',
}
npx codeceptjs info
which print information about your environment and CodeceptJS configs. By @jamesgeorge007waitForClickable
for waiting clickable element on page.waitForText
XPath context now works correctly. By @HeavikclearField
clear field now awaits TestCafe's promise. By @orihomie