Questions tagged [testcafe]

TestCafé is a Node.js tool to automate end-to-end testing.

Resources

1417 questions
7
votes
1 answer

Is there a way to access clipboard contents?

I am testing a page that has an embed modal with a textbox with an embed code and a "Copy" button that should copy the contents of the textbox onto the clipboard so a user can paste it elsewhere. Is there a way to test clicking the "Copy" button and…
7
votes
1 answer

How to get the json response of a RequestLogger

RequestLogger A have this test outside the main test controller, using page model and this recipe. /** Used to get the periodic analytic id. Whenever we are viewing an asset, the server must respond with an id. This id is later used by the…
7
votes
1 answer

TestCafe-- Proper way to assert an element is visible

Based on various forum discussions, the TestCafe documentation, and trying it out to compare results, I am still not certain which is the correct (or best) way to assert that a page element is visible. await…
Meg
  • 659
  • 7
  • 18
7
votes
3 answers

Vue: How do you add E2E tests after not including them in initial webpack template?

To start my project, I ran vue init webpack my-project, but I excluded E2E tests. Now I changed my mind and do want to include E2E tests. How can I add them to my project? Note to readers: Tarun Lalwani's answer worked great for me. However you may…
Adam Zerner
  • 12,221
  • 13
  • 62
  • 128
7
votes
1 answer

Debugging UI Tests written with Testcafe

UPDATE: Regarding to another(hammerhead) bug we were forced to use minified code in testcafe test. Since this bug is resolved we're now able to run the tests against non minified code. But still, we have the problem that source maps get removed by…
C.d.
  • 9,504
  • 6
  • 37
  • 50
6
votes
2 answers

Testcafe can see button but not click on it

In a testcafe test how can I click on an element that is clearly clickable (with t.debug() I'm able to click on the element) and visible without using ClientFunction, or t.eval -- these "workarounds" recommended in testcafe's github issues do not…
sjt003
  • 1,637
  • 4
  • 18
  • 33
6
votes
2 answers

TestCafe how to reload actual page

Is there a way to reload the actual tested page I'm visiting in TestCafe and not the site that TestCafe is running under. I've tried using: await t.eval(() => location.reload(true)); but that just reloads the server page that TestCafe uses. So…
ruazn2
  • 475
  • 1
  • 6
  • 12
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
  • 735
  • 5
  • 20
6
votes
2 answers

How to wait for an element to disappear in TestCafe?

When I need to wait for an element to become visible I can simple call the selector as a function like this: await element.with({ visibilityCheck: true })(); But how can I wait for an element to disappear?
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
  • 27,515
  • 13
  • 48
  • 91
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

TestCafe - How can I run multiple fixtures (one after the other, not concurrent)?

I have multiple fixtures (interaction between a website and a hybrid app) and I would like to have a test suite run (Smoke test, regression test ...) but I'm not sure how to do it. This is how my tests look like: What I want to do is run all tests…
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
1 answer

--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,813
  • 17
  • 22
1
2
3
94 95