From e108d0532fc6eb970f314e9ba465b50030c12858 Mon Sep 17 00:00:00 2001 From: Austen Money Date: Tue, 22 Oct 2024 10:12:49 -0400 Subject: [PATCH] add maintenance back --- .../cypress/e2e/maintenance/maintenance.cy.js | 6 +++++ etc/test/test-cypress.sh | 24 +++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 end-to-end/cypress/e2e/maintenance/maintenance.cy.js diff --git a/end-to-end/cypress/e2e/maintenance/maintenance.cy.js b/end-to-end/cypress/e2e/maintenance/maintenance.cy.js new file mode 100644 index 0000000000..5145ed8b49 --- /dev/null +++ b/end-to-end/cypress/e2e/maintenance/maintenance.cy.js @@ -0,0 +1,6 @@ +describe("portal-ui-maintenance", () => { + it("has expected text", () => { + cy.visit("http://localhost:8000"); + cy.contains("Portal Maintenance"); + }); +}); \ No newline at end of file diff --git a/etc/test/test-cypress.sh b/etc/test/test-cypress.sh index 062eb1f602..dd56654017 100755 --- a/etc/test/test-cypress.sh +++ b/etc/test/test-cypress.sh @@ -10,10 +10,26 @@ PORT=8000 start cypress -CYPRESS_ARGS='--spec ./cypress/e2e/portal/*.cy.js' -etc/dev/docker.sh 5001 # Needs to match port in cypress.json. -server_up 5001 # Without this, Cypress gets an undefined content-type and immediately fails. - +case $1 in + + maintenance) + CYPRESS_ARGS="--spec cypress/e2e/maintenance/*.cy.js --config baseUrl=http://localhost:${PORT}" + cd context + npm run build:maintain + ( cd app/static/js/maintenance/public/ ; python -m http.server $PORT & ) + cd - + ;; + + portal) + CYPRESS_ARGS='--spec ./cypress/e2e/portal/*.cy.js' + etc/dev/docker.sh 5001 # Needs to match port in cypress.json. + server_up 5001 # Without this, Cypress gets an undefined content-type and immediately fails. + ;; + + *) + die "Unexpected argument: $1" + ;; +esac end-to-end/test.sh $CYPRESS_ARGS docker kill hubmap-portal-ui || true #Kills docker container if it is running, but does not error if the container is not.