From ccbcfd798fe01797c205886bbf019e169c78954e Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:25:23 +0200 Subject: [PATCH 01/15] Run cypress in copilot setup steps --- .github/workflows/copilot-setup-steps.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 64d7be5e..d63e4e02 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -73,5 +73,10 @@ jobs: run: | php build.php cp library/config.php.default library/config.php - # php -S localhost:8000 gcloud-entry.php & - # sleep 3 && curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ && echo " - Server is responding" + php -S localhost:8000 gcloud-entry.php & + sleep 5 && curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ && echo " - Server is responding" + + - name: Run cypress tests + run: | + yarn cypress version + CYPRESS_baseUrl=http://localhost:8000 yarn run cypress --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' From 77f1d2b3d257e0df1837d173a2719336c5e8efbf Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:32:45 +0200 Subject: [PATCH 02/15] Another try --- .github/workflows/copilot-setup-steps.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index d63e4e02..a95c6ab3 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -73,10 +73,12 @@ jobs: run: | php build.php cp library/config.php.default library/config.php + env | grep AUTH0 | grep -v SECRET + env | grep MYSQL php -S localhost:8000 gcloud-entry.php & - sleep 5 && curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ && echo " - Server is responding" - name: Run cypress tests run: | yarn cypress version + sleep 10 && curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ && echo " - Server is responding" CYPRESS_baseUrl=http://localhost:8000 yarn run cypress --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' From 548c1dbe76d4535e42d0548896bd024775b8bf5c Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:38:49 +0200 Subject: [PATCH 03/15] Debugging --- .github/workflows/copilot-setup-steps.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index a95c6ab3..2a237728 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -73,12 +73,22 @@ jobs: run: | php build.php cp library/config.php.default library/config.php + echo foo env | grep AUTH0 | grep -v SECRET + echo bar env | grep MYSQL + echo baz php -S localhost:8000 gcloud-entry.php & + for i in {1..20}; do + sleep 1 + if curl -s http://localhost:8000 > /dev/null; then + echo "Server is responding after $i secs" + break + fi + done + - name: Run cypress tests run: | yarn cypress version - sleep 10 && curl -s -o /dev/null -w "%{http_code}" http://localhost:8000/ && echo " - Server is responding" CYPRESS_baseUrl=http://localhost:8000 yarn run cypress --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' From 727cafaa24ea9b701d40fc5dc6e1fc6afe268837 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:41:53 +0200 Subject: [PATCH 04/15] wip --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 2a237728..ebfdbee3 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -74,7 +74,7 @@ jobs: php build.php cp library/config.php.default library/config.php echo foo - env | grep AUTH0 | grep -v SECRET + # env | grep AUTH0 | grep -v SECRET echo bar env | grep MYSQL echo baz From c6fd02e9580f8abfed559ec093a009586f895160 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:48:44 +0200 Subject: [PATCH 05/15] wip --- .github/workflows/copilot-setup-steps.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index ebfdbee3..b7eb9ece 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -69,6 +69,13 @@ jobs: run: | vendor/bin/phinx migrate -e development + - name: env variables + run: | + echo "$ALLMYVARS" + shell: bash + env: + ALLMYVARS: ${{ toJSON(vars) }} + - name: Start PHP server run: | php build.php @@ -76,7 +83,7 @@ jobs: echo foo # env | grep AUTH0 | grep -v SECRET echo bar - env | grep MYSQL + # env | grep MYSQL echo baz php -S localhost:8000 gcloud-entry.php & From 5d44b6ba0e0e05bc3396722809e64680694b61c3 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:52:07 +0200 Subject: [PATCH 06/15] cleanup --- .github/workflows/copilot-setup-steps.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index b7eb9ece..22a0827c 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -80,11 +80,6 @@ jobs: run: | php build.php cp library/config.php.default library/config.php - echo foo - # env | grep AUTH0 | grep -v SECRET - echo bar - # env | grep MYSQL - echo baz php -S localhost:8000 gcloud-entry.php & for i in {1..20}; do From 3f805a1a60c88e1a3d17984ef60c28ce6749eaf4 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:53:28 +0200 Subject: [PATCH 07/15] Fix cypress commands --- .github/copilot-instructions.md | 2 +- .github/workflows/copilot-setup-steps.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index c07f2651..3ba83a02 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -93,7 +93,7 @@ Browser test structure: ### Running Cypress Tests ```bash -CYPRESS_baseUrl=http://localhost:8000 yarn run cypress --spec 'cypress/e2e/1_feature_tests/*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' +CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' ``` - Runs Cypress with baseUrl set to http://localhost:8000 and auth0Domain set to the development tenant - Requires the application to be running on localhost:8000 (local PHP setup) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 22a0827c..7c77d50d 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -92,5 +92,5 @@ jobs: - name: Run cypress tests run: | - yarn cypress version - CYPRESS_baseUrl=http://localhost:8000 yarn run cypress --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' + yarn cypress --version + CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' From 46fcab7ab708060cdfc23c628c6deb943240fb06 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 16:57:20 +0200 Subject: [PATCH 08/15] wip --- .github/workflows/copilot-setup-steps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 7c77d50d..27778857 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -72,6 +72,7 @@ jobs: - name: env variables run: | echo "$ALLMYVARS" + echo "$MYSQL_PORT" shell: bash env: ALLMYVARS: ${{ toJSON(vars) }} @@ -82,7 +83,7 @@ jobs: cp library/config.php.default library/config.php php -S localhost:8000 gcloud-entry.php & - for i in {1..20}; do + for i in {1..10}; do sleep 1 if curl -s http://localhost:8000 > /dev/null; then echo "Server is responding after $i secs" From 674c3ab28161a12eeaff7ce5fcd67d66521889a9 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 22:55:35 +0200 Subject: [PATCH 09/15] hide-build-output --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 27778857..97b0b55f 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -79,7 +79,7 @@ jobs: - name: Start PHP server run: | - php build.php + php build.php >/dev/null 2>&1 cp library/config.php.default library/config.php php -S localhost:8000 gcloud-entry.php & From 16312a2d1eca5da7dc72b5a71d12f03c042935b1 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 23:13:24 +0200 Subject: [PATCH 10/15] Use AUTH0_DOMAIN env variable --- cypress.config.js | 2 +- cypress/support/session.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 79c71c05..bd3f39c7 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -29,7 +29,7 @@ module.exports = defineConfig({ successPwdChangeNotif: 'Within a few minutes you will receive an e-mail with further instructions to reset your password.', orgName: 'TestOrganisation', - auth0Domain: 'staging-login.boxtribute.org', + auth0Domain: process.env.AUTH0_DOMAIN || 'staging-login.boxtribute.org', }, e2e: { // We've imported your old cypress plugins here. diff --git a/cypress/support/session.js b/cypress/support/session.js index 1c69bed5..481cc539 100644 --- a/cypress/support/session.js +++ b/cypress/support/session.js @@ -22,6 +22,7 @@ function backgroundLoginUsing(userMail, userPassword) { // tests Cypress.Commands.add("loginAsVolunteer", () => { let config = getLoginConfiguration(); + console.log(config.auth0Domain); cy.wait(2000); backgroundLoginUsing(config.testVolunteer, config.testPwd); }); @@ -90,4 +91,4 @@ Cypress.Commands.add("logout", () => { expect(response.body.success).to.be.true; }); -}); \ No newline at end of file +}); From 573a41d2f9be0c221ba176625159486554b9a558 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 23:28:57 +0200 Subject: [PATCH 11/15] wip --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 97b0b55f..cdeaf53a 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -94,4 +94,4 @@ jobs: - name: Run cypress tests run: | yarn cypress --version - CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_*.js' --env 'auth0Domain=boxtribute-dev.eu.auth0.com' + DEBUG=cypress:* CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' From dea258449d16204c9496347f1e9bbe0a507b8652 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 23:39:36 +0200 Subject: [PATCH 12/15] Hardcode --- cypress.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index bd3f39c7..efa084a6 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -8,6 +8,7 @@ module.exports = defineConfig({ openMode: 0, }, env: { + auth0Domain: 'boxtribute-dev.eu.auth0.com', testAdmin: 'admin@admin.co', testAdminName: 'BrowserTestUser_Admin', testCoordinator: 'coordinator@coordinator.co', @@ -29,7 +30,6 @@ module.exports = defineConfig({ successPwdChangeNotif: 'Within a few minutes you will receive an e-mail with further instructions to reset your password.', orgName: 'TestOrganisation', - auth0Domain: process.env.AUTH0_DOMAIN || 'staging-login.boxtribute.org', }, e2e: { // We've imported your old cypress plugins here. @@ -37,7 +37,7 @@ module.exports = defineConfig({ setupNodeEvents(on, config) { return require('./cypress/plugins/index.js')(on, config) }, - baseUrl: 'https://staging.boxtribute.org', + baseUrl: 'http://localhost:8000', specPattern: 'cypress/e2e/**/*.js', }, }) From d0f0727521bf0df2becd926d37a0cbc6924646da Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Thu, 2 Oct 2025 23:43:01 +0200 Subject: [PATCH 13/15] less-logs --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index cdeaf53a..681a6ad1 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -94,4 +94,4 @@ jobs: - name: Run cypress tests run: | yarn cypress --version - DEBUG=cypress:* CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' + CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' From aa7e85896b3a6e329f97c8290e07aa1b80a84b08 Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Fri, 3 Oct 2025 00:06:35 +0200 Subject: [PATCH 14/15] cypress-ga --- .github/workflows/copilot-setup-steps.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 681a6ad1..11c076b9 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -91,7 +91,18 @@ jobs: fi done - - name: Run cypress tests - run: | - yarn cypress --version - CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' + # - name: Run cypress tests + # run: | + # yarn cypress --version + # CYPRESS_baseUrl=http://localhost:8000 yarn cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' + + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + build: php build.php + start: | + cp library/config.php.default library/config.php + php -S localhost:8000 gcloud-entry.php + spec: cypress/e2e/1_feature_tests/3_1*.js + config: baseUrl=http://localhost:8000 + wait-on: 'http://localhost:8000' From 0b612f8f7958018e606e90ba2e3c83ea20d8979a Mon Sep 17 00:00:00 2001 From: Philipp Metzner Date: Fri, 3 Oct 2025 00:12:38 +0200 Subject: [PATCH 15/15] dont start server yet --- .github/workflows/copilot-setup-steps.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 11c076b9..7871a18b 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -81,15 +81,6 @@ jobs: run: | php build.php >/dev/null 2>&1 cp library/config.php.default library/config.php - php -S localhost:8000 gcloud-entry.php & - - for i in {1..10}; do - sleep 1 - if curl -s http://localhost:8000 > /dev/null; then - echo "Server is responding after $i secs" - break - fi - done # - name: Run cypress tests # run: | @@ -99,9 +90,7 @@ jobs: - name: Cypress run uses: cypress-io/github-action@v6 with: - build: php build.php start: | - cp library/config.php.default library/config.php php -S localhost:8000 gcloud-entry.php spec: cypress/e2e/1_feature_tests/3_1*.js config: baseUrl=http://localhost:8000