Closed jamesdonoh closed 3 years ago
@jamesdonoh Would it be okay to try this solution? https://docs.cypress.io/guides/guides/web-security.html#Disabling-Web-Security
currently researching if there are other implications of turning it off.
The above has already been implemented.
@jamesdonoh By default cypress tests will run as if they were ran outside of the uk as the cypress variable CYPRESS_UK
is set to default.If i remember correctly this variable CYPRESS_UK
was added to fix the cypress failing locally because of cross domain issues.
Currently cypress doesnt support visiting multiple domains in one test https://github.com/cypress-io/cypress/issues/3985
Few tests are failing because in the same test we are trying to fetch another domain.
Also this issue was being avoided by usingcy.request
instead of cy.visit
in most of the tests as cypress request command doesn't throw cross domain issues.But i see in case of amp tests apart from making a cy.request
before each test is run there is cy.visit
being called within the test which causes the tests to fail.Might try replacing them with request instead of visit and see if the tests passes.
I have tried running all the tests on my machine against test and live environments without passing any value to CYPRESS_UK
as default its set to false and all the tests passes no cross origin issues one or two issues failed which are not related to whether CYPRESS_UK
is set or not.If you wanna run the tests as if they are run from uk then you need to set CYPRESS_UK
=true but you will see cross domain issues.
Will there be any use cases where you have to run locally against test env setting CYPRESS_UK=true
?
The issues which i noticed irrespective of CYPRESS_UK
set to true or false
The above issues needs to be fixed before we fix the env var CYPRESS_ENV
issue.
Describe the bug Our README says to use
CYPRESS_UK
when running tests in the UK against test/live environments.However this seems to not work correctly depending on the service being tested.
To Reproduce Note: this affects many tests, the below is just given as one example.
Running the tests locally from inside the UK against test this passes:
however without
CYPRESS_UK
set it fails.Conversely, this passes:
however with
CYPRESS_UK
set it fails.Expected behavior It should be possible to get the entire (SMOKE=false) test suite to pass in the UK.
Additional context The relevant README section should be reviewed/updated as part of this work.