protractor

Activating chrome language flags when activating from protractor (selenium)

我们两清 提交于 2020-01-11 05:26:27
问题 I'm writing end to end tests with Protractor for an angular website. We have to support certain languages so I would like to init chrome using the --lang flag and start it with some other language. I searched the web and couldn't find any example to how it can be done. My only lead was some article I saw and understood that I need to add to Protractor config file the "capabilities" section and there I can define the "args" property. Then tried to tinker with it but no luck. Any help will be

How can I make Protractor NOT wait for $timeout?

做~自己de王妃 提交于 2020-01-11 05:01:09
问题 I'm testing my angular application with Protractor. Once the user is logged in to my app, I set a $timeout to do some job in one hour (so if the user was logged-in in 13:00, the $timeout will run at 14:00). I keep getting these failures: "Timed out waiting for Protractor to synchronize with the page after 20 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. The following tasks were pending: - $timeout: function onTimeoutDone(){....." I've read this timeouts

cucumber-js and Chai how to expect if element with given selector exist in DOM

可紊 提交于 2020-01-11 04:53:12
问题 I have a problem with cucumberjs. I cannot find a way to ensure that element with given selector is presented into DOM. I'm using cucumberjs with Chai. https://github.com/cucumber/cucumber-js isPresent returns object - no matter if the element exists or not. So the question is how to check if element is present in DOM. I will edit the question to share one learned lesson. I read the documentation also want to thanks to Nathan Thompson. isPresent() returns a promise that will resolve to

Is there any way to pass multiple browser via protractor cli

三世轮回 提交于 2020-01-10 15:01:23
问题 Just wanted to know is it possible to specify cli args to protractor like --multiCapabilities.0.browserName chrome --multiCapabilities.1.browserName firefox so that it overrides the multiCapabilities defined in protractor conf file. 回答1: A concrete example of Isaac Lyman's first suggestion: CLI: protractor ... --params.browsers="chrome,firefox" conf.js: var capabilities = { chrome: { browserName: 'chrome' }, firefox: { browserName: 'firefox' } }; ... getMultiCapabilities: function() { var

Is there any way to pass multiple browser via protractor cli

不问归期 提交于 2020-01-10 14:59:17
问题 Just wanted to know is it possible to specify cli args to protractor like --multiCapabilities.0.browserName chrome --multiCapabilities.1.browserName firefox so that it overrides the multiCapabilities defined in protractor conf file. 回答1: A concrete example of Isaac Lyman's first suggestion: CLI: protractor ... --params.browsers="chrome,firefox" conf.js: var capabilities = { chrome: { browserName: 'chrome' }, firefox: { browserName: 'firefox' } }; ... getMultiCapabilities: function() { var

Protractor : Read Table contents

坚强是说给别人听的谎言 提交于 2020-01-09 10:49:10
问题 I've been writing e2e tests for my angular js app and am unable to figure this out. I've got a table with data in it. I want to extract the first rows data. <table> <tr> <td><\td> <td><\td> <td><\td> </tr> </table> I did this in protractors elementExplorer and it prints out the values of all 3 columns element.all(by.repeater('item in items.list')).get(0).getText() James Byrne 1 If I do this, it prints out the first column value element.all(by.repeater('item in items.list')).get(0).element(by

Protractor - Error: Failed: WebDriverError

点点圈 提交于 2020-01-07 05:12:08
问题 I have a protractor project that It starts and runs specs as I expect but after almost 2 minutes it starts getting this error on rest of test cases. I don't know why. It had run perfectly one week ago but now I faced that error and it doesn't give (or I can't see) any detail about error. "Error: Failed: WebDriverError at stack (Z:\\dev\\lmw\node_modules\\protractor\node_modules\\jasmine-core\\lib\\jasmine-core\\jasmine.js:2200:17) at buildExpectationResult (Z:\\dev\\lmw\node_modules\

run conf.ts in VS 2013 + TS

无人久伴 提交于 2020-01-07 03:11:09
问题 i want to run the conf.ts in visual studio 2013 with type script. i have added the conf.ts, spec.ts and required typing. it looks as below. There are 0 build errors. if i run the conf.ts, it is going to local host which is mentioned in the project properties and not to the base path have mentioned in the spec.ts. how to resolve this issue? project in VS 2013 来源: https://stackoverflow.com/questions/43109914/run-conf-ts-in-vs-2013-ts

How to retry failed test specs in protractor jasmine

浪尽此生 提交于 2020-01-06 14:18:11
问题 I am trying to use protractor-retry mechanism to run my protractor e2e tests. I have installed Protractor-retry package and added required things in conf.js file as below: var PropertiesReader = require('properties-reader'); var properties = PropertiesReader('config.properties'); var retry = require('protractor-retry').retry; exports.config = { plugins: [{ package: 'jasmine2-protractor-utils', disableHTMLReport: false, disableScreenshot: false, //screenshotPath: './reports/screenshots',

Adding global variables via a require Common Function file

左心房为你撑大大i 提交于 2020-01-06 08:46:11
问题 I am doing a POC on switching to Protractor and Jasmine to perform our automated scripting. I'm trying to build a preliminary framework, but I'm having issues trying to translate my concept to reality. I've set up three files: conf.js, spec.js, and cf.js. Conf.js is testplan-specific configuration file, spec.js contains the actual tests, and cf.js contains the common functions that I will be using through all test plans. I am trying to include a variable in cf.js to contain the starting URL