Skip to content

Commit

Permalink
Merge pull request #310 from uselagoon/cypress_idler_handler
Browse files Browse the repository at this point in the history
tests: rework some Cypress waits - save screenshots and logs
  • Loading branch information
tobybellwood authored Jan 24, 2025
2 parents f5f0272 + cfb1905 commit ca91681
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ui-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,28 @@ jobs:
cypress_keycloak: http://localhost:8088/auth
cypress_url: http://localhost:3003


- name: Export API logs on failure
if: failure()
run: |
docker compose -p core-lagoon-ui logs api
- name: Save screenshots on failure
uses: actions/upload-artifact@v4
# add the line below to store screenshots only on failures
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`
- name: Save videos on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-videos
path: cypress/videos
if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn`

- name: Stop Docker containers
run: |
make development-api-down
8 changes: 2 additions & 6 deletions cypress/e2e/general/variables.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ describe('Project variables page', () => {
cy.waitForNetworkIdle('@idle', 500);
environment.doAddVariable(name, value);

cy.intercept('POST', Cypress.env('api')).as('addRequest');

cy.wait('@addRequest');
cy.waitForNetworkIdle('@idle', 1000);

cy.log('check if variable was created');
cy.get('.data-table > .data-row').should('contain', name);
Expand All @@ -56,9 +54,7 @@ describe('Project variables page', () => {

environment.doDeleteVariable(name);

cy.intercept('POST', Cypress.env('api')).as('deleteRequest');

cy.wait('@deleteRequest');
cy.waitForNetworkIdle('@idle', 1000);

cy.contains('No Project variables set').should('exist');
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/organizations/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ describe('Org Users page', () => {
});

after(() => {
registerIdleHandler('groupQuery');
cy.visit(`${Cypress.env('url')}/organizations/lagoon-demo-organization/groups`);
registerIdleHandler('groupQuery');
group.doDeleteGroup(testData.organizations.groups.newGroupName);
group.doDeleteGroup(testData.organizations.groups.newGroupName2);
});
Expand Down

0 comments on commit ca91681

Please sign in to comment.