Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests to handle redirect away from your products #1185

Merged
merged 3 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading