1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-23 00:16:25 +01:00

fix: remove e2e tests (#3515)

<!-- Thanks for creating a PR! To make it easier for reviewers and
everyone else to understand what your changes relate to, please add some
relevant content to the headings below. Feel free to ignore or delete
sections that you don't think are relevant. Thank you! ❤️ -->
After discussions around e2e tests:
- Became clear that the intention is to test core functionality only

Removing 2 test files:
- notifications.spec.ts : because all PRs are run against the same
heroku backend - no guarantee that more notifications will not happen as
other tests run - so the test is flaky
- settings.spec.ts: depends on instance being enterprise and a flag on  
## About the changes
<!-- Describe the changes introduced. What are they and why are they
being introduced? Feel free to also add screenshots or steps to view the
changes if they're visual. -->

<!-- Does it close an issue? Multiple? -->
Closes #

<!-- (For internal contributors): Does it relate to an issue on public
roadmap? -->
<!--
Relates to [roadmap](https://github.com/orgs/Unleash/projects/10) item:
#
-->

### Important files
<!-- PRs can contain a lot of changes, but not all changes are equally
important. Where should a reviewer start looking to get an overview of
the changes? Are any files particularly important? -->


## Discussion points
<!-- Anything about the PR you'd like to discuss before it gets merged?
Got any questions or doubts? -->

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2023-04-13 16:04:06 +03:00 committed by GitHub
parent 0940b0aa52
commit 7e5838a681
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 139 deletions

View File

@ -11,8 +11,6 @@ jobs:
- groups/groups.spec.ts
- projects/access.spec.ts
- projects/overview.spec.ts
- projects/settings.spec.ts
- projects/notifications.spec.ts
- segments/segments.spec.ts
- import/import.spec.ts
steps:

View File

@ -1,59 +0,0 @@
///<reference path="../../global.d.ts" />
const EDITOR = 2;
describe('notifications', () => {
const randomId = String(Math.random()).split('.')[1];
const featureToggleName = `notifications_test-${randomId}`;
const baseUrl = Cypress.config().baseUrl;
let userIds: number[] = [];
let userCredentials: Cypress.UserCredentials[] = [];
const userName = `notifications_user-${randomId}`;
const projectName = `default`;
before(() => {
cy.runBefore();
});
it.skip('should create a notification when a feature is created in a project', () => {
cy.login_UI();
cy.createUser_API(userName, EDITOR).then(value => {
userIds = value.userIds;
userCredentials = value.userCredentials;
cy.login_UI();
cy.visit(`/projects/${projectName}`);
cy.createFeature_UI(featureToggleName);
//Should not show own notifications
cy.get("[data-testid='NOTIFICATIONS_BUTTON']").click();
//then
cy.get("[data-testid='NOTIFICATIONS_MODAL']").should('exist');
const credentials = userCredentials[0];
//Sign in as a different user
cy.login_UI(credentials.email, credentials.password);
cy.visit(`/projects/${projectName}`);
cy.get("[data-testid='NOTIFICATIONS_BUTTON']").click();
//then
cy.get("[data-testid='UNREAD_NOTIFICATIONS']").should('exist');
cy.get("[data-testid='NOTIFICATIONS_LIST']").should(
'contain.text',
`New feature ${featureToggleName}`
);
//clean
// We need to login as admin for cleanup
cy.login_UI();
userIds.forEach(id =>
cy.request('DELETE', `${baseUrl}/api/admin/user-admin/${id}`)
);
cy.deleteFeature_API(featureToggleName);
});
});
});

View File

@ -1,78 +0,0 @@
///<reference path="../../global.d.ts" />
describe('project settings', () => {
const randomId = String(Math.random()).split('.')[1];
const baseUrl = Cypress.config().baseUrl;
const projectName = `stickiness-project-${randomId}`;
const TEST_STICKINESS = 'userId';
const featureToggleName = `settings-${randomId}`;
let cleanFeature = false;
let cleanProject = false;
before(() => {
cy.runBefore();
});
beforeEach(() => {
cy.login_UI();
if (cleanFeature) {
cy.deleteFeature_API(featureToggleName);
}
if (cleanProject) {
cy.deleteProject_API(projectName);
}
cy.visit(`/projects`);
cy.wait(300);
});
it('should store default project stickiness when creating, retrieve it when editing a project', () => {
//when
cleanProject = true;
cy.createProject_UI(projectName, TEST_STICKINESS);
cy.visit(`/projects/${projectName}`);
cy.get("[data-testid='NAVIGATE_TO_EDIT_PROJECT']").click();
//then
cy.get("[id='stickiness-select']")
.first()
.should('have.text', 'userId');
//clean
cy.request('DELETE', `${baseUrl}/api/admin/projects/${projectName}`);
});
it('should respect the default project stickiness when creating a Gradual Rollout Strategy', () => {
cy.createProject_UI(projectName, TEST_STICKINESS);
cy.createFeature_UI(featureToggleName, true, projectName);
cleanFeature = true;
//when - then
cy.addFlexibleRolloutStrategyToFeature_UI({
featureToggleName,
project: projectName,
stickiness: TEST_STICKINESS,
});
//clean
});
it.skip('should respect the default project stickiness when creating a variant', () => {
cy.createProject_UI(projectName, TEST_STICKINESS);
cy.createFeature_UI(featureToggleName, true, projectName);
//when
cy.visit(
`/projects/${projectName}/features/${featureToggleName}/variants`
);
cy.get("[data-testid='ADD_VARIANT_BUTTON']").first().click();
//then
cy.get("[id='stickiness-select']")
.first()
.should('have.text', 'userId');
//clean
cy.deleteFeature_API(featureToggleName);
cy.deleteProject_API(projectName);
});
});