'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?
Solution 1:[1]
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 => {
});
Solution 2:[2]
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
Solution 3:[3]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Janaaaa |
Solution 2 | Mate Mrše |
Solution 3 |