Questions tagged [testcafe]

TestCafe and TestCafe Studio - end-to-end testing, simplified. Questions from users of the open-source TestCafe and TestCafe Studio community edition subscribers.

Resources

1850 questions
5
votes
2 answers

How to configure TestCafe Quarantine Mode to pass if there is at least 1 successful execution?

As per TestCafe Quarantine Mode documentation, I can see this is the default behaviour: "The most frequent outcome is recorded as the test result." I'd like to configure Quarantine Mode to pass if there is at least 1 successful execution (even if…
user2253130
  • 589
  • 2
  • 5
  • 14
5
votes
1 answer

Writing a Testcafe test to assert a loading spinner is visible after making a fetch request

I have the following scenario: Load page Expect spinner is hidden Type username Click search Expect spinner display After a few seconds delay, expect spinner to hide Assert the right user details are displayed Here is the working demo I have…
Nikhil
  • 905
  • 7
  • 9
5
votes
2 answers

How to run all test scripts on a single browser instance

I am using Testcafe (free version) with Java Script. I want to run all my test cases (resides in multiple test scripts in __test__ directory) in a single browser instance (That way 1 time log in) per browser type. For example, 1 instance for…
5
votes
2 answers

How to scroll up and scroll down using TestCafe?

How can I scroll up and scroll down using TestCafe? I tried window.scroll(), window.scrollTo()and throws an error window is not defined.
chris
  • 119
  • 1
  • 6
5
votes
2 answers

I cant get the expected URL with TestCafe

I want to assert that I am on the "Home Page" after the user is logged in the Home Page. I made a function 'onPage' to return me the contains of the URL. Here is the code: function onPage (secondPage, URL) { if (secondPage === 'Home Page') { …
5
votes
2 answers

In Testcafe, how can I wait for a 2nd element of the same selector to appear?

I have a scenario in which multiple elements of the same className appear one after the other (it depends on a server response). What I'm trying to achieve is passing the test only after 2 elements of the same selector are present, but currently,…
tkore
  • 1,101
  • 12
  • 31
5
votes
0 answers

Testcafe concurrency throwing weird errors

I have a suite of tests that, when running without concurrency, all pass fine. When I start running them with concurrency, they start to fall apart. I do not believe that the tests have inter-dependencies that are making them fail. When the test…
5
votes
1 answer

TestCafe: Text entered in textfield is backwards

Entering text into a textfield is entered backwards This does not happen in Safari and hasn't happened in the past. No changes were made that should have caused this. TestCafe 1.2.0 NPM 6.9.0 export async function logInMyAccount(emailElement,…
5
votes
1 answer

How to get the css property of a tags in testcafe?

I have a simple code with a structure that looks something like this:
My goal is to assert the css property whether it is equal to value of not. I have tried…
Wilbert
  • 149
  • 7
5
votes
2 answers

Is there a way to bail the suite if a certain test fails?

I have one test that, if it fails, indicates larger problems with the app. There wouldn't be any point in running the rest of the tests if that one test fails. Is there a way to bail the suite if a single test fails but run all tests if that test…
jcollum
  • 43,623
  • 55
  • 191
  • 321
5
votes
2 answers

TestCafe: Failed to complete a request to url

Summary We have smoke tests that run shortly after deployment on our web application. Sometimes it takes the login page takes a while for its first load. Error - Error in Role initializer - Failed to complete a request to…
dapperdan1985
  • 3,132
  • 2
  • 15
  • 26
5
votes
1 answer

Testcafe - dealing with video

I'm testing a page with an embedded video where using the console I can play, stop, and get the current playing time. When I try to translate that to Testcafe, I get errors. Here's what I have working on the console: var vid =…
user9518022
5
votes
2 answers

Select a child element from a parent using a cousin node of the same parent

I'm using TestCafe Selectors to select elements. This is a complex nested scenario of cousin child. Here is the HTML to get an idea of what I mentioned above: In the picture, I have mentioned 1 and 2 which are the parent element (has same DOM) who…
Psdet
  • 659
  • 9
  • 24
5
votes
1 answer

TestCafe beforeEach hook - how to execute a function and declare a variable

I am using TestCafe and looking for a solution to do two things in a beforeEach hook: 1. execute a function (login before each test) 2. create unique test data I am able to achieve both separately, but not both in the same hook: This works to log…
5
votes
1 answer

Container circleci/node:10.14-browsers - ERROR: euid != 0,directory /tmp/.X11-unix will not be created

I’m trying to run browser testing on CircleCi using TestCafe. I have followed this documentation. The major problem is that the chrome browser isn't able to open. CircleCi is able to successfully download the image because the spin environment is…
Psdet
  • 659
  • 9
  • 24