codeceptjs
Advanced tools
Changelog
1.4.3
tag()
method to ScenarioConfig and FeatureConfig:Scenario('update user profile', () => {
// test goes here
}).tag('@slow');
multiple.parallel.chunks
as environment variable in config. See #1238 by @ngadiyakChangelog
1.4.2
outputDir
for allure) by @jplegoffChangelog
1.4.1
plugins
option to run-multiple
Changelog
1.4.0
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.executeAsyncScript
unexpected token by @jonathanzoverride
option to run-multiple
command by @svarletChangelog
1.3.2
pause()
next
command for step-by-step debug when using pause()
.After(pause);
in a to start interactive console after last step.waitForRequest
to wait for network request.waitForResponse
to wait for network response../
by @BenoitZugmeyerChangelog
1.3.1
getPageTimeout
set 0 seconds.restart:false
mode for multi-session mode.grabPopupText
to not throw error popup is not opened.Changelog
1.3.0
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
run
command 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.
--steps
flag.--debug
._init()
extra method. Try updated generators and see updated guide.load
event on page load. This strategy can be changed in config:
waitForNavigation
config option introduced. Possible options: load
, domcontentloaded
, networkidle0
, networkidle2
. See Puppeteer APIgetPageTimeout
config option to set maximum navigation time in milliseconds. Default is 30 seconds.waitForNavigation
method added. Explicitly waits for navigation to be finished.grabTextFrom
unified. Return a text for single matched element and an array of texts for multiple elements.resizeWindow
by @sergejkaravajnijwaitForFunction
added. Waits for client-side JavaScript function to return true by @GREENpoint.waitUntil
deprecated in favor of waitForFunction
.filter
function to DataTable.waitUntil
timeout accepts time in seconds (as all other wait* functions). Fix by @truesrc.grabNumberOfVisibleElements
to work similarly to seeElement
. Thx to @stefanschenk and Jinbo Jinboson.Changelog
1.2.1
I.retry()
on multiple steps.grabNumberOfVisibleElements
to return 0
instead of throwing error if no elements are found.Changelog
1.2.0
session
command, 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');
});
"multiple": {
"parallel": {
// run in 2 processes
"chunks": 2,
// run all tests in chrome
"browsers": ["chrome"]
},
}
// select 'Edit' link inside 2nd row of a table
locate('//table')
.find('tr')
.at(2)
.find('a')
.withText('Edit');
event.test.finished
which fires synchronously for both failed and passed tests.fullPageScreenshots: true
, however they may work unstable in Selenium.within
blocks can return values. See updated documentation._init
in helpers. Fixes issue #1036Feature('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);