Questions tagged [e2e-testing]

End-to-end testing is a methodology used to test whether the flow of an application is performing as designed from start to finish. The purpose of carrying out end-to-end tests is to identify system dependencies and to ensure that the right information is passed between various system components and systems.

3036 questions
31
votes
4 answers

How to login in Auth0 in an E2E test with Cypress?

I have started testing a react webapp but I didn't go far because I had issues with the login. I am using cypress e2e testing tool. A welcome page is shown with a button to login, which will redirect you to auth0 service. User is login with email…
Mikel
  • 5,902
  • 5
  • 34
  • 49
30
votes
2 answers

How to use Puppeteer in an Angular application

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 an Angular application using the npm package, but I don't understand how I can use it. For example I…
Ronaldonizuka
  • 411
  • 1
  • 4
  • 4
28
votes
4 answers

How to run Protractor e2e tests using different Angular environment variables

I use Angular environment variables to configure API endpoints: .\src\environments: environment.ts environment.test.ts environment.prod.ts The environtment files contain settings like the following which are different for local dev and…
25
votes
1 answer

Cypress: type tab key

I want to test that my forms are accessible and that I can tab between my input elements. I found this github issue asking for the feature here: https://github.com/cypress-io/cypress/issues/299 Currently I try to do .type('{tab}') and I get the…
kuceb
  • 16,573
  • 7
  • 42
  • 56
24
votes
1 answer

Automated API testing of OAuth2/OpenID Connect protected API

I'm looking into a new project that we are planning on doing API first, so that we can then implement web- and native- apps on top of, plus allow for third party integration. All fairly standard so far. We also want to have a full suite of automated…
Graham
  • 4,095
  • 4
  • 29
  • 37
23
votes
3 answers

Is there a programmatic way to change user agent in Cypress.io?

I have some ad calls that are only made on mobile devices. In Chrome, I can use Device Mode and simulate a mobile device, and the resulting ad call from the server is correctly tailored to mobile. I'm not sure how Chrome does this, except possibly…
Stephen
  • 2,410
  • 3
  • 33
  • 57
22
votes
3 answers

Async setup of environment with Jest

Before running e2e tests in Jest I need to get an authentication token from the server. Is it possible to do this globally one and set it somehow to the global environment / context for each test ? I tried it with globalSetup config option: const…
ps-aux
  • 11,627
  • 25
  • 81
  • 128
22
votes
1 answer

How to organise unit, integration, e2e tests folder structure in maven for a Java project?

I have a java project in maven and i know maven puts thing conventionally using src/main/java src/test/java and everything under test/ is usually unit test. But what if i want to introduce integration tests and E2E tests? How should i put in the…
SoftwareDeveloper
  • 1,094
  • 2
  • 15
  • 26
21
votes
2 answers

Handling third-party API requests in End-to-End testing

I want to test my Rest API with end-to-end tests. As I understand, the difference between integration tests is that we don't do in-memory system configuration, but use real test DB and network requests. But I can't understand how to handle…
21
votes
4 answers

Cypress e2e testing - How to get around Cross Origin Errors?

I'm testing a web app that integrates Gmail, Slack, Dropbox etc. I'm trying to write end to end tests with Cypress.io to verify that auth flows are working. Cypress restricts me from navigating outside my app's domain and gives me a Cross Origin…
Bill Mayo
  • 349
  • 1
  • 2
  • 8
21
votes
4 answers

How to simulate a drag and drop action in puppeteer?

I have React-DnD(Drag and drop) in my application. I'd like test it E2E. What I want to simulate is drag a particular element and drop to a particular place. How do I do this? What I have is: //test.js const mouse = page.mouse; await…
Khushi
  • 1,759
  • 6
  • 26
  • 45
20
votes
2 answers

Run a NOT headless chrome on a docker container

Running chrome on docker machines is only possible when chrome is headless. Unfortunately, headless chrome can't ignore certificate errors which prevents my tests from running. I'm trying to run an already working NodeJS e2e test environment on a…
Bishok
  • 399
  • 1
  • 2
  • 9
19
votes
5 answers

Cypress: interrupt all tests on first failure

How to interrupt all Cypress tests on the first test failure? We are using semaphore to launch complete e2e tests with Cypress for each PR. But it takes too much time. I'd like to interrupt all tests on the first test failure. Getting the complete…
Florent Arlandis
  • 866
  • 1
  • 10
  • 29
19
votes
5 answers

Cypress ParseError: 'import' and 'export' may appear only with 'sourceType: module'

I updated Cypress from 3.0.3 to 3.1.3. Im using ES6 import/export modules which must be working related to docs. But Im getting a line with undefined in terminal and following error in the…
Mark
  • 1,750
  • 2
  • 12
  • 15
19
votes
1 answer

AngularJS Testing: Protractor, Karma, Jasmine in a Yeoman App

I use this yeoman generator: https://github.com/Swiip/generator-gulp-angular It installs three testing applications: Jasmine, Karma , Protractor According to this article (Should I be using Protractor or Karma for my end-to-end testing?), I should…
Andi Giga
  • 3,744
  • 9
  • 38
  • 68