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
259
votes
16 answers

Cypress: run only one test

I want to toggle only running one test, so I don't have to wait for my other tests to see the result of one test. Currently, I comment out my other tests, but this is really annoying. Is there a way to toggle only running one test in Cypress?
kuceb
  • 16,573
  • 7
  • 42
  • 56
108
votes
9 answers

How to fill an input field using Puppeteer?

I'm using Puppeteer for E2E test, and I am now trying to fill an input field with the code below: await page.type('#email', 'test@example.com'); It worked, but I found the email address was typed into the field one character by one character as if…
choasia
  • 10,404
  • 6
  • 40
  • 61
75
votes
7 answers

Cypress pipe console.log and command log to output

Is it possible to redirect or capture Cypress browser log and command log to output? I read some Cypress github issues on this topic. But I don't know how to make it work. Basically, I want to capture all the Cypress GUI command logs in the headless…
Jake He
  • 2,417
  • 3
  • 29
  • 41
73
votes
6 answers

In Cypress, set a token in localStorage before test

I want to login and set a localStorage token on the client (specifically jwt) How can I accomplish this using cy.request, as suggested in the Cypress Documentation?
kuceb
  • 16,573
  • 7
  • 42
  • 56
72
votes
13 answers

How to test file inputs with Cypress?

How can I write an e2e test of flow that requires interaction with the file Input DOM element? If it's a text input I can interact with it (check value, set value) etc as its a DOM component. But If I have a File Input element, I am guessing that…
sidoshi
  • 2,040
  • 2
  • 15
  • 30
61
votes
6 answers

How to run google chrome headless in docker?

My problem is how to run google chrome in docker container for e2e testing. I create a Dockerfile from official Jenkins image, but when try to run google chrome, it crashes and show the error: Failed to move to new namespace: PID namespaces…
Israel Perales
  • 2,192
  • 2
  • 25
  • 30
54
votes
5 answers

Can protractor be made to run slowly?

Is there a way to run a Angular E2E test written using protractor slowly so that I can watch what is happening?
cortfr
  • 1,115
  • 1
  • 10
  • 14
49
votes
4 answers

Use element by css to check if element exists in Protractor

In a protractor end to end test, I want to check if an element exist using element(by.css(...)), my code: var myElement = element(by.css('.elementClass')); expect(myElement).toBeUndefined; This test fails, it says: Expected { locator_ : { using…
Michiel
  • 4,160
  • 3
  • 30
  • 42
41
votes
3 answers

Integrating Protractor with Yeoman via Grunt

I want to integrate Protractor with a scaffold produced by Yeoman. I followed a tutorial and therein, the older scenario-runner was used for setting up e2e testing (via grunt). I would like to upgrade my scaffold and use Protractor instead. Any…
user2733090
  • 449
  • 1
  • 5
  • 4
40
votes
4 answers

What is a proper way of end-to-end (e2e) testing in Vue.js

Of cause I can use selenium-standalone with xpath to test an app. But testing SPA could be challenging sometime. But, for example angularjs's team provides protractor for this purpose. The reason behind protractor as I can see is that protractor…
S Panfilov
  • 16,641
  • 17
  • 74
  • 96
37
votes
3 answers

Cypress: How to know if element is visible or not in using If condition?

I want to know if an element is visible or not. I am not sure how to do that. I know that we can run this: cy.get('selector').should('be.visible') But if element is invisible then test is failed. So I just want a boolean value if element is not…
Ayyaz Zafar
  • 2,015
  • 5
  • 26
  • 40
36
votes
4 answers

Should e2e tests persist data in real databases?

I've been reading a lot about e2e testing and one thing I cannot understand is how "real" should e2e tests be. Regardless of the tools I use for the e2e tests, I've seen that most of the time they hit either local, development or alpha…
34
votes
3 answers

Cypress test: is .contains() equivalent to should('contain')?

Is this: cy.get('[name=planSelect]').contains(dummyPlan) equivalent to this: cy.get('[name=planSelect]').should('contain', dummyPlan) And if so, which is preferred? The first is more of an implicit assertion, but it's shorter and cleaner to my…
redOctober13
  • 3,662
  • 6
  • 34
  • 61
33
votes
6 answers

cy.url() and/or cy.location('href') does not return a string

I have an editor page. When I add any content and click the "Save" button my URL will change, adding a random id in the URL. I want to check if my ID's are changing every time when I click the "Save button". I save the URL result in variable and…
Narine Poghosyan
  • 853
  • 3
  • 16
  • 26
32
votes
4 answers

Can I access parameters in my protractor configuration file?

I start my protractor tests by running the following: protractor protractor.conf.js --params.baseUrl=http://www.google.com --suite all I would like to run a 'before launch' function which is dependant of one parameter (in this case, the baseUrl).…
Julio
  • 849
  • 2
  • 10
  • 17
1
2 3
99 100