christian-bromann on main
add more configuration to gitpo… (compare)
christian-bromann on main
add gitpod file (compare)
christian-bromann on main
add gitpod file (compare)
christian-bromann on v8
start rewrite webdriver package (compare)
Hi guys, need help with wdio 6 mocha with opt delay
. I can't make it work.
This code works in pure mocha:
var assert = require('assert');
async function returnArr() {
return [2, 2, 1];
}
setTimeout(async function() {
const arr = await returnArr();
describe('my suite', function() {
for (let el of arr) {
it(`Is element ${el} has index 1`, async function() {
assert.equal(arr.indexOf(el), 1);
});
}
});
run();
}, 500);
But skips it in wdio mocha 'Spec Files: 0 passed, 1 skipped, 1 total (100% completed) in 00:00:03 '
Thats set up for mocha frmaework in the config:
mochaOpts: {
ui: 'bdd',
timeout: 3600000,
delay: true
},
Also synchronous version works in wdio(with deleted delay option)
function returnArr() {
return [2, 2, 1];
}
const arr = returnArr();
describe('my suite', function() {
for (let el of arr) {
it(`Is element ${el} has index 1`, async function() {
assert.equal(arr.indexOf(el), 1);
});
}
});
Seams like a bug
Getting following error when running webdriverIO docker image (alpine-based) with selenium-standalone service & firefox while the same works with ubuntu based docker image -
[0-0] 2020-05-27T13:16:43.803Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-05-27T13:16:43.803Z ERROR webdriver: Request failed with status 500 due to unknown error: invalid argument: can't kill an exited process
Build info: version: '3.141.5', revision: 'd54ebd709a', time: '2018-11-06T11:58:47'
System info: host: 'a8560b87fab4', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '11.0.7'
Driver info: driver.version: unknown
remote stacktrace:
[0-0] 2020-05-27T13:16:43.803Z ERROR webdriver: unknown error: invalid argument: can't kill an exited process
Build info: version: '3.141.5', revision: 'd54ebd709a', time: '2018-11-06T11:58:47'
System info: host: 'a8560b87fab4', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.19.76-linuxkit', java.version: '11.0.7'
Driver info: driver.version: unknown
remote stacktrace:
at getErrorFromResponseBody (/airbnb-wdio-poc/node_modules/webdriver/build/utils.js:124:10)
at WebDriverRequest._request (/airbnb-wdio-poc/node_modules/webdriver/build/request.js:148:56)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async startWebDriverSession (/airbnb-wdio-poc/node_modules/webdriver/build/utils.js:44:16)
at async Function.newSession (/airbnb-wdio-poc/node_modules/webdriver/build/index.js:46:23)
at async remote (/airbnb-wdio-poc/node_modules/webdriverio/build/index.js:66:20)
at async Runner._startSession (/airbnb-wdio-poc/node_modules/@wdio/runner/build/index.js:219:50)
at async Runner._initSession (/airbnb-wdio-poc/node_modules/@wdio/runner/build/index.js:175:21)
at async Runner.run (/airbnb-wdio-poc/node_modules/@wdio/runner/build/index.js:93:15)
Dockerfile -
FROM node:12.16-alpine
ENV NODE_PATH /airbnb-wdio-poc/node_modules/
ENV PATH /airbnb-wdio-poc/node_modules/.bin:$PATH
COPY airbnb-wdio-poc/*.json /airbnb-wdio-poc/
COPY airbnb-wdio-poc/*.js /airbnb-wdio-poc/
COPY airbnb-wdio-poc/pages/ /airbnb-wdio-poc/pages/
COPY airbnb-wdio-poc/tests/ /airbnb-wdio-poc/tests/
WORKDIR /airbnb-wdio-poc/
RUN pwd
RUN apk --no-cache add --virtual native-deps g++ gcc libstdc++ linux-headers make python
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk update
RUN apk add openjdk11
RUN apk add firefox-esr
RUN npm install --silent
RUN npm audit fix
RUN ls -l
RUN apk del native-deps g++ gcc linux-headers make python
some contents from wdio.conf.js -
capabilities: [{
maxInstances: 1,
browserName: 'firefox',
"moz:firefoxOptions": {
args: ["-headless"],
},
}]
services: [['selenium-standalone']]
@danggrianto you need a different approach. Look at this example
https://github.com/pjcalvo/wdio-appium-poc/blob/master/src/pages/home.page.js
Appium lets you identify the locators on the app.
require('chai/register-expect');
Hello here.
Updated my project from wdio v5 to v6 and faced with problem when running tests remotely on selenium grid.
Even if I set hostname: , port: , and path: ,
in wdio.conf tests are running on my machine.
Who knows if there were any config changes or maybe I need to add something else now in v6 to be able to run tests on remote selenium grid machine?
P.S> even if I set absolutely incorrect hostname in config -> it still launch browsers on my local machine. 😅
browser
object that is not fully initialised.browser
object has only capabilities
and some flags like isMobile
.browser
commands have to be moved to before
hook.