mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
revert test file
This commit is contained in:
parent
e5fa72ff25
commit
36ba9c68dd
@ -27,29 +27,29 @@ describe('feature toggle', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// after(() => {
|
after(() => {
|
||||||
// const authToken = Cypress.env('AUTH_TOKEN');
|
const authToken = Cypress.env('AUTH_TOKEN');
|
||||||
|
|
||||||
// cy.request({
|
cy.request({
|
||||||
// method: 'DELETE',
|
method: 'DELETE',
|
||||||
// url: `${
|
url: `${
|
||||||
// Cypress.config().baseUrl
|
Cypress.config().baseUrl
|
||||||
// }/api/admin/features/${featureToggleName}`,
|
}/api/admin/features/${featureToggleName}`,
|
||||||
// headers: {
|
headers: {
|
||||||
// Authorization: authToken,
|
Authorization: authToken,
|
||||||
// },
|
},
|
||||||
// });
|
});
|
||||||
|
|
||||||
// cy.request({
|
cy.request({
|
||||||
// method: 'DELETE',
|
method: 'DELETE',
|
||||||
// url: `${
|
url: `${
|
||||||
// Cypress.config().baseUrl
|
Cypress.config().baseUrl
|
||||||
// }/api/admin/archive/${featureToggleName}`,
|
}/api/admin/archive/${featureToggleName}`,
|
||||||
// headers: {
|
headers: {
|
||||||
// Authorization: authToken,
|
Authorization: authToken,
|
||||||
// },
|
},
|
||||||
// });
|
});
|
||||||
// });
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Cypress starts out with a blank slate for each test
|
// Cypress starts out with a blank slate for each test
|
||||||
@ -62,9 +62,9 @@ describe('feature toggle', () => {
|
|||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
|
||||||
if (passwordAuth) {
|
if (passwordAuth) {
|
||||||
cy.get('[data-test="LOGIN_EMAIL_ID"]').type('admin');
|
cy.get('[data-test="LOGIN_EMAIL_ID"]').type('test@test.com');
|
||||||
|
|
||||||
cy.get('[data-test="LOGIN_PASSWORD_ID"]').type('unleash4all');
|
cy.get('[data-test="LOGIN_PASSWORD_ID"]').type('qY70$NDcJNXA');
|
||||||
|
|
||||||
cy.get("[data-test='LOGIN_BUTTON']").click();
|
cy.get("[data-test='LOGIN_BUTTON']").click();
|
||||||
} else {
|
} else {
|
||||||
@ -86,167 +86,161 @@ describe('feature toggle', () => {
|
|||||||
cy.url().should('include', featureToggleName);
|
cy.url().should('include', featureToggleName);
|
||||||
});
|
});
|
||||||
|
|
||||||
// it('Can add a gradual rollout strategy to the default environment', () => {
|
it('Can add a gradual rollout strategy to the default environment', () => {
|
||||||
// cy.wait(500);
|
cy.wait(500);
|
||||||
// cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click();
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-1').click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-1').click();
|
||||||
// cy.get('[data-test=ROLLOUT_SLIDER_ID')
|
cy.get('[data-test=ROLLOUT_SLIDER_ID')
|
||||||
// .click()
|
.click()
|
||||||
// .type('{leftarrow}'.repeat(20));
|
.type('{leftarrow}'.repeat(20));
|
||||||
|
|
||||||
// if (enterprise) {
|
if (enterprise) {
|
||||||
// cy.get('[data-test=ADD_CONSTRAINT_ID]').click();
|
cy.get('[data-test=ADD_CONSTRAINT_ID]').click();
|
||||||
// cy.get('[data-test=CONSTRAINT_AUTOCOMPLETE_ID]')
|
cy.get('[data-test=CONSTRAINT_AUTOCOMPLETE_ID]')
|
||||||
// .type('{downArrow}'.repeat(1))
|
.type('{downArrow}'.repeat(1))
|
||||||
// .type('{enter}');
|
.type('{enter}');
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// cy.intercept(
|
cy.intercept(
|
||||||
// 'POST',
|
'POST',
|
||||||
// `/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies`,
|
`/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies`,
|
||||||
// req => {
|
req => {
|
||||||
// expect(req.body.name).to.equal('flexibleRollout');
|
expect(req.body.name).to.equal('flexibleRollout');
|
||||||
|
|
||||||
// expect(req.body.parameters.groupId).to.equal(featureToggleName);
|
expect(req.body.parameters.groupId).to.equal(featureToggleName);
|
||||||
// expect(req.body.parameters.stickiness).to.equal('default');
|
expect(req.body.parameters.stickiness).to.equal('default');
|
||||||
// expect(req.body.parameters.rollout).to.equal(30);
|
expect(req.body.parameters.rollout).to.equal(30);
|
||||||
|
|
||||||
// if (enterprise) {
|
if (enterprise) {
|
||||||
// expect(req.body.constraints.length).to.equal(1);
|
expect(req.body.constraints.length).to.equal(1);
|
||||||
// } else {
|
} else {
|
||||||
// expect(req.body.constraints.length).to.equal(0);
|
expect(req.body.constraints.length).to.equal(0);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// req.continue(res => {
|
req.continue(res => {
|
||||||
// strategyId = res.body.id;
|
strategyId = res.body.id;
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// ).as('addStrategyToFeature');
|
).as('addStrategyToFeature');
|
||||||
|
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_SAVE_ID]').first().click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_SAVE_ID]').first().click();
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// cy.wait('@addStrategyToFeature');
|
cy.wait('@addStrategyToFeature');
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('can update a strategy in the default environment', () => {
|
it('can update a strategy in the default environment', () => {
|
||||||
// cy.wait(500);
|
cy.wait(500);
|
||||||
// cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
||||||
// cy.get('[data-test=STRATEGY_ACCORDION_ID-flexibleRollout').click();
|
cy.get('[data-test=STRATEGY_ACCORDION_ID-flexibleRollout').click();
|
||||||
|
|
||||||
// cy.get('[data-test=ROLLOUT_SLIDER_ID')
|
cy.get('[data-test=ROLLOUT_SLIDER_ID')
|
||||||
// .first()
|
.first()
|
||||||
// .click()
|
.click()
|
||||||
// .type('{rightArrow}'.repeat(10));
|
.type('{rightArrow}'.repeat(10));
|
||||||
|
|
||||||
// cy.get('[data-test=FLEXIBLE_STRATEGY_STICKINESS_ID]')
|
cy.get('[data-test=FLEXIBLE_STRATEGY_STICKINESS_ID]')
|
||||||
// .first()
|
.first()
|
||||||
// .click()
|
.click()
|
||||||
// .get('[data-test=SELECT_ITEM_ID-sessionId')
|
.get('[data-test=SELECT_ITEM_ID-sessionId')
|
||||||
// .first()
|
.first()
|
||||||
// .click();
|
.click();
|
||||||
|
|
||||||
// let newGroupId = 'new-group-id';
|
let newGroupId = 'new-group-id';
|
||||||
// cy.get('[data-test=FLEXIBLE_STRATEGY_GROUP_ID]')
|
cy.get('[data-test=FLEXIBLE_STRATEGY_GROUP_ID]')
|
||||||
// .first()
|
.first()
|
||||||
// .clear()
|
.clear()
|
||||||
// .type('new-group-id');
|
.type('new-group-id');
|
||||||
|
|
||||||
// cy.intercept(
|
cy.intercept(
|
||||||
// 'PUT',
|
'PUT',
|
||||||
// `/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies/${strategyId}`,
|
`/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies/${strategyId}`,
|
||||||
// req => {
|
req => {
|
||||||
// expect(req.body.parameters.groupId).to.equal(newGroupId);
|
expect(req.body.parameters.groupId).to.equal(newGroupId);
|
||||||
// expect(req.body.parameters.stickiness).to.equal('sessionId');
|
expect(req.body.parameters.stickiness).to.equal('sessionId');
|
||||||
// expect(req.body.parameters.rollout).to.equal(60);
|
expect(req.body.parameters.rollout).to.equal(60);
|
||||||
|
|
||||||
// if (enterprise) {
|
if (enterprise) {
|
||||||
// expect(req.body.constraints.length).to.equal(1);
|
expect(req.body.constraints.length).to.equal(1);
|
||||||
// } else {
|
} else {
|
||||||
// expect(req.body.constraints.length).to.equal(0);
|
expect(req.body.constraints.length).to.equal(0);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// req.continue(res => {
|
req.continue(res => {
|
||||||
// expect(res.statusCode).to.equal(200);
|
expect(res.statusCode).to.equal(200);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// ).as('updateStrategy');
|
).as('updateStrategy');
|
||||||
|
|
||||||
// cy.get('[data-test=UPDATE_STRATEGY_BUTTON_ID]').first().click();
|
cy.get('[data-test=UPDATE_STRATEGY_BUTTON_ID]').first().click();
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// cy.wait('@updateStrategy');
|
cy.wait('@updateStrategy');
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('can delete a strategy in the default environment', () => {
|
it('can delete a strategy in the default environment', () => {
|
||||||
// cy.wait(500);
|
cy.wait(500);
|
||||||
// cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
||||||
|
|
||||||
// cy.intercept(
|
cy.intercept(
|
||||||
// 'DELETE',
|
'DELETE',
|
||||||
// `/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies/${strategyId}`,
|
`/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies/${strategyId}`,
|
||||||
// req => {
|
req => {
|
||||||
// req.continue(res => {
|
req.continue(res => {
|
||||||
// expect(res.statusCode).to.equal(200);
|
expect(res.statusCode).to.equal(200);
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// ).as('deleteStrategy');
|
).as('deleteStrategy');
|
||||||
|
|
||||||
// cy.get('[data-test=DELETE_STRATEGY_ID-flexibleRollout]').click();
|
cy.get('[data-test=DELETE_STRATEGY_ID-flexibleRollout]').click();
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// cy.wait('@deleteStrategy');
|
cy.wait('@deleteStrategy');
|
||||||
// });
|
});
|
||||||
|
|
||||||
// it('Can add a userid strategy to the default environment', () => {
|
it('Can add a userid strategy to the default environment', () => {
|
||||||
// cy.wait(500);
|
cy.wait(500);
|
||||||
// cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
cy.visit(`/projects/default/features2/${featureToggleName}/strategies`);
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_ID]').click();
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-2').click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_CARD_BUTTON_ID-2').click();
|
||||||
|
|
||||||
// if (enterprise) {
|
if (enterprise) {
|
||||||
// cy.get('[data-test=ADD_CONSTRAINT_ID]').click();
|
cy.get('[data-test=ADD_CONSTRAINT_ID]').click();
|
||||||
// cy.get('[data-test=CONSTRAINT_AUTOCOMPLETE_ID]')
|
cy.get('[data-test=CONSTRAINT_AUTOCOMPLETE_ID]')
|
||||||
// .type('{downArrow}'.repeat(1))
|
.type('{downArrow}'.repeat(1))
|
||||||
// .type('{enter}');
|
.type('{enter}');
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// }
|
}
|
||||||
|
|
||||||
// cy.get('[data-test=STRATEGY_INPUT_LIST]')
|
cy.get('[data-test=STRATEGY_INPUT_LIST]')
|
||||||
// .type('user1')
|
.type('user1')
|
||||||
// .type('{enter}')
|
.type('{enter}')
|
||||||
// .type('user2')
|
.type('user2')
|
||||||
// .type('{enter}');
|
.type('{enter}');
|
||||||
// cy.get('[data-test=ADD_TO_STRATEGY_INPUT_LIST]').click();
|
cy.get('[data-test=ADD_TO_STRATEGY_INPUT_LIST]').click();
|
||||||
|
|
||||||
// cy.intercept(
|
cy.intercept(
|
||||||
// 'POST',
|
'POST',
|
||||||
// `/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies`,
|
`/api/admin/projects/default/features/${featureToggleName}/environments/${defaultEnv}/strategies`,
|
||||||
// req => {
|
req => {
|
||||||
// expect(req.body.name).to.equal('userWithId');
|
expect(req.body.name).to.equal('userWithId');
|
||||||
|
|
||||||
// expect(req.body.parameters.userIds.length).to.equal(11);
|
expect(req.body.parameters.userIds.length).to.equal(11);
|
||||||
|
|
||||||
// if (enterprise) {
|
if (enterprise) {
|
||||||
// expect(req.body.constraints.length).to.equal(1);
|
expect(req.body.constraints.length).to.equal(1);
|
||||||
// } else {
|
} else {
|
||||||
// expect(req.body.constraints.length).to.equal(0);
|
expect(req.body.constraints.length).to.equal(0);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// req.continue(res => {
|
req.continue(res => {
|
||||||
// strategyId = res.body.id;
|
strategyId = res.body.id;
|
||||||
// });
|
});
|
||||||
// }
|
}
|
||||||
// ).as('addStrategyToFeature');
|
).as('addStrategyToFeature');
|
||||||
|
|
||||||
// cy.get('[data-test=ADD_NEW_STRATEGY_SAVE_ID]').first().click();
|
cy.get('[data-test=ADD_NEW_STRATEGY_SAVE_ID]').first().click();
|
||||||
// cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
cy.get('[data-test=DIALOGUE_CONFIRM_ID]').click();
|
||||||
// cy.wait('@addStrategyToFeature');
|
cy.wait('@addStrategyToFeature');
|
||||||
// });
|
|
||||||
|
|
||||||
it('Creates an API key', () => {
|
|
||||||
cy.wait(500)
|
|
||||||
cy.visit('/admin/api');
|
|
||||||
cy.get('[data-test="CREATE_API_TOKEN_BUTTON"]', { timeout: 10000 }).click();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Can add two variant to the feature', () => {
|
it('Can add two variant to the feature', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user