codeceptjs
Advanced tools
Changelog
1.0.2
BeforeSuite
/Before
/AfterSuite
/After
requireg
package included.run-multiple
: the first browser-resolution combination was be used in all configurationsuniqueScreenshotNames: true
amOutsideAngularApp
is executed before each step. Fixes #458* Added output for steps in hooks when they failChangelog
1.0.1
addMochawesomeContext
method to add custom data to mochawesome reportsrefresh
function by @awhanksUnhandled promise rejection (rejection id: 1): Error: Unknown wait type: pageLoad
[Wrapped Error] "codeceptjs is not defined"
; Reinjectiing client scripts to a webpage on changes.Wait*
methodsretries
optionCodeceptJS 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('davert@codecept.io', '~email of the customer'));
I.clearField('~email of the customer'));
I.dontSee('Nothing special', '~email of the customer'));
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
within
command with generators.--debug
mode. #591 by @APshenkindisableScreenshots
option to disable screenshots on fail by @ApshenkinuniqueScreenshotNames
option to generate unique names for screenshots on failure by @Apshenkinclick('text', '#el')
will throw exception if text is not found inside #el
.saveScreenshot
for PhantomJS, fullPageScreenshots
option introduced by @HughZurname #549seeNumberOfVisibleElements
by @BorisOsipov #574_beforeSuite
hooks from helpers -> BeforeSuite
from test -> _before
hooks from helpers -> Before
from test - > Test steps -> _failed
hooks from helpers (if test failed) -> After
from test -> _after
hooks from helpers -> AfterSuite
from test -> _afterSuite
hook from helpers.restart
option is false - close all tabs expect one in _after
._after
, _afterSuite
hooks even After/AfterSuite from test was failedrestart
option is false. We should start browser only one time and close it only after all tests.keepCookies
flag is enabled_locate
Special thanks to Andrey Pshenkin for his work on this release and the major improvements.
Changelog
0.6.3
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.
docs
directory to a package.restart: false
by @tfiwm #519saveScreenshot
to allow a full page screenshot. By @HughZurnamesuite.before
and suite.after
events by @implico. #496Changelog
0.6.2
config
object to public APIindex.js
to include actor
and helpers
, so they could be required:const actor = require('codeceptjs').actor;
output
directory if it doesn't existChangelog
0.6.0
Major release with extension API and parallel execution.
run
. To specify path other than current directory use --config
or -c
option:Instead of: codeceptjs run tests
use:
# load config and run from tests directory
codeceptjs run -c tests/
Changelog
0.5.1
getAttributeFrom
for custom attributes by @robrkerrselectOption
by @robrkerr. [Se PR.pressKey
method by @romanovmaChangelog
0.5.0
waitTimeout
by @HughZurname. See #391. Resolves #236* Dockerized CodeceptJS setup by @artiomnist. See reference