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 64d7be5e..7871a18b 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -69,9 +69,29 @@ jobs: run: | vendor/bin/phinx migrate -e development + - name: env variables + run: | + echo "$ALLMYVARS" + echo "$MYSQL_PORT" + shell: bash + env: + ALLMYVARS: ${{ toJSON(vars) }} + - 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 & - # sleep 3 && 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 cypress run --spec 'cypress/e2e/1_feature_tests/3_1*.js' + + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + start: | + 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' diff --git a/cypress.config.js b/cypress.config.js index 79c71c05..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: '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', }, }) 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 +});