codeceptjs
Advanced tools
Changelog
3.5.5
š Bug Fixes
export const caps = {
androidCaps: {
appiumV2: true,
host: "hub-cloud.browserstack.com",
port: 4444,
user: process.env.BROWSERSTACK_USER,
key: process.env.BROWSERSTACK_KEY,
'app': `bs://c700ce60cf13ae8ed97705a55b8e022f1hjhkjh3c5827c`,
browser: '',
desiredCapabilities: {
'appPackage': data.packageName,
'deviceName': process.env.DEVICE || 'Google Pixel 3',
'platformName': process.env.PLATFORM || 'android',
'platformVersion': process.env.OS_VERSION || '10.0',
'automationName': process.env.ENGINE || 'UIAutomator2',
'newCommandTimeout': 300000,
'androidDeviceReadyTimeout': 300000,
'androidInstallTimeout': 90000,
'appWaitDuration': 300000,
'autoGrantPermissions': true,
'gpsEnabled': true,
'isHeadless': false,
'noReset': false,
'noSign': true,
'bstack:options' : {
"appiumVersion" : "2.0.1",
},
}
},
}
I.switchTo({ css: 'iframe[id^=number-frame]' }) // support the strict locator
I.amOnPage('/iframe');
within({
frame: { css: '#number-frame-1234' }, // support the strict locator
}, () => {
I.fillField('user[login]', 'User');
I.fillField('user[email]', 'user@user.com');
I.fillField('user[password]', 'user@user.com');
I.click('button');
});
include: {
Je: './steps_file.js'
}
helpers: {
Playwright: {
bypassCSP: true
}
š©ļø Features and Improvements
Environment information:-
codeceptVersion: "3.5.4"
nodeInfo: 18.16.0
osInfo: macOS 13.5
cpuInfo: (8) arm64 Apple M1 Pro
chromeInfo: 116.0.5845.179
edgeInfo: 116.0.1938.69
firefoxInfo: Not Found
safariInfo: 16.6
helpers: {
"Playwright": {
"url": "https://github.com",
"show": false,
"browser": "chromium",
"waitForNavigation": "load",
"waitForTimeout": 30000,
"trace": false,
"keepTraceForPassedTests": true
},
"CDPHelper": {
"require": "./helpers/CDPHelper.ts"
},
"OpenAI": {
"chunkSize": 8000
},
"ExpectHelper": {
"require": "codeceptjs-expect"
},
"REST": {
"endpoint": "https://reqres.in",
"timeout": 20000
},
"AllureHelper": {
"require": "./helpers/AllureHelper.ts"
}
}
plugins: {
"screenshotOnFail": {
"enabled": true
},
"tryTo": {
"enabled": true
},
"retryFailedStep": {
"enabled": true
},
"retryTo": {
"enabled": true
},
"eachElement": {
"enabled": true
},
"pauseOnFail": {}
}
***************************************
If you have questions ask them in our Slack: http://bit.ly/chat-codeceptjs
Or ask them on our discussion board: https://codecept.discourse.group/
Please copy environment info when you report issues on GitHub: https://github.com/Codeception/CodeceptJS/issues
***************************************
CodeceptJS v3.5.4 #StandWithUkraine
await I.amOnPage('/form/field_values');
await I.dontSeeInField('checkbox[]', secret('not seen one'));
await I.seeInField('checkbox[]', secret('see test one'));
await I.dontSeeInField('checkbox[]', secret('not seen two'));
await I.seeInField('checkbox[]', secret('see test two'));
await I.dontSeeInField('checkbox[]', secret('not seen three'));
await I.seeInField('checkbox[]', secret('see test three'));
š©ļø Several bugfixes and improvements for Codecept-UI
Changelog
3.5.4
š Bug Fixes:
userDataDir
, it throws error after test execution (#3814) - by @KobeNguyenTall
with run-workers
(#3805) - by @KobeNguyenT helpers: {
Playwright: {
url: 'https://github.com',
show: false,
browser: 'chromium',
waitForNavigation: 'load',
waitForTimeout: 30_000,
trace: true,
keepTraceForPassedTests: true
},
},
multiple: {
profile1: {
browsers: [
{
browser: "chromium",
}
]
},
},
 
symbol in I.see
method (#3815) - by @KobeNguyenT// HTML code uses instead of space
<div class="dJHe_" style="color: rgb(255, 255, 255);">My Text!</div>
I.see("My Text!") // this test would work with both and space
š Documentation
const path = require("path");
exports.config = {
helpers: {
Playwright: {
browser: "electron",
electron: {
executablePath: require("electron"),
args: [path.join(__dirname, ".webpack/main/index.js")],
},
},
},
// rest of config
}
š©ļø Features
const traffics = await I.grabRecordedNetworkTraffics();
expect(traffics[0].url).to.equal('https://reqres.in/api/comments/1');
expect(traffics[0].response.status).to.equal(200);
expect(traffics[0].response.body).to.contain({ name: 'this was mocked' });
expect(traffics[1].url).to.equal('https://reqres.in/api/comments/1');
expect(traffics[1].response.status).to.equal(200);
expect(traffics[1].response.body).to.contain({ name: 'this was another mocked' });
const metrics = await I.grabMetrics();
// returned metrics
[
{ name: 'Timestamp', value: 1584904.203473 },
{ name: 'AudioHandlers', value: 0 },
{ name: 'AudioWorkletProcessors', value: 0 },
{ name: 'Documents', value: 22 },
{ name: 'Frames', value: 10 },
{ name: 'JSEventListeners', value: 366 },
{ name: 'LayoutObjects', value: 1240 },
{ name: 'MediaKeySessions', value: 0 },
{ name: 'MediaKeys', value: 0 },
{ name: 'Nodes', value: 4505 },
{ name: 'Resources', value: 141 },
{ name: 'ContextLifecycleStateObservers', value: 34 },
{ name: 'V8PerContextDatas', value: 4 },
{ name: 'WorkerGlobalScopes', value: 0 },
{ name: 'UACSSResources', value: 0 },
{ name: 'RTCPeerConnections', value: 0 },
{ name: 'ResourceFetchers', value: 22 },
{ name: 'AdSubframes', value: 0 },
{ name: 'DetachedScriptStates', value: 2 },
{ name: 'ArrayBufferContents', value: 1 },
{ name: 'LayoutCount', value: 0 },
{ name: 'RecalcStyleCount', value: 0 },
{ name: 'LayoutDuration', value: 0 },
{ name: 'RecalcStyleDuration', value: 0 },
{ name: 'DevToolsCommandDuration', value: 0.000013 },
{ name: 'ScriptDuration', value: 0 },
{ name: 'V8CompileDuration', value: 0 },
{ name: 'TaskDuration', value: 0.000014 },
{ name: 'TaskOtherDuration', value: 0.000001 },
{ name: 'ThreadTime', value: 0.000046 },
{ name: 'ProcessTime', value: 0.616852 },
{ name: 'JSHeapUsedSize', value: 19004908 },
{ name: 'JSHeapTotalSize', value: 26820608 },
{ name: 'FirstMeaningfulPaint', value: 0 },
{ name: 'DomContentLoaded', value: 1584903.690491 },
{ name: 'NavigationStart', value: 1584902.841845 }
]
flushWebSocketMessages
grabWebSocketMessages
startRecordingWebSocketMessages
stopRecordingWebSocketMessages
await I.startRecordingWebSocketMessages();
I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
I.flushNetworkTraffics();
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.equal(0);
await I.startRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const wsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.greaterThan(0);
await I.startRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const wsMessages = I.grabWebSocketMessages();
await I.stopRecordingWebSocketMessages();
await I.amOnPage('https://websocketstest.com/');
I.waitForText('Work for You!');
const afterWsMessages = I.grabWebSocketMessages();
expect(wsMessages.length).to.equal(afterWsMessages.length);
ElementHandle
to Locator
. This change is quite major, but it happened under hood, so should not affect your code. (#3738) - by @KobeNguyenTChangelog
3.5.3
š©ļø Features
startRecordingTraffic
grabRecordedNetworkTraffics
blockTraffic
mockTraffic
flushNetworkTraffics
stopRecordingTraffic
seeTraffic
grabTrafficUrl
dontSeeTraffic
Examples:
// recording traffics and verify the traffic
await I.startRecordingTraffic();
I.amOnPage('https://codecept.io/');
await I.seeTraffic({ name: 'traffics', url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg' });
// block the traffic
I.blockTraffic('https://reqres.in/api/comments/*');
await I.amOnPage('/form/fetch_call');
await I.startRecordingTraffic();
await I.click('GET COMMENTS');
await I.see('Can not load data!');
// check the traffic with advanced params
I.amOnPage('https://openai.com/blog/chatgpt');
await I.startRecordingTraffic();
await I.seeTraffic({
name: 'sentry event',
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
parameters: {
width: '1919',
height: '1138',
},
});
š Bugfix
š Deprecated
Changelog
3.5.2
š Bug Fixes
clearField
to previous implementationChangelog
3.5.1
š©ļø Features
blur
focus
I.
commands` by @davertmik #3739codecept init
setup for Electron tests by @KobeNguyenT. See #3733š Bug Fixes
š Documentation
Changelog
3.5.0
š©ļø Features
šŖ AI Powered Test Automation - use OpenAI as a copilot for test automation. #3713 By @davertmik
pause()
heal
plugin for self-healing testsOpenAI
helper[Playwright][Puppeteer][WebDriver] Highlight the interacting elements in debug mode or with highlightElement
option set (#3672) - by @KobeNguyenT
[Playwright] Support for APIs in Playwright (#3665) - by Egor Bodnar
clearField
replaced to use new Playwright APIblur
addedfocus
addedAdded support for multiple browsers in run-workers
(#3606) by @karanshah-browserstack :
Multiple browsers configured as profiles:
exports.config = {
helpers: {
WebDriver: {
url: 'http://localhost:3000',
}
},
multiple: {
profile1: {
browsers: [
{
browser: "firefox",
},
{
browser: "chrome",
}
]
},
And executed via run-workers
with all
argument
npx codeceptjs run-workers 2 all
gpo
command to create page objects as modules or as classes (#3625) - by @KobeNguyenTemptyOutputFolder
config to clean up output before running tests (#3604) - by @KobeNguyenTsecret()
function support to append()
and type()
(#3615) - by @anils92bypassCSP
option to helper's config (#3641) - by @KobeNguyenTš Bug Fixes
--grep
in dry-run command (#3673) - by @KobeNguyenTChangelog
3.4.1
Changelog
3.4.0
Feature('flaky Before & BeforeSuite', { retryBefore: 2, retryBeforeSuite: 3 })
retry: [
{
// enable this config only for flaky tests
grep: '@flaky',
Before: 3 // retry Before 3 times
Scenario: 3 // retry Scenario 3 times
},
{
// retry less when running slow tests
grep: '@slow'
Scenario: 1
Before: 1
}, {
// retry all BeforeSuite 3 times
BeforeSuite: 3
}
]
timeout: [
10, // default timeout is 10secs
{ // but increase timeout for slow tests
grep: '@slow',
Feature: 50
},
]
I.say
. See #3535 by @danielrentzhandleDownloads
requires now a filename param. See #3511 by @PeterNgTr