forked from ansible/ansible-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cypress switch to version 12 and add live e2e github action (ansible#214
) * cypress switch to version 12 and add live e2e github action Signed-off-by: James Talton <[email protected]> * github action name Signed-off-by: James Talton <[email protected]> * e2e fixes Signed-off-by: James Talton <[email protected]> * fix Signed-off-by: James Talton <[email protected]> * unit test tweak Signed-off-by: James Talton <[email protected]> * fix e2e tests Signed-off-by: James Talton <[email protected]> * fix tests Signed-off-by: James Talton <[email protected]> * fix e2e live action Signed-off-by: James Talton <[email protected]> * fixed Signed-off-by: James Talton <[email protected]> * fix e2e live Signed-off-by: James Talton <[email protected]> * fix e2e tests Signed-off-by: James Talton <[email protected]> * cleanup e2e and support e2e cleanup Signed-off-by: James Talton <[email protected]> * rename variables Signed-off-by: James Talton <[email protected]> * streamline tests Signed-off-by: James Talton <[email protected]> * strreamline login Signed-off-by: James Talton <[email protected]> * add support for cleaning up e2e orgs older than 2 hours Signed-off-by: James Talton <[email protected]> * disable project e2e tests that cannot be run against a live server Signed-off-by: James Talton <[email protected]> * cleanup code checks Signed-off-by: James Talton <[email protected]> * minor tweaks Signed-off-by: James Talton <[email protected]> * update projects e2e tests to handle delete Signed-off-by: James Talton <[email protected]> * Add Docker Build and Archive step Signed-off-by: James Talton <[email protected]> * Add comments to make clear what is going on in cleanup code Signed-off-by: James Talton <[email protected]> * docker tweak Signed-off-by: James Talton <[email protected]> * fix Signed-off-by: James Talton <[email protected]> * test using docker image Signed-off-by: James Talton <[email protected]> * make cypress deleteRequest have optional param Signed-off-by: James Talton <[email protected]> * Add code coverage to actions Signed-off-by: James Talton <[email protected]> * merge Signed-off-by: James Talton <[email protected]> * fix docker image job Signed-off-by: James Talton <[email protected]> * fix docker build job Signed-off-by: James Talton <[email protected]> * fix docker image build Signed-off-by: James Talton <[email protected]> * fix Signed-off-by: James Talton <[email protected]> * fix e2e testing Signed-off-by: James Talton <[email protected]> * text coverage action Signed-off-by: James Talton <[email protected]> * cleanup cypress package scripts Signed-off-by: James Talton <[email protected]> * fix job Signed-off-by: James Talton <[email protected]> * adjust code coverage minimum Signed-off-by: James Talton <[email protected]> --------- Signed-off-by: James Talton <[email protected]>
- Loading branch information
1 parent
4581b0b
commit cbcd5b2
Showing
12 changed files
with
7,751 additions
and
2,977 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
/// <reference types="cypress" /> | ||
|
||
import { randomString } from '../../../framework/utils/random-string'; | ||
import { Organization } from '../../../frontend/controller/interfaces/Organization'; | ||
import { ItemsResponse } from '../../../frontend/Data'; | ||
|
||
describe('organizations', () => { | ||
let organization: Organization; | ||
|
||
after(() => { | ||
// Sometimes if tests are stopped in the middle, we get left over organizations | ||
// Cleanup E2E organizations older than 2 hours | ||
cy.requestGet<ItemsResponse<Organization>>( | ||
`/api/v2/organizations/?limit=100&created__lt=${new Date( | ||
Date.now() - 2 * 60 * 60 * 1000 | ||
).toISOString()}&name__startswith=E2E` | ||
).then((itemsResponse) => { | ||
for (const organization of itemsResponse.results) { | ||
cy.requestDelete(`/api/v2/organizations/${organization.id}/`, true); | ||
} | ||
}); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.requestPost<Organization>('/api/v2/organizations/', { | ||
name: 'E2E Organization ' + randomString(4), | ||
}).then((testOrganization) => (organization = testOrganization)); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.requestDelete(`/api/v2/organizations/${organization.id}/`, true); | ||
}); | ||
|
||
it('organization page', () => { | ||
cy.navigateTo(/^Organizations$/, false); | ||
}); | ||
}); |
Oops, something went wrong.