# Releases
# 2.4.3
- Hotfix for interactive pause
# 2.4.2
- Interactive pause improvements by koushikmohan1996
- allows using in page objects and variables:
pause({ loginPage, a }) - enables custom commands inside pause with
=>prefix:=> loginPage.open()
- allows using in page objects and variables:
- Selenoid plugin added by by koushikmohan1996
- uses Selenoid to launch browsers inside Docker containers
- automatically records videos and attaches them to allure reports
- can delete videos for successful tests
- can automatically pull in and start Selenoid containers
- works with WebDriver helper
- Avoid failiure report on successful retry in worker by koushikmohan1996
- Added translation ability to Scenario, Feature and other context methods by koushikmohan1996
- 📢 Please help us translate context methods to your language! See italian translation as an example and send patches to vocabularies.
- allurePlugin: Added
saycomments to allure reports by PeterNgTr. - Fixed no custom output folder created when executed with run-worker. Fix by PeterNgTr
- [Puppeteer] Fixed error description for context element not found. See #2065. Fix by PeterNgTr
- [WebDriver] Fixed
waitForClickableto wait for exact number of seconds by mirao. Resolves #2166 - Fixed setting
compilerOptionsinjsconfig.jsonfile on init by PeterNgTr - [Filesystem] Added method by nitschSB
seeFileContentsEqualReferenceFilewaitForFile
# 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".
- Added
run-reruncommand to run tests multiple times to detect and fix flaky tests. By Ilrilan and Vorobeyko. - Added
Scenario.todo()to declare tests as pending. See #2100 by Vorobeyko - Added support for absolute path for
outputdir. See #2049 by elukoyanov - Fixed error in
npx codecept initcaused by callingconsole.print. See #2071 by Atinux. - [Filesystem] Methods added by aefluke:
seeFileNameMatchinggrabFileNames
- [Puppeteer] Fixed grabbing attributes with hyphen by Holorium
- [TestCafe] Fixed
grabAttributeFrommethod by elukoyanov - [MockRequest] Added support for Polly config options by ecrmnn
- [TestCafe] Fixes exiting with zero code on failure. Fixed #2090 with #2106 by koushikmohan1996
- [WebDriver][Puppeteer] Added basicAuth support via config. Example:
basicAuth: {username: 'username', password: 'password'}. See #1962 by PeterNgTr - [WebDriver][Appium] Added
scrollIntoViewby pablopaul - Fixed #2118: No error stack trace for syntax error by senthillkumar
- Added
parse()method to data table inside Cucumber tests. Use it to obtain rows and hashes for test data. See #2082 by Sraime
# 2.3.6
- Create better Typescript definition file through JSDoc. By lemnis
run-workersnow can use glob pattern. By Ilrilan
// Example:
exports.config = {
tests: '{./workers/base_test.workers.js,./workers/test_grep.workers.js}',
}
- Added new command
npx codeceptjs infowhich print information about your environment and CodeceptJS configs. By jamesgeorge007 - Fixed some typos in documantation. By pablopaul atomicpages EricTendian
- Added PULL_REQUEST template.
- [Puppeteer][WebDriver] Added
waitForClickablefor waiting clickable element on page. - [TestCafe] Added support for remote connection. By jvdieten
- [Puppeteer] Fixed
waitForTextXPath context now works correctly. By Heavik - [TestCafe] Fixed
clearFieldclear field now awaits TestCafe's promise. By orihomie - [Puppeteer] Fixed fails when executing localStorage on services pages. See #2026
- Fixed empty tags in test name. See #2038
# 2.3.5
- Set "parse-function" dependency to "5.2.11" to avoid further installation errors.
# 2.3.4
- Fixed installation error "Cannot find module '@babel/runtime/helpers/interopRequireDefault'". The issue came from
parse-functionpackage. Fixed by pablopaul. - [Puppeteer] Fixed switching to iframe without an ID by johnyb. See #1974
- Added
--profileoption torun-workersby orihomie - Added a tag definition to
FeatureConfigandScenarioConfigby sseliverstov
# 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]
pressKeyimprovements by martomo: Changed pressKey method to resolve issues and extend functionality.- Did not properly recognize 'Meta' (or 'Command') as modifier key.
- Right modifier keys did not work in WebDriver using JsonWireProtocol.
- 'Shift' +
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
pressKeyUpandpressKeyDownto press and release modifier keys likeControlorShift. By martomo. - [Puppeteer][WebDriver] Added
grabElementBoundingRectby PeterNgTr. - [Puppeteer] Fixed speed degradation introduced in #1306 with accessibility locators support. See #1953.
- Added
Config.addHookto add a function that will update configuration on load. - Started
@codeceptjs/configurepackage with a collection of common configuration patterns. - [TestCafe] port's management removed (left on TestCafe itself) by orihomie. Fixes #1934.
- [REST] Headers are no more declared as singleton variable. Fixes #1959
- Updated Docker image to include run tests in workers with
NUMBER_OF_WORKERSenv variable. By PeterNgTr.
# 2.3.2
- [Puppeteer] Fixed Puppeteer 1.20 support by davertmik
- Fixed
run-workersto run with complex configs. See #1887 by nitschSB - Added
--suitesoption torun-workersto split suites by workers (tests of the same suite goes to teh same worker). Thanks nitschSB. - Added a guide on Email Testing.
- [retryFailedStepPlugin] Improved to ignore wait* steps and others. Also added option to ignore this plugin per test bases. See updated documentation. By davertmik
- Fixed using PageObjects as classes by Vorobeyko. See #1896
- [WebDriver] Fixed opening more than one tab. See #1875 by jplegoff. Fixes #1874
- Fixed #1891 when
I.retry()affected retries of next steps. By davertmik
# 2.3.1
- [MockRequest] Polly helper was renamed to MockRequest.
- [MockRequest][WebDriver] Mocking requests is now available in WebDriver. Thanks radhey1851
- [Puppeteer] Ensure configured user agent and/or window size is applied to all pages. See #1862 by martomo
- Improve handling of xpath locators with round brackets by nitschSB. See #1870
- Use WebDriver capabilities config in wdio plugin. #1869 by quekshuy
# 2.3.0
- Parallel testing by workers introduced by VikalpP and davertmik. Use
run-workerscommand 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.
- Learn how to use GraphQL helper to access GarphQL API
- And how to combine it with GraphQLDataFactory to generate and persist test data.
- Updated to use Mocha 6. See #1802 by elukoyanov
- Added
dry-runcommand to print steps of test scenarios without running them. Fails to execute scenarios withgrab*methods or custom code. See #1825 for more details.
npx codeceptjs dry-run
- [Appium] Optimization when clicking, searching for fields by accessibility id. See #1777 by gagandeepsingh26
- [TestCafe] Fixed
switchToby KadoBOT - [WebDriver] Added geolocation actions by PeterNgTr
grabGeoLocation()setGeoLocation()
- [Polly] Check typeof arguments for mock requests by VikalpP. Fixes #1815
- CLI improvements by jamesgeorge007
codeceptjscommand prints list of all available commands- added
codeceptjs -Vflag to print version information - warns on unknown command
- Added TypeScript files support to
run-multipleby z4o4z - Fixed element position bug in locator builder. See #1829 by AnotherAnkor
- Various TypeScript typings updates by elukoyanov and Vorobeyko
- Added
event.step.commentevent for all comment steps likeI.sayor gherking steps.
# 2.2.1
- [WebDriver] A dedicated guide written.
- [TestCafe] A dedicated guide written.
- [Puppeteer] A chapter on mocking written
- [Puppeteer][Nightmare][TestCafe] Window mode is enabled by default on
codeceptjs init. - [TestCafe] Actions implemented by hubidu
grabPageScrollPositionscrollPageToTopscrollPageToBottomscrollToswitchTo
- Intellisense improvements. Renamed
tsconfig.jsontojsconfig.jsonon init. Fixed autocompletion for Visual Studio Code. - [Polly] Take configuration values from Puppeteer. Fix #1766 by VikalpP
- [Polly] Add preconditions to check for puppeteer page availability by VikalpP. Fixes #1767
- [WebDriver] Use filename for
uploadFileby VikalpP. See #1797 - [Puppeteer] Configure speed of input with
pressKeyDelayoption. By hubidu - Fixed recursive loading of support objects by davertmik.
- Fixed support object definitions in steps.d.ts by johnyb. Fixes #1795
- Fixed
Data().Scenario().injectDependencies()is not a function by andrerleao - Fixed crash when using xScenario & Scenario.skip with tag by VikalpP. Fixes #1751
- Dynamic configuration of helpers can be performed with async function. See #1786 by cviejo
- Added TS definitions for internal objects by Vorobeyko
- BDD improvements:
- Fixed: dynamic configs not reset after test. Fixes #1776 by cviejo.
# 2.2.0
- EXPERIMENTAL TestCafe helper introduced. TestCafe allows to run cross-browser tests it its own very fast engine. Supports all browsers including mobile. Thanks to hubidu for implementation! Please test it and send us feedback.
- [Puppeteer] Mocking requests enabled by introducing Polly.js helper. Thanks VikalpP
// use Polly & Puppeteer helpers
I.mockRequest('GET', '/api/users', 200);
I.mockRequest('POST', '/users', { user: { name: 'fake' }});
- EXPERIMENTAL [Puppeteer] Firefox support introduced by ngadiyak, see #1740
- [stepByStepReportPlugin] use md5 hash to generate reports into unique folder. Fix #1744 by chimurai
- Interactive pause improvements:
- print result of
grabcommands - print message for successful assertions
- print result of
run-multiple(parallel execution) improvements:bootstrapAllmust be called before creating chunks. #1741 by Vorobeyko- Bugfix: If value in config has falsy value then multiple config does not overwrite original value. #1756 by LukoyanovE
- Fixed hooks broken in 2.1.5 by Vorobeyko
- Fix references to support objects when using Dependency Injection. Fix by johnyb. See #1701
- Fix dynamic config applied for multiple helpers by VikalpP #1743
# 2.1.5
- EXPERIMENTAL Wix Detox support introduced as standalone helper. Provides a faster alternative to Appium for mobile testing.
- Saving successful commands inside interactive pause into
_output/cli-historyfile. By hubidu - Fixed hanging error handler inside scenario. See #1721 by haily-lgc.
- Fixed by Vorobeyko: tests did not fail when an exception was raised in async bootstrap.
- [WebDriver] Added window control methods by emmonspired
grabAllWindowHandlesreturns all window handlesgrabCurrentWindowHandlereturns current window handleswitchToWindowswitched to window by its handle
- [Appium] Fixed using
hostas configuration by trinhpham - Fixed
run-multiplecommand whentestsconfig option is undefined (in Gherkin scenarios). By gkushang. - German translation introduced by hubidu
# 2.1.4
- [WebDriver][Puppeteer][Protractor][Nightmare] A11y locator support introduced by Holorium. Clickable elements as well as fields can be located by following attributes:
aria-labeltitlearia-labelledby
- [Puppeteer] Added support for React locators.
- New React Guide added.
- [Puppeteer] Deprecated
downloadFile - [Puppeteer] Introduced
handleDownloadsreplacingdownloadFile - [puppeteerCoverage plugin] Fixed path already exists error by seta-tuha.
- Fixed 'ERROR: ENAMETOOLONG' creating directory names in
run-multiplewith long config. By artvinn - [REST] Fixed url autocompletion combining base and relative paths by LukoyanovE
- [Nightmare][Protractor]
uncheckOptionmethod introduced by PeterNgTr - [autoLogin plugin] Enable to use without
awaitby tsuemura - [Puppeteer] Fixed
UnhandledPromiseRejectionWarning: "Execution context was destroyed...by adrielcodeco - [WebDriver] Keep browser window dimensions when starting a new session by spiroid
- Replace Ghekrin plceholders with values in files that combine a scenerio outline and table by medtoure18.
- Added Documentation to locate elements in React Native apps. By DimGun.
- Adding optional
pathparameter tobdd:snippetscommand to append snippets to a specific file. By cthorsen31. - Added optional
outputparameter todefcommand by LukoyanovE. - [Puppeteer] Added
grabDataFromPerformanceTimingby PeterNgTr. - axios updated to
0.19.0by SteveShaffer - TypeScript defitions updated by LukoyanovE. Added
secretandinjectfunction.
# 2.1.3
- Fixed autoLogin plugin to inject
loginfunction - Fixed using
toString()in DataTablewhen it is defined by tsuemura
# 2.1.2
- Fixed
injectto load objects recursively. - Fixed TypeScript definitions for locators by LukoyanovE
- 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
withinandsessioncalls insideretryFailedStepplugin. Fix by tsuemura
# 2.1.0
- Added global
inject()function to require actor and page objects using dependency injection. Recommended to use in page objects, step definition files, support objects:
// old way
const I = actor();
const myPage = require('../page/myPage');
// new way
const { I, myPage } = inject();
- Added global
secretfunction to fill in sensitive data. By RohanHart:
I.fillField('password', secret('123456'));
- wdioPlugin Added a plugin to support webdriverio services including selenium-standalone, sauce, browserstack, etc. Sponsored by GSasu
- [Appium] Fixed
swipe*methods by PeterNgTr - BDD Gherkin Improvements:
- Implemented
run-multiplefor feature files. Sponsored by GSasu - Added
--featuresand--testsoptions torun-multiple. Sponsored by GSasu - Implemented
BeforeandAfterhooks in step definitions
- Implemented
- Fixed running tests by absolute path. By batalov.
- Enabled the adding screenshot to failed test for moch-junit-reporter by PeterNgTr.
- [Puppeteer] Implemented
uncheckOptionand fixed behavior ofcheckOptionby aml2610 - [WebDriver] Fixed
seeTextEqualson empty strings by PeterNgTr - [Puppeteer] Fixed launch with
browserWSEndpointconfig by ngadiyak. - [Puppeteer] Fixed switching back to main window in multi-session mode by davertmik.
- [autoLoginPlugin] Fixed using async functions for auto login by nitschSB
This release was partly sponsored by GSasu. Thanks for the support! Do you want to improve this project? [Learn more about sponsorin CodeceptJS
# 2.0.8
- [Puppeteer] Added
downloadFileaction by PeterNgTr.
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
amInPathandseeFileare taken from FileSystem helper
- [Puppeteer] Fixed
autoLoginplugin with Puppeteer by davertmik - [WebDriver]
seeInFieldshould throw error if element has no value attrubite. By PeterNgTr - [WebDriver] Fixed
seeTextEqualspasses for any string if element is empty by PeterNgTr. - [WebDriver] Internal refctoring to use
el.isDisplayedto match latest webdriverio implementation. Thanks to LukoyanovE - [allure plugin] Add ability enable screenshotDiff plugin by Vorobeyko
- [Appium] Fixed
locator.stringifycall by LukoyanovE
# 2.0.7
- [WebDriver][Protractor][Nightmare]
rightClickmethod implemented (fixed) in a standard way. By davertmik - [WebDriver] Updated WebDriver API calls in helper. By PeterNgTr
- [stepByStepReportPlugin] Added
screenshotsForAllureReportconfig options to automatically attach screenshots to allure reports. By PeterNgTr - [allurePlugin] Added
addLabelmethod by Vorobeyko - Locator Builder: fixed
withChildandwithDescendantto match deep nested siblings by Vorobeyko.
# 2.0.6
- Introduced Custom Locator Strategies.
- Added Visual Testing Guide by puneet0191 and MitkoTschimev.
- [Puppeteer]
puppeteerCoverageplugin added to collect code coverage in JS. By dvillarama - Make override option in
run-multipleto respect the generated overridden config by kinyat - Fixed deep merge for
container.append(). Introducedlodash.merge(). By Vorobeyko - Fixed saving screenshot on Windows by
- Fix errors on using interactive shell with Allure plugin by tsuemura
- Fixed using dynamic injections with
Scenario().injectDependenciesby tsemura - [WebDriver][Puppeteer][Nightmare][Protractor] Fixed url protocol detection for non-http urls by LukoyanovE
- [WebDriver] Enabled compatibility with
stepByStepReportby tsuemura - [WebDriver] Fixed
grabHTMLFromto return innerHTML value by Holorium. Fixed compatibility with WebDriverIO. - [WebDriver]
grabHTMLFromto return one HTML vlaue for one element matched, array if multiple elements found by davertmik. - [Nightmare] Added
grabHTMLFromby davertmik - Fixed
bootstrapAllandteardownAlllaunch with path as argument by LukoyanovE - Fixed
bootstrapAllandteardownAllcalls from exported object by LukoyanovE - [WebDriver] Added possibility to define conditional checks interval for
waitUntilby LukoyanovE - Fixed storing current data in data driven tests in a test object. By Vorobeyko
- [WebDriver] Fixed
hostnameconfig option overwrite when setting a cloud provider. By LukoyanovE - [WebDriver]
dragSlidermethod implemented by DavertMik - [WebDrover] Fixed
scrollToto use new webdriverio API by PeterNgTr - Added Japanese translation file by tsemura
- Added
Locator.withDescendant()method to find an element which contains a descendant (child, grandchild) by Vorobeyko - [WebDriver] Fixed configuring capabilities for Selenoid and IE by Vorobeyko
- [WebDriver] Restore original window size when taking full size screenshot by tsuemura
- Enabled
throws(),fails(),retry(),timeout(),config()functions for data driven tests. By jjm409
# 2.0.5
[Broken Release]
# 2.0.4
- [WebDriver][Protractor][Nightmare][Puppeteer]
grabAttributeFromreturns an array when multiple elements matched. By PeterNgTr - [autoLogin plugin] Fixed merging users config by nealfennimore
- [autoDelay plugin] Added WebDriver to list of supported helpers by mattin4d
- [Appium] Fixed using locators in
waitForElement,waitForVisible,waitForInvisible. By eduardofinotti - [allure plugin] Add tags to allure reports by Vorobeyko
- [allure plugin] Add skipped tests to allure reports by Vorobeyko
- Fixed
Logged Test name | [object Object]when used Data().Scenario(). By Vorobeyko - Fixed Data().only.Scenario() to run for all datasets. By Vorobeyko
- [WebDriver]
attachFileto work with hidden elements. Fixed in #1460 by tsuemura
# 2.0.3
- autoLogin plugin 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 traceissue inretryFailedStepplugin. - Added
locate()function into the interactive shell. - [WebDriver] Disabled smartWait for interactive shell.
- [Appium] Updated methods to use for mobile locators
waitForElementwaitForVisiblewaitForInvisible
- Helper and page object generators no longer update config automatically. Please add your page objects and helpers manually.
# 2.0.2
- [Puppeteer] Improved handling of connection with remote browser using Puppeteer by martomo
- [WebDriver] Updated to webdriverio 5.2.2 by martomo
- Interactive pause improvements by davertmik
- Disable retryFailedStep plugin in in interactive mode
- Removes
Interface: parseInputwhile in interactive pause
- [ApiDataFactory] Improvements
- added
fetchIdconfig option to override id retrieval from payload - added
onRequestconfig option to update request in realtime - added
returnIdconfig option to return ids of created items instead of items themvelves - added
headersconfig option to override default headers. - added a new chapter into DataManagement
- added
- [REST] Added
onRequestconfig option
# 2.0.1
- Fixed creating project with
codecept init. - Fixed error while installing [email protected]
- 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 [email protected] --save- Replace
WebDriverIO=>WebDriverhelper name in config. - Read webdriverio changelog. 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.0installed.Known issues:
attachFiledoesn't work with proxy server.
[Appium] Breaking Change. Updated to use webdriverio v5 as well. See upgrade plan ↑
[REST] Breaking Change. Replaced
unirestlibrary withaxios.Upgrade plan:
- Refer to axios API.
- If you were using
unirestrequests/responses in your tests change them to axios format.
Breaking Change. Generators support in tests removed. Use
async/awaitin your testsUsing
codecept.conf.jsas default configuration formatFixed "enametoolong" error when saving screenshots for data driven tests by PeterNgTr
Updated NodeJS to 10 in Docker image
[Pupeteer] Add support to use WSEndpoint. Allows to execute tests remotely. [See #1350] by gabrielcaires (https://github.com/Codeception/CodeceptJS/pull/1350)
In interactive shell [Enter] goes to next step. Improvement by PeterNgTr.
I.sayaccepts second parameter as color to print colorful comments. Improvement by PeterNgTr.
I.say('This is red', 'red'); //red is used
I.say('This is blue', 'blue'); //blue is used
I.say('This is by default'); //cyan is used
- Fixed allure reports for multi session testing by PeterNgTr
- Fixed allure reports for hooks by PeterNgTr
# 1.4.6
- [Puppeteer]
dragSlideraction added by PeterNgTr - [Puppeteer] Fixed opening browser in shell mode by allenhwkim
- [Puppeteer] Fixed making screenshot on additional sessions by PeterNgTr. Fixes #1266
- Added
--invertoption torun-multiplecommand by LukoyanovE - Fixed steps in Allure reports by PeterNgTr
- Add option
outputto customize output directory in stepByStepReport plugin. By fpsthirty - Changed type definition of PageObjects to get auto completion by rhicu
- Fixed steps output for async/arrow functions in CLI by LukoyanovE. See #1329
# 1.4.5
- Add require param to main config. Allows to require Node modules before executing tests. By LukoyanovE. For example:
- Use
ts-node/registerto register TypeScript parser - Use
shouldto register should-style assertions
- Use
"require": ["ts-node/register", "should"]
- [WebDriverIO] Fix timeouts definition to be compatible with W3C drivers. By LukoyanovE
- Fixed: exception in Before block w/ Mocha causes test not to report failure. See #1292 by PeterNgTr
- Command
run-parallelnow accepts--overrideflag. Thanks to ClemCB - Fixed Allure report with Before/BeforeSuite/After/AfterSuite steps. By PeterNgTr
- Added
RUN_MULTIPLEenv variable to Docker config. Allows to run tests in parallel inside a container. Thanks to PeterNgTr - [Mochawesome] Fixed showing screenshot on failure. Fix by PeterNgTr
- Fixed running tests filtering by tag names defined via
Scenario.tag()
# 1.4.4
- autoDelay plugin added. Adds tiny delay before and after an action so the page could react to actions performed.
- [Puppeteer] improvements by luismanuel001
clickno longer waits for navigationclickLinkmethod added. Performs a click and waits for navigation.
- Bootstrap scripts to be started only for
runcommand and ignored onlist,def, etc. Fix by LukoyanovE
# 1.4.3
- Groups renamed to Tags for compatibility with BDD layer
- Test and suite objects to contain tags property which can be accessed from internal API
- Fixed adding tags for Scenario Outline in BDD
- Added
tag()method to ScenarioConfig and FeatureConfig:
Scenario('update user profile', () => {
// test goes here
}).tag('@slow');
- Fixed attaching Allure screenshot on exception. Fix by DevinWatson
- Improved type definitions for custom steps. By Akxe
- Fixed setting
multiple.parallel.chunksas environment variable in config. See #1238 by ngadiyak
# 1.4.2
- Fixed setting config for plugins (inclunding setting
outputDirfor allure) by jplegoff
# 1.4.1
- Added
pluginsoption torun-multiple - Minor output fixes
- Added Type Definition for Helper class by Akxe
- Fixed extracing devault extension in generators by Akxe
# 1.4.0
- Allure Reporter Integration. Full inegration with Allure Server. Get nicely looking UI for tests,including steps, nested steps, and screenshots. Thanks Natarajan Krishnamurthy krish for sponsoring this feature.
- Plugins API introduced. Create custom plugins for CodeceptJS by hooking into event dispatcher, and using promise recorder.
- Official CodeceptJS plugins added:
stepByStepReport- creates nicely looking report to see test execution as a slideshow. Use this plugin to debug tests in headless environment without recording a video.allure- Allure reporter added as plugin.screenshotOnFail- saves screenshot on fail. Replaces similar functionality from helpers.retryFailedStep- to rerun each failed step.
- [Puppeteer] Fix
executeAsyncScriptunexpected token by jonathanz - Added
overrideoption torun-multiplecommand by svarlet
# 1.3.3
- Added
initGlobals()function to API of custom runner.
# 1.3.2
- Interactve Shell improvements for
pause()- Added
nextcommand 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
waitForRequestto wait for network request. - Added
waitForResponseto wait for network response.
- Added
- Improved TypeScript definitions to support custom steps and page objects. By xt1
- Fixed XPath detection to accept XPath which starts with
./by BenoitZugmeyer
# 1.3.1
- BDD-Gherkin: Fixed running async steps.
- [Puppeteer] Fixed process hanging for 30 seconds. Page loading timeout default via
getPageTimeoutset 0 seconds. - [Puppeteer] Improved displaying client-side console messages in debug mode.
- [Puppeteer] Fixed closing sessions in
restart:falsemode for multi-session mode. - [Protractor] Fixed
grabPopupTextto not throw error popup is not opened. - [Protractor] Added info on using 'direct' Protractor driver to helper documentation by xt1.
- [WebDriverIO] Added a list of all special keys to WebDriverIO helper by davertmik and xt1.
- Improved TypeScript definitions generator by xt1
# 1.3.0
- Cucumber-style BDD. Introduced Gherkin support. Thanks to David Vins and Omedym 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
runcommand 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
--stepsflag. - 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. - [Puppeteer] Multiple sessions enabled. Requires Puppeteer >= 1.5
- [Puppeteer] Stability improvement. Waits for for
loadevent on page load. This strategy can be changed in config:waitForNavigationconfig option introduced. Possible options:load,domcontentloaded,networkidle0,networkidle2. See Puppeteer APIgetPageTimeoutconfig option to set maximum navigation time in milliseconds. Default is 30 seconds.waitForNavigationmethod added. Explicitly waits for navigation to be finished.
- [WebDriverIO][Protractor][Puppeteer][Nightmare] Possible BC
grabTextFromunified. Return a text for single matched element and an array of texts for multiple elements. - [Puppeteer]Fixed
resizeWindowby sergejkaravajnij - [WebDriverIO][Protractor][Puppeteer][Nightmare]
waitForFunctionadded. Waits for client-side JavaScript function to return true by GREENpoint. - [Puppeteer]
waitUntildeprecated in favor ofwaitForFunction. - Added
filterfunction to DataTable. - Send non-nested array of files to custom parallel execution chunking by mikecbrant.
- Fixed invalid output directory path for run-multiple by mikecbrant.
- [WebDriverIO]
waitUntiltimeout accepts time in seconds (as all other wait* functions). Fix by truesrc. - [Nightmare] Fixed
grabNumberOfVisibleElementsto work similarly toseeElement. Thx to stefanschenk and Jinbo Jinboson. - [Protractor] Fixed alert handling error with message 'no such alert' by truesrc.
# 1.2.1
- Fixed running
I.retry()on multiple steps. - Fixed parallel execution wih chunks.
- [Puppeteer] Fixed
grabNumberOfVisibleElementsto return0instead of throwing error if no elements are found.
# 1.2.0
- [WebDriverIO][Protractor]Multiple Sessions. Run several browser sessions in one test. Introduced
sessioncommand, 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('Hello');
I.see('Bye');
});
I.see('Hello');
});
- Parallel Execution by sveneisenschmidt. Run tests in parallel specifying number of chunks:
"multiple": {
"parallel": {
// run in 2 processes
"chunks": 2,
// run all tests in chrome
"browsers": ["chrome"]
},
}
- Locator Builder. Write complex locators with simplest API combining CSS and XPath:
// select 'Edit' link inside 2nd row of a table
locate('//table')
.find('tr')
.at(2)
.find('a')
.withText('Edit');
- Dynamic configuration to update helpers config per test or per suite.
- Added
event.test.finishedwhich fires synchronously for both failed and passed tests. - [WebDriverIO][Protractor][Nightmare][Puppeteer] Full page screenshots on failure disabled by default. See [issue#1600. You can enabled them with
fullPageScreenshots: true, however they may work unstable in Selenium. withinblocks can return values. See updated documentation.- Removed doublt call to
_initin helpers. Fixes issue #1036 - Added scenario and feature configuration via fluent API:
Feature('checkout')
.timeout(3000)
.retry(2);
Scenario('user can order in firefox', (I) => {
// see dynamic configuration
}).config({ browser: 'firefox' })
.timeout(20000);
Scenario('this test should throw error', (I) => {
// I.amOnPage
}).throws(new Error);
# 1.1.8
- Fixed generating TypeScript definitions with
codeceptjs def. - Added Chinese translation ("zh-CN" and "zh-TW") by TechQuery.
- Fixed running tests from a different folder specified by
-coption. - [Puppeteer] Added support for hash handling in URL by gavoja.
- [Puppeteer] Fixed setting viewport size by gavoja. See Puppeteer issue
# 1.1.7
- Docker Image updateed. See updated reference:
- codeceptjs package is mounted as
/codeceptinsde container - tests directory is expected to be mounted as
/tests codeceptjsglobal runner added (symlink to/codecept/bin/codecept.js)
- codeceptjs package is mounted as
- [Protractor] Functions added by reubenmiller:
_locateCheckable (only available from other helpers)_locateClickable (only available from other helpers)_locateFields (only available from other helpers)acceptPopupcancelPopupdragAndDropgrabBrowserLogsgrabCssPropertyFromgrabHTMLFromgrabNumberOfVisibleElementsgrabPageScrollPosition (new)rightClickscrollPageToBottomscrollPageToTopscrollToseeAttributesOnElementsseeCssPropertiesOnElementsseeInPopupseeNumberOfVisibleElementsswitchTowaitForEnabledwaitForValuewaitInUrlwaitNumberOfVisibleElementswaitToHidewaitUntilwaitUrlEquals
- [Nightmare] added:
grabPageScrollPosition(new)seeNumberOfVisibleElementswaitToHide
- [Puppeteer] added:
grabPageScrollPosition(new)
- [WebDriverIO] added"
grabPageScrollPosition(new)
- [Puppeteer] Fixed running wait* functions without setting
secparameter. - [Puppeteer][Protractor] Fixed bug with I.click when using an object selector with the xpath property. By reubenmiller
- [WebDriverIO][Protractor][Nightmare][Puppeteer] Fixed I.switchTo(0) and I.scrollTo(100, 100) api inconsistencies between helpers.
- [Protractor] Fixing bug when
seeAttributesOnElementsandseeCssPropertiesOnElementwere incorrectly passing when the attributes/properties did not match by reubenmiller - [WebDriverIO] Use inbuilt dragAndDrop function (still doesn't work in Firefox). By reubenmiller
- Support for Nightmare 3.0
- Enable glob patterns in
config.test/Codecept.loadTestsby sveneisenschmidt - Enable overriding of
config.testsforrun-multipleby sveneisenschmidt
# 1.1.6
- Added support for
async I =>functions syntax in Scenario by APshenkin - [WebDriverIO][Protractor][Puppeteer][Nightmare]
waitForInvisiblewaits for element to hide or to be removed from page. By reubenmiller - [Protractor][Puppeteer][Nightmare] Added
grabCurrentUrlfunction. By reubenmiller - [WebDriverIO]
grabBrowserUrldeprecated in favor ofgrabCurrentUrlto unify the API. - [Nightmare] Improved element visibility detection by reubenmiller
- [Puppeteer] Fixing function calls when clearing the cookies and localstorage. By reubenmiller
- [Puppeteer] Added
waitForEnabled,waitForValueandwaitNumberOfVisibleElementsmethods by reubenmiller - [WebDriverIO] Fixed
grabNumberOfVisibleElementsto return 0 when no visible elements are on page. By michaltrunek - Helpers API improvements (by reubenmiller)
_passedhook runs after a test passed successfully_failedhook runs on a failed test
- Hooks API. New events added by reubenmiller:
event.all.before- executed before all testsevent.all.after- executed after all testsevent.multiple.before- executed before all processes in run-multipleevent.multiple.after- executed after all processes in run-multiple
- Multiple execution
- Allow
AfterSuiteandAftertest hooks to be defined after the first Scenario. By reubenmiller - [Nightmare] Prevent
I.amOnpagenavigation if the browser is already at the given url - Multiple-Run: Added new
bootstrapAllandteardownAllhooks to be executed before and after all processes codeceptjs defcommand accepts--configoption. By reubenmiller
# 1.1.5
- [Puppeteer] Rerun steps failed due to "Cannot find context with specified id" Error.
- Added syntax to retry a single step:
// retry action once on failure
I.retry().see('Hello');
// retry action 3 times on failure
I.retry(3).see('Hello');
// retry action 3 times waiting for 0.1 second before next try
I.retry({ retries: 3, minTimeout: 100 }).see('Hello');
// retry action 3 times waiting no more than 3 seconds for last retry
I.retry({ retries: 3, maxTimeout: 3000 }).see('Hello');
// retry 2 times if error with message 'Node not visible' happens
I.retry({
retries: 2,
when: err => err.message === 'Node not visible'
}).seeElement('#user');
Scenario().injectDependenciesadded to dynamically add objects into DI container by Apshenkin. See Dependency Injection section in PageObjects.- Fixed using async/await functions inside
within - [WebDriverIO][Protractor][Puppeteer][Nightmare]
waitUntilExistsdeprecated in favor ofwaitForElement - [WebDriverIO][Protractor]
waitForStalenessOfdeprecated in favor ofwaitForDetached - [WebDriverIO][Protractor][Puppeteer][Nightmare]
waitForDetachedadded - [Nightmare] Added
I.seeNumberOfElements()by pmoncadaisla - [Nightmare] Load blank page when starting nightmare so that the .evaluate function will work if _failed/saveScreenshot is triggered by reubenmiller
- Fixed using plain arrays for data driven tests by reubenmiller
- [Puppeteer] Use default tab instead of opening a new tab when starting the browser by reubenmiller
- [Puppeteer] Added
grabNumberOfTabsfunction by reubenmiller - [Puppeteer] Add ability to set user-agent by abidhahmed
- [Puppeteer] Add keepCookies and keepBrowserState abidhahmed
- [Puppeteer] Clear value attribute instead of innerhtml for TEXTAREA by reubenmiller
- [REST] fixed sending string payload by michaltrunek
- Fixed unhandled rejection in async/await tests by APshenkin
# 1.1.4
- Removed
yarncall in package.json - Fixed
console.login Puppeteer by othree - [Appium]
runOnAndroidandrunOnIOScan receive a function to check capabilities dynamically:
I.runOnAndroid(caps => caps.platformVersion >= 7, () => {
// run code only on Android 7+
});
# 1.1.3
- [Puppeteer] +25 Functions added by reubenmiller
_locateCheckable_locateClickable_locateFieldscloseOtherTabsdragAndDropgrabBrowserLogsgrabCssPropertyFromgrabHTMLFromgrabNumberOfVisibleElementsgrabSourcerightClickscrollPageToBottomscrollPageToTopscrollToseeAttributesOnElementsseeCssPropertiesOnElementsseeInFieldseeNumberOfElementsseeNumberOfVisibleElementsseeTextEqualsseeTitleEqualsswitchTowaitForInvisiblewaitInUrlwaitUrlEquals
- [Protractor] +8 functions added by reubenmiller
closeCurrentTabgrabSourceopenNewTabseeNumberOfElementsseeTextEqualsseeTitleEqualsswitchToNextTabswitchToPreviousTab
- [Nightmare]
waitForInvisibleadded by reubenmiller - [Puppeteer] Printing console.log information in debug mode.
- [Nightmare] Integrated with
nightmare-har-pluginby mingfang. AddedenableHARoption. Added HAR functions:grabHARsaveHARresetHAR
- [WebDriverIO] Fixed execution stability for parallel requests with Chromedriver
- [WebDriverIO] Fixed resizeWindow when resizing to 'maximize' by reubenmiller
- [WebDriverIO] Fixing resizing window to full screen when taking a screenshot by reubenmiller
# 1.1.2
- [Puppeteer] Upgraded to Puppeteer 1.0
- Added
grepoption to config to set default matching pattern for tests. - [Puppeteer] Added
acceptPopup,cancelPopup,seeInPopupandgrabPopupTextfunctions by reubenmiller - [Puppeteer]
withiniframe and nested iframe support added by reubenmiller - [REST] Added support for JSON objects since payload (as a JSON) was automatically converted into "URL query" type of parameter by Kalostrinho
- [REST] Added
resetRequestHeadersmethod by Kalostrinho - [REST] Added
followRedirectoption andamFollowingRequestRedirects/amNotFollowingRequestRedirectsmethods by Kalostrinho - [WebDriverIO]
uncheckOptionimplemented by brunobg - [WebDriverIO] Added
grabBrowserUrlby Kalostrinho - Add ability to require helpers from node_modules by APshenkin
- Added
--profileoption torun-multiplecommand by jamie-beck - Custom output name for multiple browser run by tfiwm
- Fixed passing data to scenarios by KennyRules
# 1.1.1
- [WebDriverIO] fixed
waitForInvisibleby Kporal
# 1.1.0
Major update to CodeceptJS. NodeJS v 8.9.1 is now minimal Node version required. This brings native async-await support to CodeceptJS. It is recommended to start using await for tests instead of generators:
async () => {
I.amOnPage('/page');
const url = await I.grabTextFrom('.nextPage');
I.amOnPage(url);
}
Thanks to @Apshenkin for implementation. Also, most helpers were refactored to use async-await. This made our code simpler. We hope that this encourages more users to send pull requests!
We also introduced strict ESLint policies for our codebase. Thanks to @Galkin for that.
- [Puppeteer] Helper introduced. Learn how to run tests headlessly with Google Chrome's Puppeteer.
- [SeleniumWebdriver] Helper is deprecated, it is recommended to use Protractor with config option
angular: falseinstead. - [WebDriverIO] nested iframe support in the within block by reubenmiller. Example:
within({frame: ['#wrapperId', '[name=content]']}, () => {
I.click('Sign in!');
I.see('Email Address');
});
I.see('Nested Iframe test');
I.dontSee('Email Address');
});
- [WebDriverIO] Support for
~locator to find elements byaria-label. This behavior is similar as it is in Appium and helps testing cross-platform React apps. Example:
<Text accessibilityLabel="foobar">
CodeceptJS is awesome
</Text>
↑ This element can be located with ~foobar in WebDriverIO and Appium helpers. Thanks to flyskywhy
- Allow providing arbitrary objects in config includes by rlewan
- [REST] Prevent from mutating default headers by alexashley. See #789
- [REST] Fixed sending empty helpers with
haveRequestHeadersinsendPostRequest. By petrisorionel - Fixed displaying undefined args in output by APshenkin
- Fixed NaN instead of seconds in output by APshenkin
- Add browser name to report file for
multiple-runby trollr - Mocha updated to 4.x
# 1.0.3
- [WebDriverIO][Protractor][Nightmare] method
waitUntilExistsimplemented by sabau - Absolute path can be set for
outputdir by APshenkin. Fix #571* Data table rows can be ignored by usingxadd. By APhenkin - Added
Data(table).only.Scenarioto give ability to launch only Data tests. By APhenkin - Implemented
ElementNotFounderror by BorisOsipov. - Added TypeScript compiler / configs to check the JavaScript by KennyRules
- [Nightmare] fix executeScript return value by jploskonka
- [Nightmare] fixed: err.indexOf not a function when waitForText times out in nightmare by joeypedicini92
- Fixed: Retries not working when using .only. By APhenkin
# 1.0.2
- Introduced generators support in scenario hooks for
BeforeSuite/Before/AfterSuite/After - [ApiDataFactory] Fixed loading helper;
requiregpackage included. - Fix #485
run-multiple: the first browser-resolution combination was be used in all configurations - Fixed unique test names:
- Fixed #447 tests failed silently if they have the same name as other tests.
- Use uuid in screenshot names when
uniqueScreenshotNames: true
- [Protractor] Fixed testing non-angular application.
amOutsideAngularAppis executed before each step. Fixes #458* Added output for steps in hooks when they fail
# 1.0.1
- Reporters improvements:
- Allows to execute multiple reporters
- Added Mochawesome helper
addMochawesomeContextmethod to add custom data to mochawesome reports- Fixed Mochawesome context for failed screenshots.
- [WebDriverIO] improved click on context to match clickable element with a text inside. Fixes #647* [Nightmare] Added
refreshfunction by awhanks - fixed
Unhandled promise rejection (rejection id: 1): Error: Unknown wait type: pageLoad - support for tests with retries in html report
- be sure that change window size and timeouts completes before test
- [Nightmare] Fixed
[Wrapped Error] "codeceptjs is not defined"; Reinjectiing client scripts to a webpage on changes. - [Nightmare] Added more detailed error messages for
Wait*methods - [Nightmare] Fixed adding screenshots to Mochawesome
- [Nightmare] Fix unique screenshots names in Nightmare
- Fixed CodeceptJS work with hooks in helpers to finish codeceptJS correctly if errors appears in helpers hooks
- Create a new session for next test If selenium grid error received
- Create screenshots for failed hooks from a Feature file
- Fixed
retriesoption
# 1.0
CodeceptJS hits first stable release. CodeceptJS provides a unified API for web testing for Webdriverio, Protractor, and NightmareJS. Since 1.0 you can also test mobile applications in the similar manner with Appium.
Sample test:
I.seeAppIsInstalled("io.super.app");
I.click('~startUserRegistrationCD');
I.fillField('~email of the customer', 'Nothing special'));
I.see('[email protected]', '~email of the customer'));
I.clearField('~email of the customer'));
I.dontSee('Nothing special', '~email of the customer'));
- Read the Mobile Testing guide.
- Discover Appium Helper
We also introduced two new helpers for data management. Using them you can easily prepare and cleanup data for your tests using public REST API.
Sample test
// create a user using data factories and REST API
I.have('user', { name: 'davert', password: '123456' });
// use it to login
I.amOnPage('/login');
I.fillField('login', 'davert');
I.fillField('password', '123456');
I.click('Login');
I.see('Hello, davert');
// user will be removed after the test
Next notable feature is SmartWait for WebDriverIO, Protractor, SeleniumWebdriver. When smartwait option is set, script will wait for extra milliseconds to locate an element before failing. This feature uses implicit waits of Selenium but turns them on only in applicable pieces. For instance, implicit waits are enabled for seeElement but disabled for dontSeeElement
- Read more about SmartWait
# Changelog
- Minimal NodeJS version is 6.11.1 LTS
- Use
withincommand with generators. - Data Driven Tests introduced.
- Print execution time per step in
--debugmode. #591 by APshenkin - [WebDriverIO][Protractor][Nightmare] Added
disableScreenshotsoption to disable screenshots on fail by Apshenkin - [WebDriverIO][Protractor][Nightmare] Added
uniqueScreenshotNamesoption to generate unique names for screenshots on failure by Apshenkin - [WebDriverIO][Nightmare] Fixed click on context;
click('text', '#el')will throw exception if text is not found inside#el. - [WebDriverIO][Protractor][SeleniumWebdriver] SmartWait introduced.
- [WebDriverIO][Protractor][Nightmare]Fixed
saveScreenshotfor PhantomJS,fullPageScreenshotsoption introduced by HughZurname #549 - [Appium] helper introduced by APshenkin
- [REST] helper introduced by atrevino in #504
- [WebDriverIO][SeleniumWebdriver] Fixed "windowSize": "maximize" for Chrome 59+ version #560 by APshenkin
- [Nightmare] Fixed restarting by APshenkin #581
- [WebDriverIO] Methods added by APshenkin:
- grabCssPropertyFrom
- seeTitleEquals
- seeTextEquals
- seeCssPropertiesOnElements
- seeAttributesOnElements
- grabNumberOfVisibleElements
- waitInUrl
- waitUrlEquals
- waitForValue
- waitNumberOfVisibleElements
- switchToNextTab
- switchToPreviousTab
- closeCurrentTab
- openNewTab
- refreshPage
- scrollPageToBottom
- scrollPageToTop
- grabBrowserLogs
- Use mkdirp to create output directory. #592 by vkramskikh
- [WebDriverIO] Fixed
seeNumberOfVisibleElementsby BorisOsipov #574 - Lots of fixes for promise chain by APshenkin #568
- Fix #543- After block not properly executed if Scenario fails
- Expected behavior in promise chains:
_beforeSuitehooks from helpers ->BeforeSuitefrom test ->_beforehooks from helpers ->Beforefrom test - > Test steps ->_failedhooks from helpers (if test failed) ->Afterfrom test ->_afterhooks from helpers ->AfterSuitefrom test ->_afterSuitehook from helpers. - if during test we got errors from any hook (in test or in helper) - stop complete this suite and go to another
- if during test we got error from Selenium server - stop complete this suite and go to another
- [WebDriverIO][Protractor] if
restartoption is false - close all tabs expect one in_after. - Complete
_after,_afterSuitehooks even After/AfterSuite from test was failed - Don't close browser between suites, when
restartoption is false. We should start browser only one time and close it only after all tests. - Close tabs and clear local storage, if
keepCookiesflag is enabled
- Fix TypeError when using babel-node or ts-node on node.js 7+ #586 by vkramskikh
- [Nightmare] fixed usage of
_locate
Special thanks to Andrey Pshenkin for his work on this release and the major improvements.
# 0.6.3
- Errors are printed in non-verbose mode. Shows "Selenium not started" and other important errors.
- Allowed to set custom test options:
Scenario('My scenario', { build_id: 123, type: 'slow' }, function (I)
those options can be accessed as opts property inside a test object. Can be used in custom listeners.
- Added
docsdirectory to a package. - [WebDriverIO][Protractor][SeleniumWebdriver] Bugfix: cleaning session when
restart: falseby tfiwm #519 - [WebDriverIO][Protractor][Nightmare] Added second parameter to
saveScreenshotto allow a full page screenshot. By HughZurname - Added suite object to
suite.beforeandsuite.afterevents by implico. #496
# 0.6.2
- Added
configobject to public API - Extended
index.jsto includeactorandhelpers, so they could be required:
const actor = require('codeceptjs').actor;
- Added example for creating custom runner with public API.
- run command to create
outputdirectory if it doesn't exist - [Protractor] fixed loading globally installed Protractor
- run-multiple command improvements:
- create output directories for each process
- print process ids in output
# 0.6.1
- Fixed loading hooks
# 0.6.0
Major release with extension API and parallel execution.
- Breaking Removed path argument from
run. To specify path other than current directory use--configor-coption:
Instead of: codeceptjs run tests use:
# load config and run from tests directory
codeceptjs run -c tests/
# or load codecept.json from tests directory
codeceptjs run -c tests/codecept.json
# run users_test.js inside tests directory
codeceptjs run users_test.js -c tests
- Command
multiple-runadded, to execute tests in several browsers in parallel by APshenkin and davertmik. See documentation. - Hooks API added to extend CodeceptJS with custom listeners and plugins. See documentation.
- [Nightmare][WebDriverIO]
withincan work with iframes by imvetri. See documentation. - [WebDriverIO][SeleniumWebdriver][Protractor] Default browser changed to
chrome - [Nightmare] Fixed globally locating
nightmare-upload. - [WebDriverIO] added
seeNumberOfVisibleElementsmethod by elarouche. - Exit with non-zero code if init throws an error by rincedd
- New guides published:
- Meta packages published:
# 0.5.1
- Polish translation added by limes.
- Update process exit code so that mocha saves reports before exit by romanovma.
- [Nightmare] fixed
getAttributeFromfor custom attributes by robrkerr - [Nightmare] Fixed UnhandledPromiseRejectionWarning error when selecting the dropdown using
selectOptionby robrkerr. [Se PR. - [Protractor] fixed
pressKeymethod by romanovma
# 0.5.0
- Protractor ^5.0.0 support (while keeping ^4.0.9 compatibility)
- Fix 'fullTitle() is not a function' in exit.js by hubidu. See #388.
- [Nightmare] Fix for
waitTimeoutby HughZurname. See #391. Resolves #236* Dockerized CodeceptJS setup by artiomnist. See reference
# 0.4.16
- Fixed steps output synchronization (regression since 0.4.14).
- [WebDriverIO][Protractor][SeleniumWebdriver][Nightmare] added
keepCookiesoption to keep cookies between tests withrestart: false. - [Protractor] added
waitForTimeoutconfig option to set default waiting time for all wait* functions. - Fixed
_testhook for helpers by cjhille.
# 0.4.15
- Fixed regression in recorder sessions:
oldpromise is not defined.
# 0.4.14
_beforeStepand_afterStephooks in helpers are synchronized. Allows to perform additional actions between steps.
Example: fail if JS error occur in custom helper using WebdriverIO:
_before() {
this.err = null;
this.helpers['WebDriverIO'].browser.on('error', (e) => this.err = e);
}
_afterStep() {
if (this.err) throw new Error('Browser JS error '+this.err);
}
Example: fail if JS error occur in custom helper using Nightmare:
_before() {
this.err = null;
this.helpers['Nightmare'].browser.on('page', (type, message, stack) => {
this.err = `${message} ${stack}`;
});
}
_afterStep() {
if (this.err) throw new Error('Browser JS error '+this.err);
}
- Fixed
codecept listandcodecept defcommands. - Added
I.saymethod to print arbitrary comments.
I.say('I am going to publish post');
I.say('I enter title and body');
I.say('I expect post is visible on site');
- [Nightmare]
restartoption added.restart: falseallows to run all tests in a single window, disabled by default. By nairvijays99 - [Nightmare] Fixed
resizeWindowcommand. - [Protractor][SeleniumWebdriver] added
windowSizeconfig option to resize window on start. - Fixed "Scenario.skip causes 'Cannot read property retries of undefined'" by MasterOfPoppets
- Fixed providing absolute paths for tests in config by lennym
# 0.4.13
- Added retries option
FeatureandScenarioto rerun fragile tests:
Feature('Complex JS Stuff', {retries: 3});
Scenario('Not that complex', {retries: 1}, (I) => {
// test goes here
});
- Added timeout option
FeatureandScenarioto specify timeout.
Feature('Complex JS Stuff', {timeout: 5000});
Scenario('Not that complex', {timeout: 1000}, (I) => {
// test goes here
});
- [WebDriverIO] Added
uniqueScreenshotNamesoption to set unique screenshot names for failed tests. By APshenkin. See #299 - [WebDriverIO]
clearFieldmethod improved to accept name/label locators and throw errors. - [Nightmare][SeleniumWebdriver][Protractor]
clearFieldmethod added. - [Nightmare] Fixed
waitForElement, andwaitForVisiblemethods. - [Nightmare] Fixed
resizeWindowby norisk-it - Added italian translation.
# 0.4.12
- Bootstrap / Teardown improved with Hooks. Various options for setup/teardown provided.
- Added
--overrideor-ooption for runner to dynamically override configs. Valid JSON should be passed:
codeceptjs run -o '{ "bootstrap": "bootstrap.js"}'
codeceptjs run -o '{ "helpers": {"WebDriverIO": {"browser": "chrome"}}}'
- Added regression tests for codeceptjs tests runner.
# 0.4.11
- Fixed regression in 0.4.10
- Added
bootstrap/teardownconfig options to accept functions as parameters by pscanf. See updated config reference #319
# 0.4.10
- [Protractor] Protrctor 4.0.12+ support.
- Enabled async bootstrap file by abachar. Use inside
bootstrap.js:
module.exports = function(done) {
// async instructions
// call done() to continue execution
// otherwise call done('error description')
}
- Changed 'pending' to 'skipped' in reports by timja-kainos. See #315
# 0.4.9
- [SeleniumWebdriver][Protractor][WebDriverIO][Nightmare] fixed
executeScript,executeAsyncScriptto work and return values. - [Protractor][SeleniumWebdriver][WebDriverIO] Added
waitForInvisibleandwaitForStalenessOfmethods by Nighthawk14. - Added
--configoption tocodeceptjs runto manually specify config file by cnworks - [Protractor] Simplified behavior of
amOutsideAngularAppby usingignoreSynchronization. Fixes #278 - Set exit code to 1 when test fails at
Before/Afterhooks. Fixes #279
# 0.4.8
- [Protractor][SeleniumWebdriver][Nightmare] added
moveCursorTomethod. - [Protractor][SeleniumWebdriver][WebDriverIO] Added
manualStartoption to start browser manually in the beginning of test. By cnworks. [PR#250 - Fixed
codeceptjs initto work with nested directories and file masks. - Fixed
codeceptjs gtto generate test with proper file name suffix. By Zougi. - [Nightmare] Fixed: Error is thrown when clicking on element which can't be locate. By davetmik
- [WebDriverIO] Fixed
attachFilefor file upload. By giuband and davetmik - [WebDriverIO] Add support for timeouts in config and with
defineTimeoutsmethod. By easternbloc #258 and #267 by davetmik - Fixed hanging of CodeceptJS when error is thrown by event dispatcher. Fix by Zougi and davetmik
# 0.4.7
- Improved docs for
BeforeSuite; fixed its usage withrestart: falseoption by APshenkin. - Added
Nightmareto list of available helpers oninit. - [Nightmare] Removed double
resizeWindowimplementation.
# 0.4.6
- Added
BeforeSuiteandAfterSuitehooks to scenario by APshenkin. See updated documentation
# 0.4.5
- Fixed running
codecept defcommand by jankaspar - [Protractor][SeleniumWebdriver] Added support for special keys in
pressKeymethod. Fixes #216
# 0.4.4
- Interactive shell fixed. Start it by running
codeceptjs shell - Added
--profileoption toshellcommand to use dynamic configuration. - Added
--verboseoption toshellcommand for most complete output.
# 0.4.3
- [Protractor] Regression fixed to ^4.0.0 support
- Translations included into package.
teardownoption added to config (opposite tobootstrap), expects a JS file to be executed after tests stop.- Configuration can be set via JavaScript file
codecept.conf.jsinstead ofcodecept.json. It should exportconfigobject:
// inside codecept.conf.js
exports.config = {
// contents of codecept.json
}
- Added
--profileoption to pass its value tocodecept.conf.jsasprocess.profilefor dynamic configuration. - Documentation for StepObjects, PageFragments updated.
- Documentation for Configuration added.
# 0.4.2
- Added ability to localize tests with translation #189. Thanks to abner
- [Translation] ru-RU translation added.
- [Translation] pt-BR translation added.
- [Protractor] Protractor 4.0.4 compatibility.
- [WebDriverIO][SeleniumWebdriver][Protractor] Fixed single browser session mode for
restart: false - Fixed using of 3rd party reporters (xunit, mocha-junit-reporter, mochawesome). Added guide.
- Documentation for Translation added.
- Documentation for Reports added.
# 0.4.1
- Added custom steps to step definition list. See #174 by jayS-de
- [WebDriverIO] Fixed using
waitForTimeoutoption by stephane-ruhlmann. See #178
# 0.4.0
- Nightmare Helper added for faster web testing.
- [Protractor][SeleniumWebdriver][WebDriverIO] added
restart: falseoption to reuse one browser between tests (improves speed). - Protractor 4.0 compatibility. Please upgrade Protractor library.
- Added
--verboseoption forruncommand to log and print global promise and events. - Fixed errors with shutting down and cleanup.
- Fixed starting interactive shell with
codeceptjs shell. - Fixed handling of failures inside within block
# 0.3.5
- Introduced IDE autocompletion support for Visual Studio Code and others. Added command for generating TypeScript definitions for
Iobject. Use it as
codeceptjs def
to generate steps definition file and include it into tests by reference. By kaflan
# 0.3.4
- [Protractor] version 3.3.0 comptaibility, NPM 3 compatibility. Please update Protractor!
- allows using absolute path for helpers, output, in config and in command line. By denis-sokolov
- Fixes 'Cannot read property '1' of null in generate.js:44' by seethislight
# 0.3.3
Fixed global installation. CodeceptJS can now locate globally located modules. CodeceptJS is also recommended for local installation. Depending on installation type additional modules (webdriverio, protractor, ...) will be loaded either from local or from global path.
# 0.3.2
- Added
codeceptjs listcommand which shows all available methods ofIobject. - [Protractor][SeleniumWebdriver] fixed closing browser instances
- [Protractor][SeleniumWebdriver]
doubleClickmethod added - [WebDriverIO][Protractor][SeleniumWebdriver]
doubleClickmethod to locate clickable elements by text,contextoption added. - Fixed using assert in generator without yields #89
# 0.3.1
- Fixed
initcommand
# 0.3.0
Breaking Change: webdriverio package removed from dependencies list. You will need to install it manually after the upgrade. Starting from 0.3.0 webdriverio is not the only backend for running selenium tests, so you are free to choose between Protractor, SeleniumWebdriver, and webdriverio and install them.
- [Protractor] helper added. Now you can test AngularJS applications by using its official library within the unigied CodeceptJS API!
- [SeleniumWebdriver] helper added. You can switch to official JS bindings for Selenium.
- [WebDriverIO] updated to webdriverio v 4.0
- [WebDriverIO]
clearFieldmethod added by fabioel - [WebDriverIO] added
dragAndDropby fabioel - [WebDriverIO] fixed
scrollTomethod by sensone - [WebDriverIO] fixed
windowSize: maximizeoption in config - [WebDriverIO]
seeElementanddontSeeElementcheck element for visibility by fabioel and davertmik - [WebDriverIO]
seeElementInDOM,dontSeeElementInDOMadded to check element exists on page. - [WebDriverIO] fixed saving screenshots on failure. Fixes #70
- fixed
withinblock doesn't end in output not #79
# 0.2.8
- [WebDriverIO] added
seeNumberOfElementsby fabioel
# 0.2.7
- process ends with exit code 1 on error or failure #49
- fixed registereing global Helper #57
- fixed handling error in within block #50
# 0.2.6
- Fixed
done() was called multiple times - [WebDriverIO] added
waitToHidemethod by fabioel - Added global
Helper(aliascodecept_helper), object use for writing custom Helpers. Generator updated. Changes to #48
# 0.2.5
- Fixed issues with using yield inside a test #45 #47 #43
- Fixed generating a custom helper. Helper class is now accessible with
codecept_helpervar. Fixes #48
# 0.2.4
- Fixed accessing helpers from custom helper by pim.
# 0.2.3
- [WebDriverIO] fixed
seeInFieldto work with single value elements like: input[type=text], textareas, and multiple: select, input[type=radio], input[type=checkbox] - [WebDriverIO] fixed
pressKey, key modifeiers (Control, Command, Alt, Shift) are released after the action
# 0.2.2
Fixed generation of custom steps file and page objects.
Please replace require('codeceptjs/actor') to actor in your custom_steps.js.
Whenever you need to create I object (in page objects, custom steps, but not in tests) just call actor();
# 0.2.0
- within context hook added
--reporteroption supported- [WebDriverIO] added features and methods:
- elements:
seeElement, ... - popups:
acceptPopup,cancelPopup,seeInPopup,... - navigation:
moveCursorTo,scrollTo - saving screenshots on failure;
saveScreenshot - cookies:
setCookie,seeCookie, ... - source:
seeInSource - form:
seeCheckboxIsChecked,selectOptionto support multiple selects - keyboard:
appendField,pressKey - mouse:
rightClick
- elements:
- tests added
- [WebDriverIO] proxy configuration added by petehouston
- [WebDriverIO] fixed
waitForTextmethod by roadhump. Fixes #11 - Fixed creating output dir when it already exists on init by alfirin
- Fixed loading of custom helpers