- 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
- Fixed loading hooks
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:
- 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. See PR. - [Protractor] fixed
pressKeymethod by @romanovma
- 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
- 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.
- Fixed regression in recorder sessions:
oldpromise is not defined.
_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
- 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.
- 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.
- Fixed regression in 0.4.10
- Added
bootstrap/teardownconfig options to accept functions as parameters by @pscanf. See updated config reference #319
- [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
- [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
- [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
- Improved docs for
BeforeSuite; fixed its usage withrestart: falseoption by @APshenkin. - Added
Nightmareto list of available helpers oninit. - [Nightmare] Removed double
resizeWindowimplementation.
- Added
BeforeSuiteandAfterSuitehooks to scenario by @APshenkin. See updated documentation
- Fixed running
codecept defcommand by @jankaspar - [Protractor][SeleniumWebdriver] Added support for special keys in
pressKeymethod. Fixes #216
- Interactive shell fixed. Start it by running
codeceptjs shell - Added
--profileoption toshellcommand to use dynamic configuration. - Added
--verboseoption toshellcommand for most complete output.
- [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.
- 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.
- Added custom steps to step definition list. See #174 by @jayS-de
- [WebDriverIO] Fixed using
waitForTimeoutoption by @stephane-ruhlmann. See #178
- 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
- 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
- [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
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.
- 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
- Fixed
initcommand
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
- [WebDriverIO] added
seeNumberOfElementsby @fabioel
- process ends with exit code 1 on error or failure #49
- fixed registereing global Helper #57
- fixed handling error in within block #50
- 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
- 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
- Fixed accessing helpers from custom helper by @pim.
- [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
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();
- 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