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

Cypress end-to-end Testing #204

Merged
merged 129 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
c3f751a
Add new tests.
ksmontville Nov 11, 2023
d4bf623
Add env variables
ksmontville Nov 11, 2023
bbbf178
Add tests.
ksmontville Nov 11, 2023
0dea89a
Fix login command syntax.
ksmontville Nov 12, 2023
5a813e3
add cypress dir for participant
lucasxsong Nov 24, 2023
6bee53c
add play vocab image game
lucasxsong Nov 28, 2023
fe89a18
add parameterized participant view game testing
lucasxsong Nov 28, 2023
45c3183
update gameslist json and updated testing logic
lucasxsong Nov 29, 2023
de9e584
add support for vocab, cva, multichoice, letter, and a half of pa.
lucasxsong Nov 30, 2023
7ea7747
add cypress dir for participant
lucasxsong Nov 24, 2023
afed39f
add play vocab image game
lucasxsong Nov 28, 2023
b40bec2
add parameterized participant view game testing
lucasxsong Nov 28, 2023
2bd3335
update gameslist json and updated testing logic
lucasxsong Nov 29, 2023
c505f19
add keypress gameplay functions
lucasxsong Dec 1, 2023
6728505
partially completed swr and pa
lucasxsong Dec 5, 2023
05679a4
small changes to pa
lucasxsong Dec 5, 2023
13d3091
Initial commit.
ksmontville Nov 17, 2023
32d7e5f
Add testing for create orgs page.
ksmontville Nov 20, 2023
32d5794
Build out create orgs tests.
ksmontville Nov 20, 2023
fc144e8
Add tests for creating schools, classes, and orgs.
ksmontville Nov 21, 2023
150a529
Add tests for creating an administration.
ksmontville Nov 21, 2023
f29be9c
Refactor tests.
ksmontville Nov 22, 2023
bb1fea9
Refactor tests.
ksmontville Nov 27, 2023
ad576ee
Add registerAdministrator spec.
ksmontville Nov 28, 2023
91e6cbd
Refactor constants into env variables; add spec for registering stude…
ksmontville Nov 28, 2023
1012f0d
Fix createAdministrations spec.
ksmontville Nov 29, 2023
3d78980
Refactor tests and commands.
ksmontville Nov 29, 2023
2e6b380
Implement partner admin tests.
ksmontville Nov 30, 2023
c48604e
add working roar-pa spec
lucasxsong Dec 5, 2023
c8de11f
add cypress spec for checking for legal doc and update other game pla…
lucasxsong Dec 6, 2023
6f71fda
clean up files -- all tests working on local
lucasxsong Dec 6, 2023
c3de2cb
add naming to produce correct test run ordering
lucasxsong Dec 7, 2023
6a68d89
add export tests for progress and score reports
lucasxsong Dec 8, 2023
bac2726
Add data-cy attributes and other fixes to merge conflicts.
ksmontville Dec 6, 2023
2c36baa
update progress report to reflect fixed naming convention
lucasxsong Dec 8, 2023
207b5c2
Refine and refactor tests.
ksmontville Dec 8, 2023
aaf8ce5
Refine and refactor tests.
ksmontville Dec 9, 2023
10b5772
clean up participant tests
lucasxsong Dec 8, 2023
1e6ec82
prettier format changes
lucasxsong Dec 9, 2023
47f49a8
Remove unused comments.
ksmontville Dec 9, 2023
3d25cf3
Add additional test students to testStudent.csv
ksmontville Dec 11, 2023
b593aec
Update HomeParticipant.vue
lucasxsong Jan 9, 2024
80af7b6
update button.get to timeout instead of wait
lucasxsong Jan 10, 2024
6e77a28
update participant tests params and functionality
lucasxsong Jan 10, 2024
cb72e85
Complete merge
ksmontville Jan 10, 2024
3a4a6ee
Add GH workflow
ksmontville Jan 10, 2024
804ce26
Rename Cypress GH actions file.
ksmontville Jan 10, 2024
b414747
Remove duplicate keys from package.json
ksmontville Jan 10, 2024
cf56ee9
Change local host to https
ksmontville Jan 10, 2024
9a52e29
Change test spec to just checkLegalDock
ksmontville Jan 10, 2024
2b79c8c
Modify worflow
ksmontville Jan 11, 2024
72b97e2
Modify gh workflow
ksmontville Jan 11, 2024
1bedba4
Modify gh workflow
ksmontville Jan 11, 2024
1fb42aa
Modify gh workflow
ksmontville Jan 11, 2024
54c4899
Modify gh workflow
ksmontville Jan 11, 2024
a78e95b
Modify gh workflow
ksmontville Jan 11, 2024
618b32b
Modify gh workflow
ksmontville Jan 11, 2024
662f7d0
Modify gh workflow
ksmontville Jan 11, 2024
ed002bf
Modify gh workflow
ksmontville Jan 11, 2024
94bada1
add wait-on package
ksmontville Jan 11, 2024
7be0c69
remove wait-on package
ksmontville Jan 11, 2024
7c9d1ea
remove browser spec from workflow
ksmontville Jan 11, 2024
ede1573
Adjust workflow for parallelization
ksmontville Jan 11, 2024
31b6a26
Remove safari and add electron to browser list
ksmontville Jan 11, 2024
4eef8f9
Test createAdministration spec
ksmontville Jan 11, 2024
f488b39
Run participant tests in Workflow
ksmontville Jan 11, 2024
f6f251e
Install wait-on module
ksmontville Jan 11, 2024
13b963d
Remove wait-on module
ksmontville Jan 11, 2024
9dff5e5
Initial commit
ksmontville Jan 11, 2024
6e087e7
Modify gh workflow
ksmontville Jan 11, 2024
98099a0
Modify gh workflow
ksmontville Jan 11, 2024
57d1917
Modify gh workflow
ksmontville Jan 11, 2024
e59e7fb
Modify gh workflow
ksmontville Jan 11, 2024
cd95dce
Add needs key in workflow
ksmontville Jan 11, 2024
d61fbf8
Modify baseUrl
ksmontville Jan 11, 2024
0537799
Fix merge conflicts.
ksmontville Jan 12, 2024
741fcf5
modify workflow
ksmontville Jan 12, 2024
9fc0986
modify workflow
ksmontville Jan 12, 2024
5c6f2a8
modify workflow
ksmontville Jan 12, 2024
4323caa
modify workflow
ksmontville Jan 12, 2024
807c5bd
modify workflow
ksmontville Jan 12, 2024
b3d8196
modify workflow
ksmontville Jan 12, 2024
419a9de
Fix typo
ksmontville Jan 12, 2024
730c49a
Modify workflow
ksmontville Jan 12, 2024
fc9dfdf
Modify baseUrl
ksmontville Jan 12, 2024
169377a
Modify baseUrl
ksmontville Jan 12, 2024
5a75aa2
Modify CYPRESS_BASE_URL
ksmontville Jan 12, 2024
4a8fe4b
Refactor workflow
ksmontville Jan 12, 2024
5a0adff
New line at end of file
ksmontville Jan 12, 2024
cb3dabf
Change file name
ksmontville Jan 12, 2024
590dda1
Update checkout action to v4
ksmontville Jan 12, 2024
d3efb0f
update partner admin tests and sre playthrough tests
lucasxsong Jan 12, 2024
616657a
Remove defunct tests
ksmontville Jan 12, 2024
6d4a999
changes timeout length and remove written-vocab test temporarily
lucasxsong Jan 13, 2024
e0f9581
Change Downloads to downloads in cypress config
ksmontville Jan 13, 2024
d84b246
Mody cypress commands
ksmontville Jan 13, 2024
961f2de
rebase onto main
ksmontville Jan 17, 2024
82cc5ea
Close tag in CardAdministration.vue
ksmontville Jan 17, 2024
d28b8ee
Update package json
ksmontville Jan 17, 2024
a7e922b
Fix export all/selected tests for Progress and Score reports.
ksmontville Jan 16, 2024
3516e41
Fix export all/selected tests for Progress and Score reports.
ksmontville Jan 17, 2024
0ee1d4e
Merge branch 'main' into cypress-e2e
ksmontville Jan 17, 2024
63ab398
Remove obsolete GH actions.
ksmontville Jan 17, 2024
27f0727
update params for updated cva game
lucasxsong Jan 19, 2024
cbe6d6d
Merge branch 'main' into cypress-e2e
lucasxsong Jan 22, 2024
aa73451
Modify game parameters.
ksmontville Jan 24, 2024
d31233e
Update GH workflow with secrets
ksmontville Jan 24, 2024
85a1b4b
Update participant tests and GitHub workflow.
ksmontville Jan 25, 2024
efcf584
Update roar-utils
ksmontville Jan 25, 2024
36d12b7
Rollback roar utils to 1.0.12
ksmontville Jan 25, 2024
edbe645
Update roar-utils and playPA spec.
ksmontville Jan 25, 2024
81b33e9
update timeouts for play pa
lucasxsong Jan 29, 2024
deb3428
Merge branch 'main' into cypress-e2e
lucasxsong Jan 29, 2024
bfe32fe
Merge branch 'main' into cypress-e2e
lucasxsong Jan 29, 2024
bc5f509
missed comma
lucasxsong Jan 29, 2024
e4c33e6
update overflow and package-lock
lucasxsong Jan 29, 2024
0f65785
Fix participant tests and move getAdministrationCard() to Cypress com…
ksmontville Jan 29, 2024
a481359
Fix participant tests and move getAdministrationCard() to Cypress com…
ksmontville Jan 29, 2024
dfe8e8a
Fix playSWR on Firefox.
ksmontville Jan 30, 2024
790c7fd
Merge branch 'main' into cypress-e2e
ksmontville Jan 31, 2024
25952ab
update package json
ksmontville Feb 5, 2024
adf3f0e
Merge main into working branch.
ksmontville Feb 5, 2024
84b488f
Fix merge conflicts.
ksmontville Feb 5, 2024
4fce3dc
Fix playSWR on Firefox.
ksmontville Feb 5, 2024
84598ec
Fix participant tests
ksmontville Feb 6, 2024
ba0f734
Remove Firefox from automated tests.
ksmontville Feb 6, 2024
700f66e
Adjust timeouts
ksmontville Feb 6, 2024
684938d
Add submodule
ksmontville Feb 6, 2024
f18b219
Add roar-firebase-functions directory
ksmontville Feb 6, 2024
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 .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:vue/vue3-recommended", "prettier"],
"extends": ["eslint:recommended", "plugin:vue/vue3-recommended", "prettier", "plugin:cypress/recommended"],
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/deploy-firebase-test-cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Firebase Deploy to Staging and Cypress e2e Tests
on:
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ci-preview-tests-${{ github.ref }}-1
cancel-in-progress: true

