I'm writing my cypress tests in javascript in VS code. Is there a way in to pause the test run and trial and error different things in terminal/console, something similar to "byebug" in ruby? changing in the code directly and rerunning takes a lot of time.
CodePudding user response:
You can use cy.pause()
to enable stepping through functions in the test.
it('some test', () => {
cy.pause()
.get('foo') // other commands
});
CodePudding user response:
Basically at the end of your test run or even during a pause, you can use cy.now()
in your browser console. cy.now()'s first arg will be the name of the cypress command and the following args will be the cypress command arguments.
Here is a basic example.
// test file
cy.pause()
// in browser console
cy.now('get', '.your-selector')
A more detailed answer.