Skip to content

Commit

Permalink
fix tests to handle redirect away from your products (#1185)
Browse files Browse the repository at this point in the history
* fix tests to handle redirect away from your products

* upload astra scan results to debug

* fix legal terms URL
  • Loading branch information
rustyjux authored Nov 6, 2024
1 parent 6b4eb86 commit 50433c8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/aps-cypress-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ jobs:
name: code-coverage
path: ${{ github.workspace }}/e2e/coverage

- name: Upload Astra scan results
uses: actions/upload-artifact@v4
with:
name: astra-scan-results
path: ${{ github.workspace }}/e2e/cypress/fixtures/state/scanResult.json

- name: Instrument the code for coverage analysis
run: |
# Rewrite the paths as the coverage starts with '../app'!
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/feeder-init/legal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ entity: Legal
record:
id: "terms-of-use-for-api-gateway-1"
title: "Terms of Use for API Gateway"
link: "https://www2.gov.bc.ca/gov/content/data/open-data/api-terms-of-use-for-ogl-information"
link: "https://www2.gov.bc.ca/gov/content/data/policy-standards/open-data/api-terms-of-use-for-ogl-information"
document: terms-of-use
version: 1
10 changes: 7 additions & 3 deletions e2e/cypress/tests/20-gateways/02-dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ describe('Gateway selector dropdown', () => {

it('Get current total number of gateways', () => {
// Create a new gateway to ensure there is at least one gateway
cy.createGateway();
cy.createGateway().then((response) => {
const namespace = response.gatewayId
cy.log('New namespace created: ' + namespace)
cy.activateGateway(namespace);
});

cy.visit(ad.yourProductsPath);
cy.get('[data-testid="ns-dropdown-btn"]').click();
Expand Down Expand Up @@ -81,8 +85,8 @@ describe('Gateway selector dropdown', () => {
it('Recently used gateways are shown in the dropdown', () => {
cy.visit(ns.listPath)
cy.get(`[data-testid="ns-list-activate-link-${gateways["namespace1"].gatewayId + '-' + customId}"]`).click()
cy.get('[data-testid="ns-dropdown-btn"]').click()
cy.get(`[data-testid="ns-dropdown-item-${gateways["namespace2"].gatewayId + '-' + customId}"]`).click()
cy.visit(ns.listPath)
cy.get(`[data-testid="ns-list-activate-link-${gateways["namespace2"].gatewayId + '-' + customId}"]`).click()
cy.get('[data-testid="ns-dropdown-btn"]').click()
cy.get('[data-testid="ns-dropdown-heading"]').should('contain.text', "Recently viewed")
cy.get(`[data-testid="ns-dropdown-item-${gateways["namespace1"].gatewayId + '-' + customId}"]`).should('exist')
Expand Down

0 comments on commit 50433c8

Please sign in to comment.