protractor

Nested it in Protractor/Jasmine

微笑、不失礼 提交于 2019-12-21 20:54:46
问题 Can I create a nested it in Protractor/Jasmine. it("outer it", function () { it("inner it", function () { expect(1).toBe(1); }); }); I am trying to execute it test cases inside a loop, and in every iteration I want to run a test, for example: it("outer it", function () { for(var i=0;i<10;i++){ it("inner it", function () { expect(1).toBe(1); }); } }); The reason I want to do it is that I want to initialize an array and then in a dynamically way to loop trough all the element and run a number

Protractor: Is it possible to test that there are no 404 in my app?

故事扮演 提交于 2019-12-21 20:39:05
问题 I'm new to protractor, I want to write a test to see that there are no anchors with urls giving 404 errors. I've seen this How to test html links with protractor?, but is for one determined link only, I want to do it for all links in the page. The test should pass for the http status 200, as stated here How to use protractor to get the response status code and response text? I have two questions: Does this test makes sense in protractor? Is it possible to test this? If so, how? 回答1: I think

onCleanUp() vs onComplete() vs afterLaunch()

僤鯓⒐⒋嵵緔 提交于 2019-12-21 20:29:18
问题 In Protractor, there is a "global set up" method called onPrepare() , but I'm not completely sure what is meant to be a "global tear down" - there are three relevant methods: onCleanUp , onComplete and afterLaunch that are all called after a test execution. Why does protractor have three methods called after a test run? What is the difference between onCleanUp , onComplete and afterLaunch ? I've also noticed that there is an "exit" event that we can attach a callback to (example here):

How to find and click a table element by text using Protractor?

江枫思渺然 提交于 2019-12-21 20:01:51
问题 <tr id="item" ng-repeat="item in itemList> <td id="code" ng-repeat="column in columns">Some Text</td> </tr> I've seen some other similar questions but I couldn't solve it yet. Thats what I've tried so far: element.all(by.repeater('column in columns')).findElement(by.id('code')).getText('Some Text').click(); EDIT: <tr ng-repeat="item in items> <td>{{item.name}}</td> <td>{{item.description}}</td> </tr> Which results in: <tr> <td>Some Name</td> <td>Some Text</td> </tr> <tr> <td>More Name</td>

Unable to run tests on Safari - Do we need dev certificate

冷暖自知 提交于 2019-12-21 19:56:47
问题 I am trying to run my protractor tests on Safari. While researching, I learnt that you need not download anything in specific for Safari when using protractor because the driver comes with it. When attempting to run my tests I was getting "No Safari driver" found message. Then I installed this extension for Safari - from the link below. https://code.google.com/p/selenium/wiki/SafariDriver http://selenium-release.storage.googleapis.com/index.html?path=2.45/ This extension does show up on

PageObjects + non-angular page - how to join them?

寵の児 提交于 2019-12-21 19:16:44
问题 I'm writing some protractor tests for our application. There is one place where is non-angular page as iframe in angular page. Problem: I'm unable to map fields from non-angular page in Page Object object and use them in right time in my test specs. Notes: I tried write Page Object as object (var DamagePage: {}) and as function (var DamagePage = function() {}) too. Both works bad in this situation. Calling fields from non-angular page in spec works obviously fine, but I want to have it in

PageObjects + non-angular page - how to join them?

给你一囗甜甜゛ 提交于 2019-12-21 19:16:13
问题 I'm writing some protractor tests for our application. There is one place where is non-angular page as iframe in angular page. Problem: I'm unable to map fields from non-angular page in Page Object object and use them in right time in my test specs. Notes: I tried write Page Object as object (var DamagePage: {}) and as function (var DamagePage = function() {}) too. Both works bad in this situation. Calling fields from non-angular page in spec works obviously fine, but I want to have it in

How to rerun the failed cucumber scenarios in protractor?

我们两清 提交于 2019-12-21 18:58:07
问题 As a part of testing, i was using typescript language to develop the code which will be compatible for protractor, i was using BDD framework in which i had defined some cucumber options in my config.ts as following: capabilities: { specs: "../example.feature" } cucumberOpts: { compiler: "ts:ts-node/register", format: "rerun:./reports/rerun.txt", require: "../../stepdefinations/*.ts", strict: true } onComplete: () =>{ Reporter.createHTMLReport(); } As mentioned in format, i was able to get the

Protractor - find element in iframe

徘徊边缘 提交于 2019-12-21 18:04:10
问题 in very top of my page I have call of iframe: <iframe ng-if="webpadUrl" id="webPadIframe" ng-src="http://Path/To/iFrame?sessionId=9bc9989441c8c9cfb9ff5bdc381a72ea" seamless="seamless" class="fullscreen ng-scope" src="http://Path/To/iFrame?sessionId=9bc9989441c8c9cfb9ff5bdc381a72ea"> </iframe> Inside of iframe I have something like: <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 5845 3897"> and below that multiple <g> with different ID and so on.. <g id="30_0_80" transform=

Protractor on offline machine

冷暖自知 提交于 2019-12-21 17:28:07
问题 Angular 4 cli project We have private network with private npm repository. (There is no connection to the internet). so after all modules are downloaded I want to run e2e tests. Protractor use webdriver-manager to download the latest chrome driver. but he can't download the driver so I get this error : etaddrinfo ENOTFOUND chromedriver.storage.googleapis.com chromedriver.storage.googleapis.com:443 I tried to download the driver manually, and inside the protactor-config : { chromeDriver: "../.