Common issues (`run cypress tests`)
"AssertionError: expected 404 to equal 200" error
One of the most common errors is a 404 on a page due to outdated URLs in the theme configuration. For example, this can happen at the early stages of development, when mock pages are replaced with real ones due to the sync.
To fix this, simply replace the wrong url with the correct one in THEME_NAME/cypress/support/variables.js
"Cypress could not verify that this server is running" error
This error is caused by incorrect or missing CI/CD variables in Gitlab. Navigate to your theme in GitLab, then to Settings > CI/CD > Open the section called Variables and check the following variables exist and configured correctly:
-
HTTP_AUTH_PASSwith the basic auth password as ‘value’ (make sure to tick the ‘masked’ checkbox and untick the ‘protected’ checkbox) -
HTTP_AUTH_USERwith the basic auth username as ‘value’ (untick the ‘protected’ checkbox) -
DEPLOY_TEST_DOMAINwith thetest-CUSTOMER.clouduite.com URLas ‘value’ (this is necessary because some themes have a domain name that is different from the theme name) (untick the ‘protected’ checkbox)
Mono-repo’s include a different "gitlab-ci" template, so for mono-repos it is necessary to add the sub-theme name in lowercase characters to the domain key: DEPLOY_TEST_DOMAIN_theme