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
95
votes
8 answers

Alpine Docker ERROR: Unable to lock database: Permission denied ERROR: Failed to open apk database: Permission denied

So I have used the default docker for testcafe which on docker hub is testcafe/testcafe and I have to run a few testcafe scripts. However, I need the screenshot that fires on error, to be uploaded to somewhere where I can look at it later after…
Vladimir_314159
  • 1,457
  • 1
  • 9
  • 21
23
votes
4 answers

TestCafe - How to check if a web element exists or does not exist without failing the test?

I'm trying to write a script that needs to adapt it's workflow behavior depending on whether a particular browser object found by CSS selector exists or does not exist. I do not want to use a document.getElementByID method as this is not technically…
Seth Eden
  • 1,142
  • 2
  • 20
  • 42
17
votes
1 answer

Passing arguments to a function using async/await

I'm trying to pass arguments to a function that uses async/await. I've defined my function like so // common.js export const myAsyncFunc = async (t, textA, textB) => { await t .typeText('#input-1', textA) .typeText('#input-2',…
dace
  • 5,819
  • 13
  • 44
  • 74
13
votes
2 answers

Write current URL to console in TestCafe

I have a variable "currentPage" which I want to set to the current URL on the running page. But to see that the URL is correct I want to print it to the console. What ever I try I keep getting "not defined", "object", ... If I on the other hand use…
ASE
  • 355
  • 2
  • 12
11
votes
1 answer

How to ignore the "ResizeObserver loop limit exceeded" in TestCafe

I'm currently using TestCafe for some e2e tests. I've run into the following error 1) - Error in Role initializer - A JavaScript error occurred on "http://localhost:3000/". Repeat test actions in the browser and check the console for…
John Devitt
  • 690
  • 2
  • 8
  • 22
11
votes
1 answer

TestCafe - Wait for page load after click on link

I'm using testcafe for e2e testing my current e-commerce project. On the product listing page, I use a Selector to select a product tile and perform a click. After this, the page loads the product detail page and I can continue with testing. The…
Cornel Janssen
  • 681
  • 1
  • 11
  • 33
11
votes
1 answer

In which ways is TestCafe better than Selenium?

What problems does TestCafe overcome that justify its adoption over Selenium? Is it worth to port over older test suits to TestCafe?
11
votes
1 answer

Does TestCafe fit into BDD and cucumber?

I understand TestCafe attempts to replace Webdriver based test frameworks like Selenium. I couldn't find examples of integration with BDD (cucumber) yet.
Albino Cordeiro
  • 1,554
  • 1
  • 17
  • 25
9
votes
1 answer

How to expect url is redirect in TestCafe?

I want to detect URL is redirected to the login page when clicking something that needs to log in first. Is there any way to achieve that?
Knovour
  • 319
  • 3
  • 16
9
votes
2 answers

How to do automated UI testing of devexpress controls?

I want to do automated testing of DevExpress control. I have found some frameworks like guia, NUnitForm etc. but they all are for standard WPF controls. Is there any other framework which can help me to test DevExpress control?
Rudresh Bhatt
  • 1,935
  • 2
  • 23
  • 29
8
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
  • 745
  • 2
  • 8
  • 15
8
votes
1 answer

How much is too much assertions in automation testing?

I am given the task to build a test suit using testcafe and, as I write tests I stumble upon one particular question “how much assertions is too much?”. Basically, after the tests are done, a report is generated. Looking at the report it is not…
8
votes
3 answers

Testcafe command not found when installed through "npm install"

When I installed testcafe with command sudo npm install -g testcafe I was able to use the command "testcafe" in the terminal, running tests like testcafe browser test, but now I formatted my OS and installed it with just npm install with the…
8
votes
2 answers

Command to run two or multiple tests

How to run two or more tests from a single TestCafe CLI command. -t "Test name" accepts only one test name. https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-t-name---test-name Requirement: Want to run…
8
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…
1
2 3
99 100