codeceptjs
Advanced tools
Changelog
0.4.16
keepCookies
option to keep cookies between tests with restart: false
.waitForTimeout
config option to set default waiting time for all wait* functions._test
hook for helpers by @cjhille.Changelog
0.4.14
_beforeStep
and _afterStep
hooks in helpers are synchronized. Allows to perform additional actions between steps.Example: fail if JS error occur in custom helper using WebdriverIO:
_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);
}
codecept list
and codecept def
commands.I.say
method 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');
restart
option added. restart: false
allows to run all tests in a single window, disabled by default. By @nairvijays99resizeWindow
command.windowSize
config option to resize window on start.Changelog
0.4.13
Feature
and Scenario
to rerun fragile tests:Feature('Complex JS Stuff', {retries: 3});
Scenario('Not that complex', {retries: 1}, (I) => {
// test goes here
});
Feature
and Scenario
to specify timeout.Feature('Complex JS Stuff', {timeout: 5000});
Scenario('Not that complex', {timeout: 1000}, (I) => {
// test goes here
});
uniqueScreenshotNames
option to set unique screenshot names for failed tests. By @APshenkin. See #299clearField
method improved to accept name/label locators and throw errors.clearField
method added.waitForElement
, and waitForVisible
methods.resizeWindow
by @norisk-itChangelog
0.4.12
--override
or -o
option for runner to dynamically override configs. Valid JSON should be passed:codeceptjs run -o '{ "bootstrap": "bootstrap.js"}'
codeceptjs run -o '{ "helpers": {"WebDriverIO": {"browser": "chrome"}}}'
Changelog
0.4.11
bootstrap
/teardown
config options to accept functions as parameters by @pscanf. See updated config reference #319Changelog
0.4.10
bootstrap.js
:module.exports = function(done) {
// async instructions
// call done() to continue execution
// otherwise call done('error description')
}
Changelog
0.4.9
executeScript
, executeAsyncScript
to work and return values.waitForInvisible
and waitForStalenessOf
methods by @Nighthawk14.--config
option to codeceptjs run
to manually specify config file by @cnworksamOutsideAngularApp
by using ignoreSynchronization
. Fixes #278Before
/After
hooks. Fixes #279Changelog
0.4.8
moveCursorTo
method.manualStart
option to start browser manually in the beginning of test. By @cnworks. [PR#250codeceptjs init
to work with nested directories and file masks.codeceptjs gt
to generate test with proper file name suffix. By @Zougi.attachFile
for file upload. By @giuband and @davetmikdefineTimeouts
method. By @easternbloc #258 and #267 by @davetmik