Reputation: 8444
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?
Upvotes: 5
Views: 2811
Reputation: 515
we can add the following command while executing the test
--speed 0.08
Upvotes: 0
Reputation: 306
I will just add the documentation here: Set Test Speed
A value of 1
represents the fastest emulation speed. This is the default speed
value. A lower speed
can be useful for debugging because it allows you to watch emulated actions on a screen, but it slows tests down.
For same example provided already:
testcafe chrome ./my-tests --speed 0.1
Upvotes: 0
Reputation: 1416
Another way is to use setTestSpeed in beforeEach. Here is a code snippet:
fixture`Test`
.page`http://www.google.com`
.before(async t => {
})
.beforeEach(async t => {
await t.setTestSpeed(0.3)
await t.maximizeWindow()
})
test("hello", async t => {
});
Upvotes: 3
Reputation: 8444
Found the answer after paying more attention to the documentation:
TestCafe provides the capability to change test speed. Tests are executed at full speed with minimum delays between actions and assertions, which can make it hard to identify problems when a test is running.
To slow down the test, use the --speed CLI flag. You can use values from 1 to 0.01.
testcafe chrome ./my-tests --speed 0.1
Upvotes: 9