So we’re using Cypress + Cucumber to perform E2E UI tests. Everything is running fine, whenever I trigger the script, it shows the cypress pop-up, and I trigger a few tasks manually. Now we want our QA person to use the same prompt to test a few specific scenarios as they will. I know one way to trigger the test is during the CI/CD pipeline, but I was wondering if there’s a way to host the app on some server, and a QA person can trigger a particular flow whenever they want.
So far I found cypress run –browser chrome –headed –no-exit –port 9000 command to keep the server active and run the tests when you click on it. But when I copy the URL and open it in another browser, I see an error saying that it can’t run the test because the browser was not opened by cypress.
Please let me know if there’s a way to achieve it.
The error you’re encountering is expected behavior from Cypress, as it prevents running tests in a browser instance that was not opened by Cypress itself. This is a security feature.
However, you can use a workaround to achieve something similar to what you’re looking for. You can run Cypress in “headed” mode and allow remote connections. Here’s an example:
npx cypress open --port 9000 --config baseUrl=http://localhost:9000
http://localhost:9000
http://<YOUR_IP>:9000
Make sure to replace <YOUR_IP> with the actual IP address of the machine running the Cypress instance. Note that this solution assumes that the QA person has access to the machine running the Cypress tests.
<YOUR_IP>
Keep in mind that this method might not provide the exact level of separation you desire since the browser has to be opened by Cypress. For more advanced usage, you might need to consider using a CI/CD pipeline to trigger your tests or looking into cloud-based testing services that offer similar functionalities.