protractor

How to verify $httpBackend mock expectations in a Protractor test?

三世轮回 提交于 2019-12-21 13:57:09
问题 I'm developing a frontend for a REST API. I'm using Protractor for end-to-end tests with the API mocked out because I want to be able to test the frontend in isolation. Here's a simple test I got: describe('partner', function () { it('should list partners', function () { var page = new PartnerListPage(); var httpBackendMock = function () { angular.module('httpBackendMock', ['ngMockE2E']) .run(function ($httpBackend) { $httpBackend.whenGET('/api/partners').respond(200, { _embedded: { partners:

Testing with protractor using ui-select

柔情痞子 提交于 2019-12-21 13:01:49
问题 I am trying to test an ui-select with protractor. In this ui-select I have a list of countries. My html looks like: <ui-select ng-model="datiAnagrafici.countryOfBirth" name="countryOfBirth" theme="bootstrap" reset-search-input="true" append-to-body="true" required blur> <ui-select-match placeholder="paese di nascita">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="country.code as country in countries | filter: {name:$select.search}"> <span ng-bind-html="country.name"><

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

How to handle Spinners using Protractor

自作多情 提交于 2019-12-21 10:17:12
问题 In my AngularJS application, for any page to load, there are two things which are loading First the content of the page and secondly some back-end resources. While back-end resources are loading, a spinner comes in the front and user is not able to do anything on the page contents. Now while I am writing the automation test suites of the application using Protractor , I am not able to find a technique, to wait for the spinner to disappear from the screen before starting the test. Please help

How to configure Protractor to use Cucumber

蹲街弑〆低调 提交于 2019-12-21 08:06:21
问题 As of 0.20.1 Cucumber is now fully supported in Protractor but I'm battling to find any documentation on how to configure it properly. Any idea how you would setup world.js? I have found this example at https://github.com/whyvez/angular-cucumber-example/blob/master/features/support/world.coffee but I'm not sure if you would still need to specify all the require modules and configuration as the protractor config file (referenceConf.js) would have all this info already. assert = require 'assert

How to configure Protractor to use Cucumber

自闭症网瘾萝莉.ら 提交于 2019-12-21 08:06:13
问题 As of 0.20.1 Cucumber is now fully supported in Protractor but I'm battling to find any documentation on how to configure it properly. Any idea how you would setup world.js? I have found this example at https://github.com/whyvez/angular-cucumber-example/blob/master/features/support/world.coffee but I'm not sure if you would still need to specify all the require modules and configuration as the protractor config file (referenceConf.js) would have all this info already. assert = require 'assert

isDisplayed returns false for a visible element in Protractor

穿精又带淫゛_ 提交于 2019-12-21 07:56:19
问题 EDIT #4 : Breakthrough!! I started recursively going through the parent nodes and returning the same values as below. One of the parents--the inner mat-drawer-container --also returned false for isDisplayed (all the others returned true, which seems odd). Looking at that node, it turns out that it's the only tag on the site to have the CSS of display: contents . Removing that causes the button in question-- and everything else below it--to return true for isDisplayed. Heck, Protractor can

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 can I get an element randomly in a dropdowlist using protractor?

烂漫一生 提交于 2019-12-21 05:50:34
问题 I've this dropdownlist and I'm trying to get a value randomly and click on it. How can I do it? I can't use the class because there is other element with the same class. I don't have a clue. <dropdownlist _ngcontent-lnd-30=""> <select class="form-control ng-pristine ng-valid ng-touched"> <!--template bindings={}--> <option value="null">Selecione um tipo de norma...</option> <option value="5980dfc1-ed08-4e5f-bdd7-144beb2fafe3">Enunciado Orientativo</option> <option value="e721782a-11ba-4828

protractor-html-screenshot-reporter not showing any report after test execution

梦想与她 提交于 2019-12-21 05:37:06
问题 I am using protractor to automate a hybrid mobile app, I am using the Protractor-HTML-screenshot-reporter, but it is not displaying any report after successful test execution. Here's my code below: var HtmlReporter = require('protractor-html-screenshot-reporter'); var reporter=new HtmlReporter({ baseDirectory: 'C:\\Users\\bhawani.prasad\\Desktop\\Protractor\\PageObject\\report', // a location to store screen shots. docTitle: 'Protractor Demo Reporter', docName: 'protractor-demo-tests-report