Closed mickmister closed 2 years ago
@sinansonmez Please let me know if this fixes your issue with running cypress tests 🙂
@mickmister it worked perfectly, thanks for the effort. With these enhancements, Gitpod is becoming a full-fledged development environment for Mattermost.
One additional information on this: Some of the tests are failing because it is sending the request to http://localhost:8065/api/v4/[SOMETHING]
but server is not running on localhost but remotely on Gitpod server. Please find an example error I received below.
1) Autocomplete with Elasticsearch - Users
"before all" hook for "MM-T3863 Users in correct in/out of channel sections":
CypressError: `cy.request()` failed on:
http://localhost:8065/api/v4/trial-license
The response we received from your web server was:
> 403: Forbidden
This was considered a failure because the status code was not `2xx` or `3xx`.
If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
@sinansonmez This should be fixable by editing the baseUrl
field here to be the Gitpod MM server URL: https://github.com/mattermost/mattermost-webapp/blob/66dd6ee74af9b03fe51010bdfb813857f57418a5/e2e/cypress/cypress.config.ts#L50. You can get the server's URL by running gp url 8065
in the Gitpod terminal.
Ideally this is set automatically. We may be able to set this by setting an environment variable such as CYPRESS_e2e_baseUrl
but I'm not sure if the env vars support nested values.
Summary
Inspiration from https://github.com/mikenikles/cypress-on-gitpod
This PR makes it so Gitpod can run tests using a headless chrome browser. In order to get tests to run, I modified the webapp's
cypress:run
command from:As I was getting this error with the original command:
Ticket Link
Fixes https://github.com/mattermost/mattermost-gitpod-config/issues/9