codeceptjs
Advanced tools
Changelog
1.1.3
_locateCheckable
_locateClickable
_locateFields
closeOtherTabs
dragAndDrop
grabBrowserLogs
grabCssPropertyFrom
grabHTMLFrom
grabNumberOfVisibleElements
grabSource
rightClick
scrollPageToBottom
scrollPageToTop
scrollTo
seeAttributesOnElements
seeCssPropertiesOnElements
seeInField
seeNumberOfElements
seeNumberOfVisibleElements
seeTextEquals
seeTitleEquals
switchTo
waitForInvisible
waitInUrl
waitUrlEquals
closeCurrentTab
grabSource
openNewTab
seeNumberOfElements
seeTextEquals
seeTitleEquals
switchToNextTab
switchToPreviousTab
waitForInvisible
added by @reubenmillernightmare-har-plugin
by mingfang. Added enableHAR
option. Added HAR functions:
grabHAR
saveHAR
resetHAR
Changelog
1.1.2
grep
option to config to set default matching pattern for tests.acceptPopup
, cancelPopup
, seeInPopup
and grabPopupText
functions by @reubenmillerwithin
iframe and nested iframe support added by @reubenmillerresetRequestHeaders
method by @KalostrinhofollowRedirect
option and amFollowingRequestRedirects
/amNotFollowingRequestRedirects
methods by @KalostrinhouncheckOption
implemented by @brunobggrabBrowserUrl
by @Kalostrinho--profile
option to run-multiple
command by @jamie-beckChangelog
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.
angular: false
instead.within({frame: ['#wrapperId', '[name=content]']}, () => {
I.click('Sign in!');
I.see('Email Address');
});
I.see('Nested Iframe test');
I.dontSee('Email Address');
});
~
locator to find elements by aria-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
haveRequestHeaders
in sendPostRequest
. By @petrisorionelmultiple-run
by @trollrChangelog
1.0.3
waitUntilExists
implemented by @sabauoutput
dir by @APshenkin. Fix #571* Data table rows can be ignored by using xadd
. By @APhenkinData(table).only.Scenario
to give ability to launch only Data tests. By @APhenkinElementNotFound
error by @BorisOsipov.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. #496