I attempted to benchmark running times but couldn't get a conclusive result.
Is there any difference between:
await t.expect(Selector('something').visible).ok()
await t.expect(Selector('something1').visible).ok()
await t.expect(Selector('something2').visible).ok()
and
Promise.all([
t.expect(Selector('something1').visible).ok(),
t.expect(Selector('something2').visible).ok(),
t.expect(Selector('something3').visible).ok()
])
?
It appears as though in each case the assertions are run serially.
Note: I ask to see whether actions and assertions on multiple matching yet independent elements can be sped up, I understand in most cases we want tests to run synchronously.
Use Assertions to verify page action results. Assertions are comparisons that help you determine if the page state is correct. Assertions compare the actual value of a page-related variable to the value you expect it to have. If an assertion fails, the test fails too.
TestCafe includes a comprehensive set of server-side API testing tools. You can add dedicated API tests to your test suite, or include API testing methods in existing functional tests.
Use the testCafe. createRunner method to create a Runner . Specifies the browsers in which tests run. Configures the test runner to run tests from the specified locations.
TestCafe has internal commands queue, which is used to form a chain of all test controller API calls. So you are right, there should be no difference between a set of serial await
ed assertions and Promise.all
. Currently you have to move all code that fetches data from the browser in a single ClientFunction to achieve parallel data acquisition for a number of elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With