-
-
Notifications
You must be signed in to change notification settings - Fork 740
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR fixes a race condition between e2e tests where bulk archiving all toggles in the default project would delete toggles used for the features e2e tests. It does by isolating the features.spec and overview.spec to their respective projects, so that they always operate on isolated data. ### Future enhancements: I'm not particularly fond of passing the projectName through to all the helper methods. It complicates the tests more than it should. I would like to be able to set the project once per test and have all the helper methods be aware of the context. Something like this should work: ``` before(() => { cy.wrap('projectId').as('project'); }) ``` And in the helpers: ``` export const createFeature_API = ( featureName: string, options?: Partial<Cypress.RequestOptions>, ): Chainable<any> => { return cy.get('@project').then((project) => { projectName = project || 'default'; return cy.request({ url: `${baseUrl}/api/admin/projects/${projectName}/features`, method: 'POST', body: { name: `${featureName}`, description: 'hello-world', type: 'release', impressionData: false, }, ...options, }); }); }; ```
- Loading branch information
1 parent
5c726c3
commit c0369b7
Showing
5 changed files
with
55 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters