Skip to content

Commit

Permalink
test: fix feature e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Nov 7, 2024
1 parent 2a6c5ee commit 7787c5b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 14 additions & 0 deletions frontend/cypress/integration/feature/feature.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
///<reference path="../../global.d.ts" />

describe('feature', () => {
const baseUrl = Cypress.config().baseUrl;
const randomId = String(Math.random()).split('.')[1];
const featureToggleName = `unleash-e2e-${randomId}`;
const projectName = `unleash-e2e-project-${randomId}`;
Expand Down Expand Up @@ -35,6 +36,19 @@ describe('feature', () => {
beforeEach(() => {
cy.login_UI();
cy.visit('/features');

cy.intercept('GET', `${baseUrl}/api/admin/ui-config`, (req) => {
req.headers['cache-control'] =
'no-cache, no-store, must-revalidate';
req.on('response', (res) => {
if (res.body) {
res.body.flags = {
...res.body.flags,
flagOverviewRedesign: true,
};
}
});
});
});

it('can create a feature flag', () => {
Expand Down
1 change: 0 additions & 1 deletion frontend/cypress/support/UI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export const deleteFeatureStrategy_UI = (
},
).as('deleteUserStrategy');
cy.visit(`/projects/${project}/features/${featureToggleName}`);
cy.get('[data-testid=FEATURE_ENVIRONMENT_ACCORDION_development]').click();
cy.get('[data-testid=STRATEGY_REMOVE_MENU_BTN]').first().click();
cy.get('[data-testid=STRATEGY_FORM_REMOVE_ID]').first().click();
if (!shouldWait) return cy.get('[data-testid=DIALOGUE_CONFIRM_ID]').click();
Expand Down

0 comments on commit 7787c5b

Please sign in to comment.