christian-bromann on v8
bundle for ESM and CJS with tsup (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);
});
}
});
Hello. I've just started using WDIO - it is really cool. Thank you for the job you've done guys!
And, of course, I have a question - I'm extending browser commands and adding new ones, but Typescript compiler is not really happy. Here is example from the documentation
browser.overwriteCommand('click', function (origClickFunction, { force = false } = {}) { ... });
$('..').click({ force: true })
result is compile error Argument of type '{ force: boolean; }' is not assignable to parameter of type 'ClickOptions'
one more example:
browser.addCommand('isDisplayedAndBlurred', function () { ... });
$('..').isDisplayedAndBlurred()
result is "Property 'clickIfCollapsed' does not exist on type 'Element'."
with ts-ignore everything works like a charm. However there are still compile errors and autocomplete in IDE (WebStorm) doesn't work.
I there any way to fix it?
Thank you in advance.
@krishna-auto there's a blog about that right here https://webdriver.io/blog/2019/06/25/file-upload.html
Hi @erwinheitzman , this worked for me on chrome, but its failing on headless chrome execution and as well as non-headless/headless mode in firefox, same failure "element is not interactable" error, In the above given link its given that "that is currently only supported when running Chrome", anyway to make it work on firefox && chrome headless? Thanks!
Hi, any idea how to make this work on firefox? Thanks!