Questions tagged [angularjs-e2e]

The End-to-End testing framework for AngularJS.

The End-to-End testing framework for AngularJS. For large and small applications that grow in size and complexity it allows automatic testing to verify the correctness of new features, catch bugs and notice regressions.

The solution for testing used by the framework is an Angular Scenario Runner which simulates user interactions that will help to verify the health of the Angular application.

Issues related to the E2E Testing provided by AngularJS (http://docs.angularjs.org/guide/dev_guide.e2e-testing) and distributed as ng-scenario.

546 questions
42
votes
5 answers

Angular2 Inject ElementRef in unit test

I am trying to test a component that receives a reference to ElementRef through DI. import { Component, OnInit, ElementRef } from '@angular/core'; @Component({ selector: 'cp', templateUrl: '...', styleUrls: ['...'] }) export class…
Mathieu Nls
  • 2,285
  • 2
  • 17
  • 32
40
votes
4 answers

How to select a single item in protractor

Usually in protractor you can select singular element with: element(protractor.By.css('#fdfdf')); Occasionally you get something like this: element(protractor.By.css('.dfdf')); which potentially has more than one element. What's the correct way to…
user2167582
  • 5,986
  • 13
  • 64
  • 121
30
votes
3 answers

How to validate when a checkbox is checked in AngularJS e2e tests?

I've been trying out the AngularJS e2e tests and am getting stuck determining whether or not a checkbox is checked. I used the end to end test for the checkbox input as a sample (see the End to end test tab in the Example). Html snippet: Value1:…
Gloopy
  • 37,767
  • 15
  • 103
  • 71
27
votes
2 answers

Protractor instance vs browser

I have tried to looked up for similar QA's but i couldn't find one to satisfy me. So basically i saw that in some examples it's used ptor = protractor.getInstance(); ptor.get(url); And in some other examples it's used. browser.get(url); So th…
Tek
  • 1,178
  • 1
  • 12
  • 22
24
votes
7 answers

Running into Error while waiting for Protractor to sync with the page with basic protractor test

describe('my homepage', function() { var ptor = protractor.getInstance(); beforeEach(function(){ // ptor.ignoreSynchronization = true; ptor.get('http://localhost/myApp/home.html'); // ptor.sleep(5000); }) …
user2167582
  • 5,986
  • 13
  • 64
  • 121
23
votes
1 answer

How to pass baseUrl from protractor.conf into my test to assert it in tests?

What I want to do is: expect(browser.getCurrentUrl()).toEqual(protractor.baseUrl + urls.cookiesPage()); This is what I get: - Expected 'https://somewebsite.com/about/cookies/' to equal 'undefined/about/cookies/'. How to pass baseUrl from config…
Jakub Mucha
  • 1,342
  • 1
  • 13
  • 18
23
votes
3 answers

Protractor - Where to use browser.waitForAngular()

I have some tests written using protractor for angular.js app. I am using Page Objects design pattern and there i have some methods that navigate to other pages by clicking on links and buttons. and soon after that i am calling…
Kasun Kodagoda
  • 3,956
  • 5
  • 31
  • 54
23
votes
4 answers

Protractor, with isDisplayed() I get NoSuchElementError: No element found using locator

In protractor 2.0, I am checking in a expect() if one element is displayed. I expect a false, but the weird thing is that I get following error: NoSuchElementError: No element found using locator: By.id("userForm") My code…
Mikel
  • 5,902
  • 5
  • 34
  • 49
23
votes
3 answers

(Protractor) Checking whether an input is disabled on click?

I have two input fields, Username and Password and a spinner button. When i click on this spinner button these two input fields get disabled and I am redirected to another page. I am writing an end-to-end testing to check whether these input fields…
rabishah
  • 561
  • 2
  • 4
  • 16
22
votes
1 answer

Download a file protractor test case

I am writting a protractor test case to download a file which can be of any type. Scenario: Download a file Step 1: Click on the Download Link Step 2: Check whether the file is downloaded or not How do i check if the file is downloaded correctly…
Hmahwish
  • 2,222
  • 8
  • 26
  • 45
22
votes
5 answers

Protractor E2E - How Do You Manage Database?

I'm currently leaning on the Node + Angular stack and utilising Karma and Protractor for testing. I'm currently having a hard time figuring out how to handle E2E tests that create and edit data, as well the need to have a expected data…
iQ.
  • 3,811
  • 6
  • 38
  • 57
22
votes
6 answers

Protractor find element inside a repeater

Below is my markup {{post.title}} I'm trying to get the element with the…
Subtubes
  • 15,851
  • 22
  • 70
  • 105
21
votes
3 answers

e2e protractor test requiring oauth authentication

I've got an Angular app that requires authentication with Google, granting of some scopes, etc, and I'm trying to set up automatic e2e tests for it. I have protractor working well for me in general, but when we get to the google auth page, login,…
Riley Lark
  • 20,660
  • 15
  • 80
  • 128
19
votes
2 answers

Protractor Page Objects Inheritance

Given i'm building my angularjs protractor e2e tesing suite leveraging the page objects pattern. And i separate page object code in different files as much as reasonable. What would be a good approach to enable page objects inheritance? javascript…
Leo Gallucci
  • 16,355
  • 12
  • 77
  • 110
18
votes
3 answers

how to test if a string DON'T match using protractor

I'm migrating my karma-ng-scenario tests suite to protractor. I would like to do something like // karma-ng-scenario expect(element('legend').text()).not().toBe("LOGIN_CONNECT"); in the protractor way. But it seems there isn't a not() function.…
Sylvain
  • 1,399
  • 2
  • 17
  • 25
1
2 3
36 37