SCG82 on replace-lerna-bootstrap-pnpm
fix custom command code example… Provide mock primitives from `@… v8.3.3 and 3 more (compare)
github-actions[bot] on v8.3.4
v8.3.4 (compare)
github-actions[bot] on main
v8.3.4 (compare)
github-actions[bot] on v8.3.4
christian-bromann on main
mock node:os (compare)
github-actions[bot] on v8.3.3
v8.3.3 (compare)
github-actions[bot] on main
v8.3.3 (compare)
github-actions[bot] on v8.3.3
christian-bromann on cb-mock-feature
christian-bromann on main
Provide mock primitives from `@… (compare)
Hello, I want to make a visual test in a loop, at the moment for some reason 1 url test passes but does not save the screenshot in the database, only screenshot 2 remains. I don’t understand what the problem is, tell me what’s wrong?
describe('4', async () => {
const links = [
{url: ['https://webdriver.io/docs/why-webdriverio']},
{url: ['https://webdriver.io/docs/driverbinaries']}
];
let id = 0;
links.forEach(({url}) => {
id++;
/** Test 1 Save */
it(`${id.toString()}_${url.toString()}`, async () => {
addFeature(id.toString())
await browser.url(url.toString());
await browser.setWindowSize(1280, 1024);
await browser.saveFullPageScreen(id.toString(), { /* some options */});
});
/** Test 2 Check*/
it(`${id.toString()}`, async () => {
addFeature(id.toString())
expect(await browser.checkFullPageScreen(id.toString(), { /* some options */})).toEqual(0);
});
});
Result:
✓ 1_https://webdriver.io/docs/why-webdriverio_Save
✓ 1_Check
✓ 2_https://webdriver.io/docs/driverbinaries_Save
✖ 2_Check
TypeError: expect(...).withContext is not a function
. Also, if I do not add "@types/jasmine": "4.3.1"
to (dev) dependencies some types are missing. I find this weird as https://github.com/webdriverio/webdriverio/blob/main/packages/wdio-jasmine-framework/package.json has these types. Any ideas?
Hello!
I'm trying to run some WebDriverIO tests using a proxy server, I checked how to do it on the WebdriverIO documentation and it suggested me to use GlobalAgent package - https://webdriver.io/docs/proxy/
The thing is that when I enable the global agent, the tests are taking a very long time to execute, anyone knows why? I tried using it with PlayWright but the tests are running in normal speed and for the scenario I'm currently testing I need to do it with WebdriverIO.
I have no error messages, it just takes tons of time to execute the tests and the build gets stuck sometimes
WebDriverIO version: 7.25.2
NodeJS version: 19.4.0
Global Agent version: 3.0.0
Hi, My existing protractor application is having pageobjects in chained manner. I need to rewrite to wdio. method2 gives error as TypeError: Cannot read peroperties of undefined (reading method2)
spec file holds chained click as below
let rootPO: root;
await rootPO.method2.method3.method4.click();
export class root{
constructor(){
return $("app-root");//return by.css("app-root");
}
get method2(): side{
return new side($("app-side-bar"));//return new side(by.css("app-side-bar"));
}
}
export class side extends page{
get method3(){
return new department(this.container($("#appDeptSection")));//return new department(this.container(by.id("#appDeptSection")));
}
}
export class department extends page{
get method4(){
return this.container($(".dept .caption"));//return this.container(by.css(".dept .caption"));
}
}
export class page{
constructor(protected container){}
}
administrator@SSTSL1192:~/Desktop/Chapter_2$ npx wdio run ./wdio.iOS.conf.js
Execution of 1 workers started at 2023-01-30T18:03:11.098Z
2023-01-30T18:03:11.115Z INFO @wdio/cli:launcher: Run onPrepare hook
<<< NATIVE APP TESTS STARTED >>>
2023-01-30T18:03:11.117Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2023-01-30T18:03:11.118Z INFO @wdio/local-runner: Start worker 0-0 with arg: run,./wdio.iOS.conf.js
[0-0] 2023-01-30T18:03:11.658Z INFO @wdio/local-runner: Run worker command: run
[0-0] RUNNING in iOS - file:///test/specs/TestCaseiOS.js
[0-0] 2023-01-30T18:03:11.695Z INFO webdriver: Initiate new session using the WebDriver protocol
[0-0] 2023-01-30T18:03:11.759Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session
[0-0] 2023-01-30T18:03:11.759Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
[0-0] browserName: '',
[0-0] pCloudy_Username: 'EnterEmail',
[0-0] pCloudy_ApiKey: 'EnterAPIKey',
[0-0] pCloudy_ApplicationName: 'TestmunkDemo_Resigned1675100182.ipa',
[0-0] pCloudy_DurationInMinutes: '10',
[0-0] pCloudy_DeviceFullName: 'APPLE_iPadMini2_iOS_12.5.0_3f117',
[0-0] platformName: 'iOS',
[0-0] platformVersion: '12.5',
[0-0] automationName: 'XCUITest',
[0-0] newCommandTimeout: '600',
[0-0] launchTimeout: '90000',
[0-0] bundleId: 'com.pcloudy.TestmunkDemo'
[0-0] },
[0-0] firstMatch: [ {} ]
[0-0] },
[0-0] desiredCapabilities: {
[0-0] browserName: '',
[0-0] pCloudy_Username: 'EnterEmail',
[0-0] pCloudy_ApiKey: 'Enter APIKey',
[0-0] pCloudy_ApplicationName: 'TestmunkDemo_Resigned1675100182.ipa',
[0-0] pCloudy_DurationInMinutes: '10',
[0-0] pCloudy_DeviceFullName: 'APPLE_iPadMini2_iOS_12.5.0_3f117',
[0-0] platformName: 'iOS',
[0-0] platformVersion: '12.5',
[0-0] automationName: 'XCUITest',
[0-0] newCommandTimeout: '600',
[0-0] launchTimeout: '90000',
[0-0] bundleId: 'com.pcloudy.TestmunkDemo'
[0-0] }
[0-0] }
[0-0] 2023-01-30T18:03:50.668Z INFO webdriver: COMMAND findElement("xpath", "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeTextField[1]")
[0-0] 2023-01-30T18:03:50.669Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element
[0-0] 2023-01-30T18:03:50.669Z INFO webdriver: DATA {
[0-0] using: 'xpath',
[0-0] value: '//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeTextField[1]'
[0-0] }
[0-0] 2023-01-30T18:03:51.469Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '0B000000-0000-0000-E300-000000000000',
[0-0] ELEMENT: '0B000000-0000-0000-E300-000000000000'
[0-0] }
[0-0] 2023-01-30T18:03:51.479Z INFO webdriver: COMMAND elementClear("0B000000-0000-0000-E300-000000000000")
[0-0] 2023-01-30T18:03:51.479Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0B000000-0000-0000-E300-000000000000/clear
[0-0] 2023-01-30T18:03:54.336Z INFO webdriver: RESULT null
[0-0] 2023-01-30T18:03:54.337Z INFO webdriver: COMMAND elementSendKeys("0B000000-0000-0000-E300-000000000000", "test@testname.com")
[0-0] 2023-01-30T18:03:54.337Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0B000000-0000-0000-E300-000000000000/value
[0-0] 2023-01-30T18:03:54.337Z INFO webdriver: DATA { text: 'test@testname.com' }
[0-0] 2023-01-30T18:03:55.051Z INFO webdriver: RESULT null
[0-0] Email id is entered
[0-0] 2023-01-30T18:03:55.052Z INFO webdriver: COMMAND findElement("xpath", "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeSecureTextField[1]")
[0-0] 2023-01-30T18:03:55.053Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element
[0-0] 2023-01-30T18:03:55.053Z INFO webdriver: DA
Email id is entered
[0-0] 2023-01-30T18:03:55.052Z INFO webdriver: COMMAND findElement("xpath", "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeSecureTextField[1]")
[0-0] 2023-01-30T18:03:55.053Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element
[0-0] 2023-01-30T18:03:55.053Z INFO webdriver: DATA {
[0-0] using: 'xpath',
[0-0] value: '//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeSecureTextField[1]'
[0-0] }
[0-0] 2023-01-30T18:03:56.691Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '0D000000-0000-0000-E300-000000000000',
[0-0] ELEMENT: '0D000000-0000-0000-E300-000000000000'
[0-0] }
[0-0] 2023-01-30T18:03:56.697Z INFO webdriver: COMMAND elementClear("0D000000-0000-0000-E300-000000000000")
[0-0] 2023-01-30T18:03:56.697Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0D000000-0000-0000-E300-000000000000/clear
[0-0] 2023-01-30T18:03:58.636Z INFO webdriver: RESULT null
[0-0] 2023-01-30T18:03:58.636Z INFO webdriver: COMMAND elementSendKeys("0D000000-0000-0000-E300-000000000000", "<Screenshot[base64]>")
[0-0] 2023-01-30T18:03:58.637Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0D000000-0000-0000-E300-000000000000/value
[0-0] 2023-01-30T18:03:58.637Z INFO webdriver: DATA { text: 'testmunk' }
[0-0] 2023-01-30T18:03:59.148Z INFO webdriver: RESULT null
[0-0] password is entered
[0-0] 2023-01-30T18:03:59.149Z INFO webdriver: COMMAND findElement("xpath", "//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]")
[0-0] 2023-01-30T18:03:59.150Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element
[0-0] 2023-01-30T18:03:59.150Z INFO webdriver: DATA {
[0-0] using: 'xpath',
[0-0] value: '//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]'
[0-0] }
[0-0] 2023-01-30T18:04:00.376Z INFO webdriver: RESULT {
[0-0] 'element-6066-11e4-a52e-4f735466cecf': '0F000000-0000-0000-E300-000000000000',
[0-0] ELEMENT: '0F000000-0000-0000-E300-000000000000'
[0-0] }
[0-0] 2023-01-30T18:04:00.388Z INFO webdriver: COMMAND isElementDisplayed("0F000000-0000-0000-E300-000000000000")
[0-0] 2023-01-30T18:04:00.389Z INFO webdriver: [GET] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0F000000-0000-0000-E300-000000000000/displayed
[0-0] Error in "Demo App Testing Login Functionality"
at <Jasmine>
at listOnTimeout (node:internal/timers:568:17)
at process.processTimers (node:internal/timers:511:7)
[0-0] 2023-01-30T18:04:00.686Z INFO webdriver: COMMAND deleteSession()
[0-0] 2023-01-30T18:04:00.687Z INFO webdriver: [DELETE] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd
[0-0] 2023-01-30T18:04:00.703Z INFO webdriver: RESULT true
[0-0] 2023-01-30T18:04:00.705Z INFO webdriver: COMMAND elementClick("0F000000-0000-0000-E300-000000000000")
[0-0] 2023-01-30T18:04:00.705Z INFO webdriver: [POST] https://device.pcloudy.com/appiumcloud/wd/hub/session/77aef42c-5ec5-45f8-b9c2-78fd222321dd/element/0F000000-0000-0000-E300-000000000000/click
[0-0] 2023-01-30T18:04:02.323Z INFO webdriver: RESULT null
[0-0] login button is clicked
[0-0] 2023-01-30T18:04:03.340Z INFO webdriver: RESULT null
[0-0] FAILED in iOS - file:///test/specs/TestCaseiOS.js
2023-01-30T18:04:03.469Z INFO @wdio/cli:launcher: Run onWorkerEnd hook
2023-01-30T18:04:03.471Z INFO @wdio/cli:launcher: Run onComplete hook
<<< TESTING FINISHED >>>
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:52
2023-01-30T18:04:03.474Z INFO @wdio/local-runner: Shutting down spawned worker
2023-01-30T18:04:03.729Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-01-30
var path = import('path');
describe('Demo App Testing', () => {
it('Login Functionality', async () => {
const EnterEmail= await $('//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeTextField[1]');
await EnterEmail.setValue('test@testname.com');
console.log("Email id is entered");
const EnterPasword = await $('//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeSecureTextField[1]');
await EnterPasword.setValue('testmunk');
console.log("password is entered");
const Login= await $('//XCUIElementTypeApplication[1]/XCUIElementTypeWindow[1]/XCUIElementTypeOther[1]/XCUIElementTypeButton[1]');
await Login.waitForDisplayed({ timeout: 30000 });
await Login.click();
console.log("login button is clicked");
//browser.closeApp();
});
});
protocol: 'https',
hostname: 'device.pcloudy.com',
port: 443,
path: '/appiumcloud/wd/hub',
//
// ==================
// Specify Test Files
// ==================
// Define which test specs should run. The pattern is relative to the directory
// from which `wdio` was called. Notice that, if you are calling `wdio` from an
// NPM script (see https://docs.npmjs.com/cli/run-script) then the current working
// directory is where your package.json resides, so `wdio` will be called from there.
//
specs: [
'./test/specs/**/TestCaseiOS.js'
],
exclude: [
// 'path/to/excluded/files'
],
//
// ============
// Capabilities
// ============
// Define your capabilities here. WebdriverIO can run multiple capabilities at the same
// time. Depending on the number of capabilities, WebdriverIO launches several test
// sessions. Within your capabilities you can overwrite the spec and exclude options in
// order to group specific specs to a specific capability.
//
// First, you can define how many instances should be started at the same time. Let's
// say you have 3 different capabilities (Chrome, Firefox, and Safari) and you have
// set maxInstances to 1; wdio will spawn 3 processes. Therefore, if you have 10 spec
// files and you set maxInstances to 10, all spec files will get tested at the same time
// and 30 processes will get spawned. The property handles how many capabilities
// from the same test should run tests.
//
// If you have trouble getting all important capabilities together, check out the
//
capabilities: [{
browserName: '',
pCloudy_Username: 'abhinav.purokait@sstsinc.com',
pCloudy_ApiKey: '49zfjq28dxchvnxgg35nqpfd',
pCloudy_ApplicationName: 'TestmunkDemo_Resigned1675100182.ipa',
pCloudy_DurationInMinutes: '10',
pCloudy_DeviceFullName: 'APPLE_iPadMini2_iOS_12.5.0_3f117',
//pCloudy_DeviceManafacturer is an optional capability
//pCloudy_DeviceManafacturer: 'Apple',
//pCloudy_DeviceVersion is an optional capability
//pCloudy_DeviceVersion: '11.2.0',
platformName: 'iOS',
platformVersion: '12.5',
automationName: 'XCUITest',
newCommandTimeout: '600',
launchTimeout: '90000',
bundleId: 'com.pcloudy.TestmunkDemo',
}],
//
// ===================
// Test Configurations
// ===================
// Define all options that are relevant for the WebdriverIO instance here
//
// By default WebdriverIO commands are executed in a synchronous way using
// the wdio-sync package. If you still want to run your tests in an async way
// e.g. using promises you can set the sync option to false.
sync: true,
//
//Level of logging verbosity: silent | verbose | command | data | result | error
//logLevel: 'silent',
//Enables colors for log output.
coloredLogs: true,
//
// Warns when a deprecated command is used
deprecationWarnings: true,
//
// If you only want to run your tests until a specific amount of tests have failed use
// bail (default is 0 - don't bail, run all tests).
bail: 1,
//
// Saves a screenshot to a given path if a command fails.
screenshotPath: './errorShots/',
//
// Set a base URL in order to shorten url command calls. If your `url` parameter starts
// with `/`, the base url gets prepended, not including the path portion of your baseUrl.
// If your `url` parameter starts without a scheme or `/` (like `some/path`), the base url
// gets prepended directly.
// baseUrl: '(http://127.0.0.1:4723/wd/hub)',
baseUrl: 'https://device.pcloudy.com',
//
// Default timeout for all waitFor* commands.
waitforTimeout: 10000,
//
// Default timeout in milliseconds for request
// if Selenium Grid doesn't send response
connectionRetryTimeout: 900
I installed wdio and getting below error. Can someone help me what is causing it?
Its a new install and i have mentioned the chromedriver path
DevTools listening on ws://127.0.0.1:62759/devtools/browser/d0efa7f4-e265-4544-aa2d-7ad67fb656d9
[0-0] Error: Unable to load spec files quite likely because they rely on browser
object that is not fully initialised.browser
object has only capabilities
and some flags like isMobile
.
Helper files that use other browser
commands have to be moved to before
hook.
Spec file(s): file:///D:/webdriver/sreetest/test/specs/example.e2e.js
Error: Error: Cannot find module 'D:\webdriver\sreetest\file:\D:\webdriver\sreetest\test\specs\example.e2e.js'
Require stack:
Spec Files: 0 passed, 1 failed, 1 total (100% completed) in 00:00:02
2023-02-01T09:10:11.547Z INFO @wdio/local-runner: Shutting down spawned worker
2023-02-01T09:10:11.798Z INFO @wdio/local-runner: Waiting for 0 to shut down gracefully
2023-02-01T09:10:11.799Z INFO @wdio/local-runner: shutting down
Hello WDIO folks!
I'm trying to update from WDIO 7.x.x to 8.3.2 and noticed in the changelog, the point "discontinued support for tsconfig-paths".
In my wdio.conf.ts, I had something like this:
autoCompileOpts: {
[...]
tsConfigPathsOpts: {
baseUrl: './',
paths: {
'@project1/*': ['src/project1/*'],
'@project2/*': ['src/project2/*'],
},
},
},
This allowed me to use imports like:
import { import1 } from '@project1/import1';
With the discontinued support for tsconfig-paths, this does not seem to work anymore and I get an error like this:
ERROR @wdio/runner: Error: Cannot find module '@project1/import1'
Is there any way to achieve the same result without tsconfig-paths support, i.e. use short-hand imports?
Or do I have to change the import paths across all my test files?
Hi everyone
Describe the bug
When I try to run a test I keep getting the same error(connect ECONNRESET 127.0.0.1:9515). I don't know what is causing it because this is only happening to me. I tested this with one of my colleagues and for him, it's working as expected and we have the same environment.
To Reproduce
I didn't find a way to reproduce it.
Expected behavior
The test should run without getting this error.
Logs/Console Output
[chrome 109.0.5414.119 mac os x #0-0] connect ECONNRESET 127.0.0.1:9515
[chrome 109.0.5414.119 mac os x #0-0] RequestError: connect ECONNRESET 127.0.0.1:9515
[chrome 109.0.5414.119 mac os x #0-0] at ClientRequest. (/Users/I516540/Projects/ETD/Testing/etd-cloud-wdio-e2e-tests/node_modules/got/dist/source/core/index.js:970:111)
[chrome 109.0.5414.119 mac os x #0-0] at Object.onceWrapper (events.js:483:26)
[chrome 109.0.5414.119 mac os x #0-0] at ClientRequest.emit (events.js:388:22)
[chrome 109.0.5414.119 mac os x #0-0] at ClientRequest.emit (domain.js:470:12)
[chrome 109.0.5414.119 mac os x #0-0] at ClientRequest.origin.emit (/Users/I516540/Projects/ETD/Testing/etd-cloud-wdio-e2e-tests/node_modules/@szmarczak/http-timer/dist/source/index.js:43:20)
[chrome 109.0.5414.119 mac os x #0-0] at Socket.socketErrorListener (_http_client.js:475:9)
[chrome 109.0.5414.119 mac os x #0-0] at Socket.emit (events.js:376:20)
[chrome 109.0.5414.119 mac os x #0-0] at Socket.emit (domain.js:470:12)
[chrome 109.0.5414.119 mac os x #0-0] at emitErrorNT (internal/streams/destroy.js:106:8)
[chrome 109.0.5414.119 mac os x #0-0] at emitErrorCloseNT (internal/streams/destroy.js:74:3)
[chrome 109.0.5414.119 mac os x #0-0] at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16)
Runtime Env (please complete the following information):
wdi5/wdio-ui5-service-version: [1.0.0]
UI5 version: [1.96.0]
wdio-version: [7.24.0]
node-version: [14.17.0]
OS: [macOS Ventura 13.2]
Browser + Version [Chrome 109.0.5414.119]
Hi everyone, I'm struggling with something and I hope you can give me a hint :)
My tests are failing when I'm trying to use expect(elem).toBeExisting()
or expect(elem).toHaveTextContaining(...)
and I can't figure it out why.
I'm getting this error:
Expected Element({ sessionId: '3b1cd4d0f64acfe0a20014eb5a8dcceb', elementId: '134a1810-566d-4b2d-ae95-a49cf4c941b9', element-6066-11e4-a52e-4f735466cecf: '134a1810-566d-4b2d-ae95-a49cf4c941b9', selector: '#flash', parent: Browser({ sessionId: '3b1cd4d0f64acfe0a20014eb5a8dcceb', capabilities: Object({ acceptInsecureCerts: true, browserName: 'chrome', browserVersion: '109.0.5414.120', chrome: Object({ chromedriverVersion: '109.0.5414.74 (e7c5703604daa9cc128ccf5a5d3e993513758913-refs/branch-heads/5414@{#1172})', userDataDir: '\AppData\Local\Temp\scoped_dir32224_1596881874' }), goog:chromeOptions: Object({ debuggerAddress: 'localhost:59794' }), networkConnectionEnabled: false, pageLoadStrategy: 'normal', platformName: 'windows', proxy: Object({ }), setWindowRect: true, strictFileInteractability: false, timeouts: Object({ implicit: 0, pageLoad: 300000, script: 30000 }), unhandledPromptBehavior: 'dismiss and notify', webauthn:extension:credBlob: true, webauthn:extension:largeBlob: ... to be existing.
Everything works fine when I use expect(elem.isExisting()).toBeTrue()
or expect(elem.getText()).toContain(...)
.
I'm using wdio v7 in sync mode - even tried the wdio v7 sample project (converted to sync) and I'm getting the same error.
What am I missing?
Thanks a lot!
@wdio/globals/types
if your tsconfig.json ”types”
array (see https://webdriver.io/docs/typescript), or import it (see https://webdriver.io/docs/api/globals )
Hey everyone, I seem to be running into an issue using WDIO with Mocha and trying to run a single spec multiple times.
Basically I'm just trying to do
config.specs = [
"./tests/something.test.ts",
"./tests/something.test.ts",
"./tests/something.test.ts",
];
or
config.specs = Array(30).fill("./tests/something.test.ts");
but there seems to be something deduping spec files each time
Hello, just getting started with webdriverio and hitting an error at step 1.
Node 18.13.0
Running command npm init wdio .
the script installs create-wdio@8.2.1
but fails after Installing @wdio/cli to initialize project...
317 verbose stack Error: command failed
317 verbose stack at ChildProcess.<anonymous> (/**/**/.nvm/versions/node/v18.13.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:63:27)
317 verbose stack at ChildProcess.emit (node:events:513:28)
317 verbose stack at maybeClose (node:internal/child_process:1091:16)
317 verbose stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
318 verbose pkgid *@4.43.0
319 verbose cwd /**/**/**/**/**/**
320 verbose Darwin 21.6.0
321 verbose node v18.13.0
322 verbose npm v8.19.3
323 error code 1
324 error path /**/**/**/**/**/**
325 error command failed
326 error command sh -c -- create-wdio .
327 verbose exit 1
328 timing npm Completed in 30857ms
329 verbose code 1
How to take fullpage screenshot of the screen when running webriverio v7
As of now, I am using the browser.saveScreenshot and It is giving me the browser screenshot. but I looked into the https://www.npmjs.com/package/wdio-screenshot?activeTab=readme Here the example of usage is missing.
Is there any way to take screenshot for each test executed pass and fail both.?
Hello, has anyone attempted to use the browser runner with safari? It is giving me "Invalid regular expression: invalid group specifier name", as per my research this is because @wdio/config uses decamelize 6 which has a lookbehind and lookahead in one of the expressions it uses and is therefore not supported by safari, after much work I patched decamelize to get it working but safari times out and cycles at COMMAND/POST/DATA/RESULT until it times out ase per below:
[0-0] 2023-02-05T03:21:47.649Z INFO webdriver: COMMAND executeScript(<fn>, <object>)
[0-0] 2023-02-05T03:21:47.649Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session/A0F63093-333F-4377-90AC-10F57A035CD8/execute/sync
[0-0] 2023-02-05T03:21:47.649Z INFO webdriver: DATA { script: 'fetchExecutionState(...) [1168 bytes]', args: [] }
[0-0] 2023-02-05T03:21:47.658Z INFO webdriver: RESULT { failures: null, hasViteError: false, errors: [] }
[0-0] 2023-02-05T03:21:47.658Z ERROR @wdio/runner: Failed to run browser tests with cid 0-0: Error: browser test timed out
Hi,
I am getting an error using Chromedriver-service
:
Execution of 2 workers started at 2023-02-05T12:17:37.074Z
2023-02-05T12:17:37.124Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-02-05T12:17:37.125Z INFO chromedriver: Start Chromedriver (/workspace/source/node_modules/chromedriver/lib/chromedriver/chromedriver) with args --port=9515 --url-base=/
2023-02-05T12:17:37.140Z WARN chromedriver: /workspace/source/node_modules/chromedriver/lib/chromedriver/chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
2023-02-05T12:17:47.136Z ERROR @wdio/cli:utils: A service failed in the 'onPrepare' hook
Error: timeout
at Timeout.timeoutFunc (/workspace/source/node_modules/tcp-port-used/index.js:204:25)
at listOnTimeout (node:internal/timers:559:17)
at processTimers (node:internal/timers:502:7)
...
[97m@wdio/runner[39m: Error: Failed to create session.
[0-0] Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
[0-0] If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-0] at startWebDriverSession (/workspace/source/node_modules/@wdio/runner/node_modules/webdriver/build/utils.js:73:15)
[0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5)
Any tips on how to fix this?
Using services: ['selenium-standalone'],
I am getting java error ERROR @wdio/selenium-standalone-service: Error: not found: java
at getNotFoundError
:
2023-02-05T12:34:17.225Z INFO @wdio/cli:launcher: Run onPrepare hook
2023-02-05T12:34:19.800Z ERROR @wdio/selenium-standalone-service: Error: not found: java
at getNotFoundError (/workspace/source/node_modules/which/which.js:10:17)
at Function.whichSync [as sync] (/workspace/source/node_modules/which/which.js:121:9)
at Object.start (/workspace/source/node_modules/selenium-standalone/lib/start.js:73:27)
at SeleniumStandaloneLauncher.onPrepare (/workspace/source/node_modules/@wdio/selenium-standalone-service/build/launcher.js:116:42)
at /workspace/source/node_modules/@wdio/cli/build/utils.js:38:17
at async Promise.all (index 0)
at Launcher.run (/workspace/source/node_modules/@wdio/cli/build/launcher.js:86:13)
Any tips, appreciated.
Hi everyone! I am trying to rerun the failed and broken test cases inside afterSession()
hook. I am maintaining a list of failed test cases and want to execute them one by one. I am trying to run something like this
afterSession: async function (config, capabilities, specs) {
// pause 5 seconds
await setTimeout(() => {
console.log(' after setTimeout ---')
}, 5000)
// failedTestcases is the []
failedTestcases.forEach(async (testCase) => {
console.log('now running - ' + testCase)
const childProcess = require('child_process')
childProcess.execSync(`npm run test -- --grep "${testCase}" --port 4445`)
})
},
The issue is the forEach
block is not executed at all, if I remove --port 4445
part, I get error as Error: Port 4444 is already in use.
Can anyone please help?