webdriver-io

WebDriverIO Selenium pass command line arguments into Chrome from config.js file

可紊 提交于 2019-12-03 14:28:33
I need chrome to run with disable-web-security flag for my UI tests. How can I inject any commands using wdio.config file ( http://webdriver.io/ ). capabilities: [{ browserName: 'chrome' }] You can set any chrome flags within the desired capabilities using chromeOptions capabilities: [{ browserName: 'chrome', chromeOptions: { args: ['disable-web-security'] } }] Check out the chromedriver docs for more information on the chromeOptions object. This ended up being the correct syntax, thanks Christian! capabilities: [{ browserName: 'chrome', "chromeOptions": { args: ['--disable-web-security'] } }]

What is the difference between NightwatchJS and WebdriverIO?

泪湿孤枕 提交于 2019-12-03 01:50:40
问题 As the title states, what is the difference between Nightwatch.js and Webdriver.io? It seems like they have kind of the same syntax and do almost the same thing. How are they different? I need to choose between them. 回答1: I've written a test suite using each of these tools a few times. Webdriver.io allows you to write your test cases "from scratch" and have great control over reporting, by say, integrating with slack using slack npm, and other packages. You would need to know or quickly learn

How to use 3rd party method that takes callback in webdriverio

只谈情不闲聊 提交于 2019-12-02 22:27:27
问题 I need some help here... I am using a 3rd party method which takes callback in it ... so now if i want to use that in WDIO i need to wrap that method inside promise ... So i did the following: post(env, userAccount, canonical, isItQuery){ let options = { ..... }; return new Promise(function(resolve, reject){ request.post(options,function(error, response){ logger.info('In to the callback of request post'); if(!error){ resolve(response); } else{ reject(error); } }); }); } And i tried calling

What is the difference between NightwatchJS and WebdriverIO?

被刻印的时光 ゝ 提交于 2019-12-02 14:03:18
As the title states, what is the difference between Nightwatch.js and Webdriver.io? It seems like they have kind of the same syntax and do almost the same thing. How are they different? I need to choose between them. I've written a test suite using each of these tools a few times. Webdriver.io allows you to write your test cases "from scratch" and have great control over reporting, by say, integrating with slack using slack npm, and other packages. You would need to know or quickly learn node.js. In addition to working very well with desktop browsers, it integrates well with Appium, Android

How to use 3rd party method that takes callback in webdriverio

独自空忆成欢 提交于 2019-12-02 08:29:52
I need some help here... I am using a 3rd party method which takes callback in it ... so now if i want to use that in WDIO i need to wrap that method inside promise ... So i did the following: post(env, userAccount, canonical, isItQuery){ let options = { ..... }; return new Promise(function(resolve, reject){ request.post(options,function(error, response){ logger.info('In to the callback of request post'); if(!error){ resolve(response); } else{ reject(error); } }); }); } And i tried calling this method inside stepDefinition like this: rm.post(env,userAccountID,payloadName,true).then(function

How do I get WebdriverIO autocomplete on VS Code

若如初见. 提交于 2019-12-01 23:29:10
问题 Is there a way I can get autocomplete on VS Code for webdriverio? Other code editors like Intellij provide something like Settings -> Preferences -> Languages & Frameworks -> JavaScript -> Libraries From there we can add a directory with webdriverio commands How can I do similar thing with VS Code? 回答1: my understanding is, vscode is built with typescript and by default it does not support autoComplete(Intellisense) on a package that is built with javascript . So all the js package creators

Webdriver.io crashes with NoSessionIdError

流过昼夜 提交于 2019-11-30 15:05:51
I'm trying to get webdriver.io and Jasmine working. Following their example , my script is at test/specs/first/test2.js (in accordance with the configuration) and contains: var webdriverio = require('webdriverio'); describe('my webdriverio tests', function() { var client = {}; jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999; beforeEach(function() { client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} }); client.init(); }); it('test it', function(done) { client .url("http://localhost:3000/") .waitForVisible("h2.btn.btn-primary") .click("h2.btn.btn-primary") .waitForVisible("h2

Webdriver.io crashes with NoSessionIdError

我的未来我决定 提交于 2019-11-29 21:42:18
问题 I'm trying to get webdriver.io and Jasmine working. Following their example, my script is at test/specs/first/test2.js (in accordance with the configuration) and contains: var webdriverio = require('webdriverio'); describe('my webdriverio tests', function() { var client = {}; jasmine.DEFAULT_TIMEOUT_INTERVAL = 9999999; beforeEach(function() { client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} }); client.init(); }); it('test it', function(done) { client .url("http:/

Selenium server error: Unable to create new service chromedriverservice

白昼怎懂夜的黑 提交于 2019-11-28 13:55:21
I am trying to run webdriverio on my windows 10 computer and keep running into the same issue when trying to run my test js file. So I run this -jar /your/download/directory/selenium-server-standalone-3.5.3.jar to start the server and that comes out with this output 13:06:19.471 INFO - Selenium build info: version: '3.5.3', revision: 'a88d25fe6b' 13:06:19.472 INFO - Launching a standalone Selenium Server 2018-02-16 13:06:19.503:INFO::main: Logging initialized @301ms to org.seleniumhq.jetty9.util.log.StdErrLog 13:06:19.564 INFO - Driver class not found: com.opera.core.systems.OperaDriver 13:06

Appium/wdio - unable to dismiss location permissions alert on Android

假装没事ソ 提交于 2019-11-28 06:17:45
问题 I'm using webdriver.io to write a suite of Appium tests for a hybrid Cordova App. "appium": "^1.10.0", "wdio-appium-service": "^0.2.3", "wdio-jasmine-framework": "^0.3.8", "webdriverio": "^4.14.1", In one of my tests I am trying to programmatically accept the Location Permissions native modal presented on App launch on top of the WebView. I can easily do so in iOS using browser.alertAccept() but the latter does not seem to work for Android. I also tried to switch to the native context to