protractor

Test all links for validity on a page using Protractor

大城市里の小女人 提交于 2019-12-22 15:49:39
问题 What I am trying to achieve in Protractor is getting all the links on a page and go to them one by one to check if there is a link that routes to a 404 page. The following piece of code comes from my email page object, please note that I am calling replace on the href because the links on the pages that I will test are the following format: https://app.perflectie.nl/something and I want to end-to-end test on https://staging.perflectie.nl and on my localhost. // Used to check for 'broken'

Chrome not reachable inside docker network

瘦欲@ 提交于 2019-12-22 14:44:50
问题 I have a web app which I am trying to test under Gitlab-CI using Protractor. I am using docker-in-docker in Gitlab-CI to build and test the application. I have all my services containerized in Docker (a Nginx server to host static files, a Nodejs API, a Postgresql DB and a Nginx reverse proxy, "pointing" to the static files nginx server and the nodejs API). Yesterday, when running the Protractor tests everything was ok. Then, I have merged my git branch with another to add new tests. In the

Chrome not reachable inside docker network

风流意气都作罢 提交于 2019-12-22 14:44:06
问题 I have a web app which I am trying to test under Gitlab-CI using Protractor. I am using docker-in-docker in Gitlab-CI to build and test the application. I have all my services containerized in Docker (a Nginx server to host static files, a Nodejs API, a Postgresql DB and a Nginx reverse proxy, "pointing" to the static files nginx server and the nodejs API). Yesterday, when running the Protractor tests everything was ok. Then, I have merged my git branch with another to add new tests. In the

Using Data Objects while E2E testing with Protractor

风格不统一 提交于 2019-12-22 14:16:35
问题 So a coworker and I were discussing making a data object for our e2e tests. From my understanding about data objects they are used for decoupling your test suites. For example, my first test suite is to create an account and to test if the fields are valid and the second test suite logins into the account and does its own tests. I am told it is good to use data objects (not a page object) just incase the first test suite fails when making an account. That way we can use the data object in the

AssertionError: expected [ true ] to be true

巧了我就是萌 提交于 2019-12-22 14:00:32
问题 I have faced with the strange assertions problem so even successful assertions are marked as failed, like this: this.expect(this.getWidget('contacts').isNamesDisplayed()).to.eventually.be.true.and.notify(next); and in the console I have: 1 scenario (1 passed) 4 steps (4 passed) 0m03.618s [17:06:38] E/launcher - expected [ true ] to be true [17:06:38] E/launcher - AssertionError: expected [ true ] to be true As you see in this case test marked as successful despite of failed assertion, but in

Issue while capturing Top-Level Domain from URL

坚强是说给别人听的谎言 提交于 2019-12-22 14:00:12
问题 I want a way to capture the Top-Level Domain from a URL, but am not able to get any success. The problem in my case is that the URL can be different. Sometimes a user can enter www.google.com or m.google.com or m.google.uk or google.uk or www.m.google.com I tried using slice but it didn't work as I can have 2 or 3 characters in my URL. I can't split based on ".", I might get 2 or 3 or 4 results. Is there a single-line JavaScript function I can use? Is there any easy custom function available?

How to locate [(ngModel)] for protractor tests

我是研究僧i 提交于 2019-12-22 13:08:05
问题 <span class="selector-label">Team: </span> <select class="selector-component" [(ngModel)]="selectedTeamId"> <option *ngFor="#team of teams" [value]="team.id">{{team.name}}</option> </select> I am trying to add protractor tests for the selectedTeamId which is the first one sorted alphabetically if one user assigned to multiple teams. I think I should use [(ngModel)]="selectedTeamId", but not sure how to do it. thanks. I know how to get all teams, but I need to get the first one which is the

How to wait for element.all().each() to resolve before proceeding

徘徊边缘 提交于 2019-12-22 13:03:01
问题 I'm trying to iterate through a list of elements to find if any one of them has a particular value as it's getText() value. My problem is that my test is not executing in the order I've laid it out. I've read a bunch about queuing and Promise resolution, but I don't understand how it affects my current scenario. Here is what I'm doing: it('should find apps by name', function() { var exists = false; element.all(by.repeater(‘item in list’).each(function(elem) { elem.getText().then(function(text

Report accessibility plugin results

早过忘川 提交于 2019-12-22 12:48:48
问题 The protractor.conf file is configured to report the jasmine test results in junit format according to https://github.com/larrymyers/jasmine-reporters#protractor // An example configuration file. // https://raw.github.com/angular/protractor/master/example/conf.js exports.config = { // The address of a running selenium server. // seleniumServerJar: './node_modules/protractor/selenium/selenium-server-standalone-2.41.0.jar', // Make use you check the version in the folder //seleniumAddress:

How do bring down a connect server in Grunt?

无人久伴 提交于 2019-12-22 12:07:57
问题 I'm running protractor tests on a connect server, since there is no built in web server as in karma. No problem with that, only karma shuts down its web server once it's done running the tests but there is no such mechanism in protractor. I'd like to run protractor tests on a connect server and then spin up another connect server, potentially with a different configuration. So far I've managed to run another connect server on a different port but I still have the two connect servers running