Open Shiqin-Li opened 10 months ago
After configuring the JavaScript section, I used the plugin to prompt 'Cypress test was stopped while running this command'. The following is the code I wrote and a screenshot of the run
import { addStreamCommands } from "@lensesio/cypress-websocket-testing"; addStreamCommands(); Cypress.Commands.add('stopVm', () => { const config = { url : "wss://xxx.xxx.com/clusters/local/api/v1/namespaces/cypress/pods/vm-vmtest-cypress-0.0/exec?container=container-0&stderr=true&stdout=true&command=qga&command=execute&command=guest-shutdown", protocol: 'test' } const option = { retryDelay: 4000, } cy.streamRequest(config, option).then(results => { expect(results).to.not.be.undefined; }) });
After configuring the JavaScript section, I used the plugin to prompt 'Cypress test was stopped while running this command'. The following is the code I wrote and a screenshot of the run