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
6
votes
1 answer

File upload in Testcafe with hidden input

I want to test upload folder/ multiple files using testcafe. It has couple of steps to upload files. Step - 1: Click on file browse button to select files Step - 2: Native Confirmation box to confirm the Upload Step - 3: Click on Upload button to…
6
votes
1 answer

How to add recursive function checking xhr response in testcafe script?

I'm trying to write a test download works, which requires to check if xhr response has status READY. I created a client function in TestCafe, using promises, but it's failing in case of recursion. How should I fix my code to handle this situation?…
6
votes
1 answer

Using Testcafe with Appium

I'm searching for some time now how to use TestCafe with Appium. Long story short: testing env is a node.js env; automated test script is written in typescript using TestCafe; the plan is to execute those tests on desktop browsers and on mobile…
Eugen
  • 785
  • 6
  • 22
6
votes
2 answers

Testcafe get text from element

I'm trying to get a text from a modal on Chrome. Using the console, I can get the inner text as follows: document.querySelector('.my-form > a').innerText // returns http://a-url.com Now, on my test, I can evaluate the element using const myText =…
6
votes
1 answer

Does TestCafe require useRole call in every test/beforeEach

I've been evaluating TestCafe for an app that requires user authentication. The documentation isn't very clear and I've had trouble getting a straight answer on how we should be using useRole. Our application requires user authentication, right now…
helion3
  • 34,737
  • 15
  • 57
  • 100
6
votes
1 answer

Testcafe unable to determine if an element is enabled or disabled

I'm using the TestCafe 0.23.3. I'm trying to verify an element if it is enabled or disabled. Here is the HTML node of the element when it is disabled:
6
votes
2 answers

Testcafe - Test command line argument outside test case

As I'm getting familiar with Testcafe, I'm trying to use a command line argument to give the user more information on how to run tests. For that reason, I'm using the minimist package. However, I cannot print or use any variables outside the test…
user11063797
6
votes
1 answer

Changing user agent on headless chrome

I have an issue with changing the user agent. I am trying to use the following line in my runner.js file in the browsers array : chrome:headless:userAgent=Mozilla/5.0\ \(Linux\;\ Android\ 5.0\;\ SM-G900P\ Build/LRX21T\)\ AppleWebKit/537.36\…
6
votes
1 answer

Need Help to check if element is in current Viewport with Testcafe

I'm trying to implement a custom method to find out if the element is in the current view port Below is the snippet of code that I've tried to implement but the outcome does not render the boolean result: export const isElementInViewport = () =>…
6
votes
2 answers

--skip-js-errors on specific test cases

I'm testing functionality that includes redirecting to an external page which I do not control. This page is throwing errors causing the test to fail. Is there a way to ignore js errors for one specific test only? (I want errors on my site to cause…
ioseph
  • 1,887
  • 20
  • 25
6
votes
1 answer

Typescript: How to manage dependencies with conflicting type declarations?

I have the error: Subsequent variable declarations must have the same type This is occurring because two of my dependencies, both of which I need; declare the same type. Jest :/node_modules/@types/jest/index.d.ts => declare var test: jest. testcafe…
micahblu
  • 4,924
  • 5
  • 27
  • 33
6
votes
2 answers

How to use dynamic url's with testcafe fixture/tests

Taking this fixture I would like to set the checkoutId based on the result from the API call in the before fixture hook so I can use it to set the page on my tests let checkoutId; fixture`Check out as guest user` …
Andrew
  • 5,395
  • 1
  • 27
  • 47
6
votes
1 answer

Conditional test to bypass pop up with Testcafe

I'm using testcafe to run some tests in an ecommerce page, but a random pop up is breaking the test. When it appears on the window, the Testcafe is unable to click on the next selector and move forward with the test, and then fail. Currently, I'm…
5
votes
2 answers

Cannot find module 'faker' or its corresponding type declarations.(2307)

I was trying to use 'faker' with TypeScript in TestCafe Studio. But I'm getting an error saying Cannot find module 'faker' or its corresponding type declarations.(2307) import * as faker from 'faker'; This is what I have tried in TestCafe.
5
votes
4 answers

How to slow down test execution in TestCafe?

I want to check UI test execution written by another developer. It is too fast for my eyes and brain to catch what is happening. How do I slow down the execution of tests in TestCafe?
Mate Mrše
  • 7,997
  • 10
  • 40
  • 77