Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -29,15 +30,14 @@ 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.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'https://staging.boxtribute.org',
baseUrl: 'http://localhost:8000',
specPattern: 'cypress/e2e/**/*.js',
},
})
3 changes: 2 additions & 1 deletion cypress/support/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -90,4 +91,4 @@ Cypress.Commands.add("logout", () => {
expect(response.body.success).to.be.true;
});

});
});
Loading