jobs:
build-and-preview:
if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- run: npm ci && npm run build
- name: Deploy to Firebase Hosting Channel
id: firebase-deploy
uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_GSE_ROAR_ADMIN }}'
projectId: gse-roar-admin
target: staging
- run: echo ${{ fromJson(steps.firebase-deploy.outputs.urls)[0] }}
outputs:
deployUrl: ${{ fromJson(steps.firebase-deploy.outputs.urls)[0] }}

cypress-run:
needs: [build-and-preview]
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
browser: [chromium, edge]
containers: [1, 2]
env:
CYPRESS_BASE_URL: ${{ needs.build-and-preview.outputs.deployUrl }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
PARTNER_ADMIN_USERNAME: ${{ secrets.PARTNER_ADMIN_USERNAME }}
PARTNER_ADMIN_PASSWORD: ${{ secrets.PARTNER_ADMIN_PASSWORD }}
PARTNER_ADMIN_ID: ${{ secrets.PARTNER_ADMIN_ID }}
PARTICIPANT_USERNAME: ${{ secrets.PARTICIPANT_USERNAME }}
PARTICIPANT_PASSWORD: ${{ secrets.PARTICIPANT_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v6
with:
browser: ${{ matrix.browser }}
build: echo "Build step already completed"
start: echo "App already deployed to Firebase"
wait-on: ${{ env.CYPRESS_BASE_URL }}
wait-on-timeout: 60
record: true
parallel: true
spec: 'cypress/e2e/participant/**/*,cypress/e2e/partner-admin/**/*'
ci-build-id: ${{ github.run_id }}-${{ matrix.browser }}
21 changes: 0 additions & 21 deletions .github/workflows/firebase-hosting-pull-request.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/firebase-hosting-staging.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dist-ssr
*.sw?

.firebase/
cypress/downloads

.env
.vite/*
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "roar-firebase-functions"]
path = roar-firebase-functions
url = ../roar-firebase-functions.git
[submodule "roar-firebase-functions"]
path = roar-firebase-functions
url = ../roar-firebase-functions.git
88 changes: 88 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
const { defineConfig } = require('cypress');
require('dotenv').config();

module.exports = defineConfig({
projectId: 'cobw62',
e2e: {
baseUrl: process.env.CYPRESS_BASE_URL ?? 'https://localhost:5173/',
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
// implement node event listeners here
},
// specPattern: [
//
// ]
},
env: {
baseUrl: process.env.CYPRESS_BASE_URL ?? 'https://localhost:5173',
timeout: 10000,
sessionCookieName: process.env.SESSION_COOKIE_NAME,
sessionCookieValue: process.env.SESSION_COOKIE_VALUE,
superAdminUsername: process.env.SUPER_ADMIN_USERNAME,
superAdminPassword: process.env.SUPER_ADMIN_PASSWORD,
superAdminId: process.env.SUPER_ADMIN_ID,
partnerAdminUsername: process.env.PARTNER_ADMIN_USERNAME,
partnerAdminPassword: process.env.PARTNER_ADMIN_PASSWORD,
partnerAdminId: process.env.PARTNER_ADMIN_ID,
participantUsername: process.env.PARTICIPANT_USERNAME,
participantPassword: process.env.PARTICIPANT_PASSWORD,
testAdministrationName: 'zzzTestAdministration',
testAdministrationId: "pdOfQuakqN4re3cI5mr5",
testAdministratorFirstName: 'zzzTestAdministratorFirstName',
testAdministratorMiddleName: 'zzzTestAdministratorMiddleName',
testAdministratorLastName: 'zzzTestAdministratorLastName',
testAdministratorEmail: 'zzzTestAdministratorEmail',
testDistrictName: 'zzzTestDistrict',
testDistrictInitials: 'TD',
testDistrictNcesId: '123456789',
testDistrictId: "yGGlUDTB5xzzCecoYucj",
testSchoolName: 'zzzTestSchool',
testSchoolInitials: 'TS',
testSchoolNcesId: '987654321',
testClassName: 'zzzTestClass',
testClassInitials: 'TC',
testGroupName: 'zzzTestGroup',
testGroupInitials: 'TG',
testPartnerAdministrationName: 'zzzCypressTestAdministration',
testPartnerAdministrationId: "pdOfQuakqN4re3cI5mr5",
testPartnerDistrictName: 'zzzCypressTestDistrict',
testPartnerDistrictInitials: 'CTD',
testPartnerDistrictNcesId: '123456789',
testPartnerSchoolName: 'zzzCypressTestSchool',
testPartnerSchoolInitials: 'CTS',
testPartnerSchoolNcesId: '987654321',
testPartnerClassName: 'zzzCypressTestClass',
testPartnerClassInitials: 'CTC',
testPartnerGroupName: 'zzzCypressTestGroup',
testPartnerGroupInitials: 'CTG',
testGrade: 'Grade 5',
stanfordUniversityAddress: '450 Jane Stanford Way, Stanford, CA 94305, USA',
testTag: 'stanford university',
cypressDownloads: 'cypress/downloads',
testRoarAppsAdministration: "zzzCypressTestRoarAppsAdministration",
testRoarAppsAdministrationId: "f3UMHUpR8NGLdmACLw9o",
testUserList: [
"zzzCypressTestStudent0",
"zzzCypressTestStudent1",
"zzzCypressTestStudent2",
"zzzCypressTestStudent3",
"zzzCypressTestStudent4",
"zzzCypressTestStudent5",
"zzzCypressTestStudent6",
"zzzCypressTestStudent7",
"zzzCypressTestStudent8",
"zzzCypressTestStudent9",
"zzzCypressTestStudent10",
"zzzCypressTestStudent11",
"zzzCypressTestStudent12",
"zzzCypressTestStudent13",
"zzzCypressTestStudent14",
"zzzCypressTestStudent15",
"zzzCypressTestStudent16",
"zzzCypressTestStudent17",
"zzzCypressTestStudent18",
"zzzCypressTestStudent19",
"zzzCypressTestStudent20",
]
},
});
63 changes: 63 additions & 0 deletions cypress/e2e/participant/buttonGamesList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
export const games = [
{
name: 'ROAR Picture Vocabulary',
id: 'vocab',
startBtn: '.jspsych-btn',
introBtn: '.continue',
introIters: 3,
numChoices: 3,
stimulus: '',
preChoiceDelay: 700,
setUpChoice: '.intro_aliens',
clickableItem: '.vocab_img',
numIter: 4,
},
{
name: 'ROAR Written Vocabulary',
id: 'cva',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 3,
setupChoice: '',
stimulus: '.item-stimulus-cva',
preChoiceDelay: 1700,
clickableItem: 'button',
correctChoice: '.glowingButton',
numIter: 9,
},
{
name: 'Roar-Morphology',
id: 'morphology',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 3,
numChoices: 3,
stimulus: '.item-stimulus',
clickableItem: 'button',
preChoiceDelay: 1500,
setupChoice: '',
correctChoice: '.glowingButton',
numIter: 6,
},
{
name: 'Letter',
id: 'letter',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 5,
correctChoice: '.glowingButton',
numChoices: 3,
stimulus: '',
setupChoice: '',
clickableItem: 'button',
preChoiceDelay: 600,
numIter: 27,
},
];

// variant IDS
// vocab: VimH8oXM99UToXydiDK4
// cva: 5OaEGDBHAxU4kSebvyix
// letter: E89L0yam9SJ9g5vDFzzr
// multichoice: UD9GC7PkVRX8oJvqysTL

14 changes: 14 additions & 0 deletions cypress/e2e/participant/checkLegalDoc.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
describe('Test to maintain that assent form shows in when signing in with an un-assented user', () => {
it('passes', () => {
// this is a user that has an assignment of roarVocab -- how can we create a user that can
// ALWAYS play the game
let test_login = 'DO_NOT_ACCEPT_DOC';
let test_pw = 'passwordLEGAL';
// how can we write some logic to reset the already played
cy.login(test_login, test_pw);
cy.visit('/');
cy.wait(1000);
cy.get('.p-dialog-title').contains('Assent Form').should('be.visible');
cy.get('.p-confirm-dialog-accept').contains('Continue').should('be.visible');
});
});
11 changes: 11 additions & 0 deletions cypress/e2e/participant/loginAndLogout.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
describe('Cypress test to login and logout', () => {
it('passes', () => {
cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword'));
cy.visit('/')

cy.get('button', {timeout: 10000}).contains('Sign Out').click();

// successfully back at Login page
cy.contains('Welcome to ROAR!');
});
});
Loading
Loading