Link Search Menu Expand Document

Cypress Command: startLab

Summary

cy.startLab() - Start the lab by visiting it in the Cypress headless browser

Parameters

none

Example

it('starts the lab', () => {
  cy.startLab();
});

Waiting

This command will wait until the lab environment is started and the terminal is ready to accept input. In lab environments with a VS Code editor, it does not wait for the VS Code editor to finish loading.

Verification

This command will verify that the scenario started successfully.

Notes

Because diagnostic logging is not available for code within Cypress’s before hooks, it is suggested to place this code directly inside the it block to reveal more information about why a lab has failed to start.

  • Alternatively, call performAllLabActions to test a lab that is completely instruction-guided
  • Also call watchForVsCodeLoaded to ensure copy-to-editor actions are not performed before VS Code is ready, otherwise those actions may fail.