Questions tagged [angular-e2e]

This tag should be used when asking questions about angular end to end testing, in combination for example with protractor which is the official angular framework for writing end to end tests. this will help to categorize these questions and get the right solutions for them.

167 questions
2
votes
1 answer

Angular ViewEncapsulation.ShadowDom elements in Protractor give StaleElementExceptionError

I have an iframe inside an angular component, into which I am injecting a component X dynamically using component factory (appending the native element to the iframe's body). The reason I am doing this is because I need media queries to function in…
2
votes
1 answer

Protractor test always passes, if the spec is inside a loop

PROBLEM : With the below code in the CODE section , the expect block inside the loop forEach is always passing. Example scenario and its respective test report screenshot expect('bt bt-primary').toContain('btn'); MY REQUIREMENT : I need to get…
Neyo
  • 523
  • 1
  • 8
  • 23
2
votes
1 answer

Getting this error when running ng e2e on mac with visual studio code

Setup : @angular/cli@8.1.2 @ionic/cli@6.12.3 cordova@10.0.0 npm@6.14.10 “protractor”: “~5.4.0 Mac OS : Catalina This is the error I am getting ** Angular Live Development Server is listening on localhost:4200, open your browser on…
2
votes
1 answer

Handling alert in Protractor

I have a simple case of handling an alert with Protractor which I could not solve. I simply want to navigate to another application page after accepting the alert. I've tried the following cases which did not succeed: (PS, if I comment out the…
suat
  • 4,239
  • 3
  • 28
  • 51
2
votes
2 answers

How to run e2e test with ngx-build-plus (extra-webpack-config)?

I use ngx-build-plus to include a special webpack loader to integrate special custom files into our Angular-CLI build process (Angular 10). Everything works fine, however I couldn't find a way to use e2e-tests this way, it's not even taking the…
hoeni
  • 3,031
  • 30
  • 45
2
votes
2 answers

Not able to mock API calls using ng-apimock

I am trying to mock the api requests to auth0 using ng-apimock while running the e2e tests using protractor in an angular project. While running the e2e tests using protractor the request to browser.get('/') redirects to…
2
votes
1 answer

Angular Protactor e2e tests CI for Azure Devops

After I finished my e2e tests and test them if they work. I wanted to change the Azure Devops CI to run the e2e tests. So I added these settings to the YAML file: pool: vmImage: 'ubuntu-latest' steps: - task: DeleteFiles@1 displayName: 'Delete…
MDN M
  • 23
  • 3
2
votes
3 answers

e2e how to test login sucess case in angular protractor

Just started with e2e and I want to test the login success case in Angular app. So here is my test case it("when login is successful — user object should be set in storage", () => { loginPage.fillCredentials(); // wait until…
Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
2
votes
2 answers

Why can't I use: "await .getAttribute()" in Protractor, even though it returns a promise?

I am trying to change my Protractor tests to use async/await instead of the selenium control flow, but it won't let me use await for the .getAttribute() function. All i get is this error Message: "SyntaxError: await is only valid in async function".…
Moke
  • 43
  • 5
2
votes
0 answers

Angular 7 e2e protractor tests code coverage for source files

I am trying to achieve code coverage for source code from e2e tests. I used nyc npm module for coverage. It's able to provide coverage report on e2e tests files including page object files, but there is no coverage report for actual source file.…
2
votes
1 answer

Angular 7 Protractor Non-Angular LoginPage

In an Angular Project I started working on E2E Tests. I'm using Protractor + Jasmine to create and run tests. The WebApp I'm trying to test starts with a login page which is a non Angular Page provided by our customer. After successfully logging in…
Adrian
  • 91
  • 1
  • 9
2
votes
1 answer

e2e testing angular 7: Failed: Cannot read property 'fetchData' of undefined

I'm trying to do some e2e testing for my service in angular 7, the method return Observable, this is my methode: import { Injectable } from '@angular/core'; import { UrlDecoratorService } from "../../common/url-decorator.service"; import {…
2
votes
1 answer

Prevent Protractor from compiling angular code

the Protractor tests appear to be slow, it's because Angular has to compile the code every time. I tried ng e2e -s false, I read that on net. But it is giving error ng e2e -s false. Please help, how can I load e2e faster.
raju
  • 6,448
  • 24
  • 80
  • 163
2
votes
1 answer

protractor - "angular is not defined" when using `browser.setLocation('/')`

Is it because browser.setLocation is not supported in angular v6 (like by.model and by.binding)? I have tried await browser.waitForAngular(), but it doesn't seem to change anything. I do wish to keep synchronization between angular/protractor (e.g.…
Maxime Dupré
  • 5,319
  • 7
  • 38
  • 72
2
votes
1 answer

ng e2e test timesout

Problem My e2e test stopped working some time ago with no changes made to it. I don't know why it is timing out, and I'm not sure how to diagnose this myself. I have learned that the code in my test is actually a Promise that gets run when Angular…
Jake Smith
  • 2,332
  • 1
  • 30
  • 68
1 2
3
11 12