e2e-testing

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

Check outgoing browser network calls using Cypress.io

爷,独闯天下 提交于 2019-12-22 10:28:20
问题 On our site, we have Omniture calls that are fired when someone clicks on a link or takes some action. In Chrome DevTools in the network tab, you can see the network request being fired. Is there a way for Cypress.io to capture outgoing network requests, so we can inspect/parse the URLs? The equivalent to this would be something like Browsermob proxy for webdriver set ups. I want to use Cypress.io to tell it to click the link, but then I want to check the outgoing network request by the

Protractor e2e test table header and <tr>,<td> tags

谁说胖子不能爱 提交于 2019-12-22 05:53:40
问题 I am using below table. In that I want to test each tag(th, td tags), Text in that tags and count of that text. HTML snippet <table class="table table-striped"> <tbody> <tr> <th><b><a ng-href="" ng-click="predicate='id';reverse=!reverse">Patient Id</a></b></th> <th><b><a ng-href="" ng-click="predicate='accountNumber';reverse=!reverse" class="">Account Number</a></b></th> <th><b><a ng-href="" ng-click="predicate='title';reverse=!reverse">Title</a></b></th> <th><b><a ng-href="" ng-click=

Angular2 e2e test case with protractor throwing error

孤人 提交于 2019-12-22 01:16:16
问题 I have created my app with angular2-webpack-starter and i have used socket.io with it. I have created one common service to create socket connection and listen its method. this service is used and initialized after user is logged in. When app is running and i execute test case for login, i am checking url with below code : browser.getCurrentUrl().then((url) => { expect(url).toEqual('/dashboard'); }); The issue is when socket is connected its throwing error 'Timed out waiting for Protractor to

Message: function timed out after 5000 milliseconds - Protractor & CucumberJS

假如想象 提交于 2019-12-21 21:03:06
问题 cucumberjs --version 1.2.2 protractor --version 4.0.1 Both installed globally via npm I keep getting this error after upgrading to cucumberJs version above. Failures: 1) Scenario: Get records from DB e2e\features\transac.feature:7 Step: Given I am logged in as "username" with "password"- e2e\features\transac.feature:8 Step Definition: e2e\steps\loginSteps.js:17 Message: function timed out after 5000 milliseconds 1 scenario (1 failed) 1 step (1 failed) 0m06.608s Please note I included my env

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

A Jasmine spec timed out. Resetting the WebDriver Control Flow - when redirect to new page

我的梦境 提交于 2019-12-21 12:24:04
问题 I'm bedinner in e2e testing and have a problem. When I do login - I make redirect from login.php to index.php page. But my test is fails with following errors: ..A Jasmine spec timed out. Resetting the WebDriver Control Flow. F Failures: 1) Login Page should login and redirect to overview page with CR Operators rights Message: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL. Stack: Error: Timeout - Async callback was not invoked

tell Protractor to wait for the page before executing expect

扶醉桌前 提交于 2019-12-21 06:01:50
问题 When I click the export button, it makes a REST call to our endpoint then few seconds after, I receive the response then I also render the table. Unfortunately, I read that every call is asynchronous which means my expect will be executed even if table hasn't been rendered yet. The expect I wrote checks if the string is on the table but it's failing since it's not there yet. What is the proper approach to this? it('should generate global user report', function() { element(by.css('button

How to make a list of failed specs using jasmine custom reporter to post to slack?

烈酒焚心 提交于 2019-12-21 05:14:15
问题 I am trying to work on a custom jasmine reporter and get a list of all the failed specs in the specDone function: specDone: function(result) { if(result.status == 'failed') { failedExpectations.push(result.fullName); console.log(failedExpectations); } } where failedExpectations will store an entire list of the failed specs and i need to access this in the afterLaunch function in the protractor config file. But due to the fact that the config file loads everytime a new spec runs it basically

How to use Puppeteer in an Angular application

和自甴很熟 提交于 2019-12-21 03:32:54
问题 My question is simple but i don't understand if it's possible and in this case how it's possible ? I would like to use the puppeteer library in a angular application. https://www.npmjs.com/package/puppeteer it's the npm installation. But i don't understand how i can use it. For example i just want to make this script : const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://example.com');