0
votes

I have the following use case. There are two sites on different domains. usersettings.com (written in ExtJS) and myapp.com (angular app). Usersettings.com contains configurations that would alter the UI of myapp.com. Please see the screenshot for example.

cypress use case

Now since I need to modify user-settings to different ones before running all the test files. What would be the best approach to solve this use case in Cypress.

One approach I am planning to use is a single Cypress spec file to visit usersettings.com and alter the configuration of the user-settings site. I can achieve it by coding it as a support file. Post that, I can run my entire test suite (having multiple *.spec.js files). The question is it possible and is it a good approach against other alternatives (if any)?

1

1 Answers

0
votes

It can be done by setting up the test in a separate test case

//Global setup

context('doubleDomainTest', () => {
    it('firstDomain', function () {
        //Code to run on the firstDomain
    })
    it('secondDomain', function () {
        //Code to run on the secondDomain
    })
})