debug
Overview
Use the debug
command to pause the execution of a test in the browser.
By pausing the test, you can switch to the browser, open DevTools, and inspect the web page in real-time. This can be useful for debugging the test.
Usage
await browser.debug();
Usage Examples
it("should demonstrate the debug command", async ({ browser }) => {
await browser.$("#input").setValue("FOO");
await browser.debug(); // switch to the browser and change the value of #input to "BAR"
const value = await browser.$("#input").getValue();
console.log(value); // outputs: "BAR"
});
References
We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.