Modern Web Testing with TestCafe by Dmytro Shpakovskyi

Modern Web Testing with TestCafe by Dmytro Shpakovskyi

Author:Dmytro Shpakovskyi
Language: eng
Format: epub
Publisher: Packt Publishing Pvt Ltd
Published: 2020-09-25T00:00:00+00:00


Figure 4.2 – Shell output after the test run with the error

As you can see, TestCafe outputs the error and the line of code where it occurred.

But how do you debug the test even before it failed? For that purpose, TestCafe has the t.debug method. Let's add it to our test:

const { Selector } = require('testcafe');fixture('My first set of tests') .page('http://demo.redmine.org/');test('My first test', async (t) => { await t.debug().click('.login-wrong');});

This method is used to pause the test execution and debug it with the browser's developer tools. You will see some buttons to navigate the test run flow in the footer of the browser window:

Unlock Page: Allows us to interact with the browser page that is currently open.

Resume: Allows us to continue the test run.

Next Action: Executes the next action or assertion:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.