From 2dd1e93cdd8855f7a9fbb73baef317f96785f1fd Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 18 Apr 2024 17:42:41 -0700 Subject: [PATCH 01/34] initial commit --- .../es-tests/playFluency-ARF-ES.cy.js | 4 +- .../es-tests/playFluency-CALF-ES.cy.js | 4 +- .../default-tests/playFluency-ARF.cy.js | 30 +---- .../default-tests/playFluency-CALF.cy.js | 8 ++ .../default-tests/playLetter.cy.js | 7 + .../participant/default-tests/playPA.cy.js | 43 ++---- .../participant/default-tests/playSRE.cy.js | 5 +- .../roam-fluency/playFluency-ARF-3G.cy.js | 4 +- .../playFluency-ARF-HighLatency.cy.js | 4 +- .../getOpenAdministrations.cy.js | 3 - .../testOpenAdministrations.cy.js | 97 ++++++++++++++ cypress/support/commands.js | 1 + .../roam-fluency/fluencyHelpers.js | 124 +++++++++++++++++- .../roar-letter/letterHelpers.js | 8 +- .../helper-functions/roar-pa/paHelpers.js | 33 ++++- .../helper-functions/roar-sre/sreHelpers.js | 6 +- .../helper-functions/roar-swr/swrHelpers.js | 6 +- 17 files changed, 308 insertions(+), 79 deletions(-) create mode 100644 cypress/e2e/participant/default-tests/playFluency-CALF.cy.js create mode 100644 cypress/e2e/participant/default-tests/playLetter.cy.js create mode 100644 cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js index 152bce8f1..6ee638b65 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js @@ -1,4 +1,4 @@ -import { playFluency } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; const timeout = Cypress.env('timeout'); const administration = Cypress.env('testSpanishRoarAppsAdministration'); @@ -23,7 +23,7 @@ describe('Test playthrough of Fluency ARF ES as a participant', () => { .should('be.visible') .click(); - playFluency(endText); + playFluencyARF(endText); // Check if game is marked as complete on the dashboard cy.visit('/'); diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js index 7eb60e3b6..353813a97 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js @@ -1,4 +1,4 @@ -import { playFluency } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; const timeout = Cypress.env('timeout'); const administration = Cypress.env('testSpanishRoarAppsAdministration'); @@ -24,7 +24,7 @@ describe('Test playthrough of Fluency ARF ES as a participant', () => { .should('be.visible') .click(); - playFluency(endText, continueText); + playFluencyARF(endText, continueText); // Check if game is marked as complete on the dashboard cy.visit('/'); diff --git a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js index ff076fa66..4369c4fdb 100644 --- a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js @@ -1,33 +1,7 @@ -import { playFluency } from '../../../support/helper-functions/roam-fluency/fluencyHelpers'; - -const timeout = Cypress.env('timeout'); -const endText = 'You are all done.'; +import { playFluencyARF } from '../../../support/helper-functions/roam-fluency/fluencyHelpers'; describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - Cypress.on('uncaught:exception', () => { - return false; - }); - - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.visit('/'); - - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - - cy.get('.p-tabview').contains('ROAM - Single Digit'); - cy.visit(`/game/fluency-arf`); - - // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 6 * timeout }) - .should('be.visible') - .click(); - - playFluency(endText); - - // Check if game is marked as complete on the dashboard - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - cy.get('.tabview-nav-link-label').contains('ROAM - Single Digit').should('exist'); + playFluencyARF(); }); }); diff --git a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js new file mode 100644 index 000000000..3ee713300 --- /dev/null +++ b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js @@ -0,0 +1,8 @@ +import { playFluencyCALF } from '../../../support/helper-functions/roam-fluency/fluencyHelpers'; + +describe('Test playthrough of Fluency as a participant', () => { + it('Fluency Playthrough Test', () => { + // playFluencyCALF(); + cy.log('This test is skipped because the game is not yet available for testing.'); + }); +}); diff --git a/cypress/e2e/participant/default-tests/playLetter.cy.js b/cypress/e2e/participant/default-tests/playLetter.cy.js new file mode 100644 index 000000000..2f1dec478 --- /dev/null +++ b/cypress/e2e/participant/default-tests/playLetter.cy.js @@ -0,0 +1,7 @@ +import { playLetter } from '../../../support/helper-functions/roar-letter/letterHelpers'; + +describe('ROAR - Letra Play Through', () => { + it('Plays Letra', () => { + playLetter(); + }); +}); diff --git a/cypress/e2e/participant/default-tests/playPA.cy.js b/cypress/e2e/participant/default-tests/playPA.cy.js index 826065817..4a4c9960b 100644 --- a/cypress/e2e/participant/default-tests/playPA.cy.js +++ b/cypress/e2e/participant/default-tests/playPA.cy.js @@ -1,36 +1,21 @@ import { playPA } from '../../../support/helper-functions/roar-pa/paHelpers'; -const timeout = Cypress.env('timeout'); -const startText = 'In this game we are going to look for words that BEGIN with the same sound.'; -const endBlockText = { - endText1: 'Take a break if needed', - endText2: 'I have been swimming so much', - endText3: 'You have helped me and all my friends!', -}; -const breakBlockText = 'Take a break if needed'; -const breakBlockText2 = { - break1: 'Great job', - break2: 'Look at all those carrots', - break3: 'You are doing great', -}; +// const timeout = Cypress.env('timeout'); +// const startText = 'In this game we are going to look for words that BEGIN with the same sound.'; +// const endBlockText = { +// endText1: 'Take a break if needed', +// endText2: 'I have been swimming so much', +// endText3: 'You have helped me and all my friends!', +// }; +// const breakBlockText = 'Take a break if needed'; +// const breakBlockText2 = { +// break1: 'Great job', +// break2: 'Look at all those carrots', +// break3: 'You are doing great', +// }; describe('Testing playthrough of ROAR-Phoneme as a participant', () => { it(`ROAR-Phoneme Playthrough Test`, () => { - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.visit('/'); - - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - - // cy.get(".p-tabview").contains(pa.name); - cy.visit('/game/pa'); - - playPA(startText, breakBlockText, breakBlockText2, endBlockText); - - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - cy.get('.tabview-nav-link-label', { timeout: 3 * timeout }) - .contains('ROAR - Phoneme') - .should('exist'); + playPA(); }); }); diff --git a/cypress/e2e/participant/default-tests/playSRE.cy.js b/cypress/e2e/participant/default-tests/playSRE.cy.js index 5cd863e92..47309f05f 100644 --- a/cypress/e2e/participant/default-tests/playSRE.cy.js +++ b/cypress/e2e/participant/default-tests/playSRE.cy.js @@ -1,10 +1,7 @@ import { playSRE } from '../../../support/helper-functions/roar-sre/sreHelpers'; -const administration = Cypress.env('testRoarAppsAdministration'); -const language = 'en'; - describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - playSRE(administration, language); + playSRE(); }); }); diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js index bd395a901..4b26202ed 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js @@ -1,4 +1,4 @@ -import { playFluency } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; const timeout = Cypress.env('timeout'); const endText = 'You are all done.'; @@ -19,7 +19,7 @@ describe('Test playthrough of Fluency as a participant', () => { .should('be.visible') .click(); - playFluency(endText); + playFluencyARF(endText); // Check if game is marked as complete on the dashboard // Check if game is marked as complete on the dashboard diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js index 6475ff1e7..01355492d 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js @@ -1,4 +1,4 @@ -import { playFluency } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; const timeout = Cypress.env('timeout'); const endText = 'You are all done.'; @@ -19,7 +19,7 @@ describe('Test playthrough of Fluency as a participant', () => { .should('be.visible') .click(); - playFluency(endText); + playFluencyARF(endText); // Check if game is marked as complete on the dashboard // Check if game is marked as complete on the dashboard diff --git a/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js index cfdcbf72c..ab97cdc51 100644 --- a/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js @@ -14,9 +14,6 @@ describe('Get Open Administrations', () => { cy.then(() => getOpenAdministrations(adminFirestore)).then((admins) => { cy.log(admins.length); cy.log(admins); - admins.forEach((admin) => { - cy.log(admin); - }); }); }); }); diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js new file mode 100644 index 000000000..6ac143e9d --- /dev/null +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -0,0 +1,97 @@ +import { playSWR } from '../../support/helper-functions/roar-swr/swrHelpers'; +import { playSRE } from '../../support/helper-functions/roar-sre/sreHelpers'; +import { playLetter } from '../../support/helper-functions/roar-letter/letterHelpers'; +import { playPA } from '../../support/helper-functions/roar-pa/paHelpers'; +import { playFluencyARF, playFluencyCALF } from '../../support/helper-functions/roam-fluency/fluencyHelpers'; + +// Create helper functions for every game which can be called here to play the game +// These helper functions must take an object for its parameters, with explicit default values +// Each helper function must be a complete test that logs in, plays the game, and checks for game completion + +const timeout = Cypress.env('timeout'); +const testSpecs = [ + // { + // name: "ROAR - Picture Vocabulary", + // spec: "", + // }, + // { + // name: "ROAR - Written Vocabulary", + // spec: "", + // }, + // { + // name: 'ROAR - Letter', + // spec: playLetter, + // }, + // { + // name: "ROAR - Morphology", + // spec: "", + // }, + // { + // name: 'ROAR - Phoneme', + // spec: playPA, + // }, + // { + // name: 'ROAR - Sentence', + // spec: playSRE, + // }, + // { + // name: 'ROAR - Word', + // spec: playSWR, + // }, + // { + // name: 'ROAM - Single Digit', + // spec: playFluencyARF, + // }, + // { + // name: 'ROAM - Multi Digit', + // spec: playFluencyCALF, + // }, +]; + +const openAdmins = []; + +async function getOpenAdmins() { + cy.get('[data-cy=dropdown-select-administration]').click(); + cy.get('.p-dropdown-panel').within(() => { + cy.get('li').each((el) => { + if (el.text().includes('Synced Administration')) { + openAdmins.push(el.text()); + } + }); + }); + cy.get('[data-cy=dropdown-select-administration]').click(); +} + +describe('Testing all open administrations', () => { + it('Tests the open administration', () => { + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + cy.visit('/', { timeout: 2 * timeout }); + + getOpenAdmins(); + + cy.then(() => { + openAdmins.forEach((admin) => { + cy.log(`Testing ${admin}`); + cy.selectAdministration(admin); + + testSpecs.forEach((spec) => { + cy.log(spec); + cy.get('.p-tabview') + .invoke('text') + .then((text) => { + cy.log('Found text', text); + if (text.includes(spec.name)) { + cy.log(`Playing ${spec.name}`); + + spec.spec({ + administration: admin, + }); + } else { + cy.log('No game found for', spec.name); + } + }); + }); + }); + }); + }); +}); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0c4149786..5060013db 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -105,6 +105,7 @@ Cypress.Commands.add('selectAdministration', (testAdministration) => { .contains(testAdministration) .should('exist') .click(); + cy.log('Selectected administration:', testAdministration); }); Cypress.Commands.add('getAdministrationCard', (testAdministration) => { diff --git a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js index 752c0486c..d6eb2f864 100644 --- a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js +++ b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js @@ -10,7 +10,7 @@ function waitTimeout() { cy.wait(0.1 * timeout); } -function playFluencyIntro() { +function playFluencyARFIntro() { waitTimeout(); // Click textbox and enter random participantId @@ -65,6 +65,61 @@ function playFluencyIntro() { typeEnter(); } +function playFluencyCALFIntro() { + waitTimeout(); + + // Click textbox and enter random participantId + cy.get('#input-0', { timeout: timeout }).type(`${participantId} {enter}`); + waitTimeout(); + typeEnter(); + waitTimeout(); + + // Click enter + cy.get('body').type('1 {enter}'); + waitTimeout(); + + typeEnter(); + waitTimeout(); + + // Click backspace + cy.get('body').type('{backspace}'); + waitTimeout(); + + // Input example number, enter x1 + cy.get('#practice_number').type('10'); + waitTimeout(); + + cy.get('#practice_number').type('{enter}'); + typeEnter(); + waitTimeout(); + + // Enter x2 + //cy.get("body").type("x2 {enter}"); + typeEnter(); + typeEnter(); + //waitTimeout(); + + // Type 4, enter x2 + cy.get('#question_input_key').type('46'); + waitTimeout(); + cy.get('#question_input_key').type('{enter}'); + typeEnter(); + waitTimeout(); + typeEnter(); + + // Type 2, enter x2 + cy.get('#question_input_key').type('37'); + waitTimeout(); + cy.get('#question_input_key').type('{enter}'); + typeEnter(); + waitTimeout(); + typeEnter(); + + // Proceed to main game loop + typeEnter(); + typeEnter(); +} + function playFluencyLoop() { cy.get('#question_input_key').type(questionInput); waitTimeout(); @@ -94,7 +149,70 @@ function checkGameComplete(endText, continueText = null) { }); } -export function playFluency(endText, continueText = null) { - playFluencyIntro(); +export function playFluencyARF({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, + endText = 'You are all done.', + continueText = null, +} = {}) { + Cypress.on('uncaught:exception', () => { + return false; + }); + + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + cy.visit('/'); + + cy.selectAdministration(administration); + + cy.get('.p-tabview').contains('ROAM - Single Digit'); + cy.visit(`/game/fluency-arf`); + + // Click jspsych button to begin + cy.get('.jspsych-btn', { timeout: 6 * timeout }) + .should('be.visible') + .click(); + + playFluencyARFIntro(); + checkGameComplete(endText, continueText); + + // Check if game is marked as complete on the dashboard + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(administration); + cy.get('.tabview-nav-link-label').contains('ROAM - Single Digit').should('exist'); +} + +export function playFluencyCALF({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, + endText = 'You are all done.', + continueText = null, +} = {}) { + Cypress.on('uncaught:exception', () => { + return false; + }); + + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + cy.visit('/'); + + cy.selectAdministration(administration); + + cy.get('.p-tabview').contains('ROAM - Multi Digit'); + cy.visit(`/game/fluency-calf`); + + // Click jspsych button to begin + cy.get('.jspsych-btn', { timeout: 6 * timeout }) + .should('be.visible') + .click(); + + playFluencyCALFIntro(); checkGameComplete(endText, continueText); + + // Check if game is marked as complete on the dashboard + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(administration); + cy.get('.tabview-nav-link-label').contains('ROAM - Multi Digit').should('exist'); } diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index f01ace1c6..5054dd1a2 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -61,8 +61,14 @@ export function startGame(administration, language, optional) { cy.get('.go-button', { timeout: timeout }).should('be.visible').click(); } -export function playLetter(administration, language, gameCompleteText, optional = false) { +export function playLetter({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + gameCompleteText = 'Congratulations', + optional = false, +} = {}) { startGame(administration, language, optional); + makeChoiceOrContinue(gameCompleteText); cy.log('Game finished successfully.'); diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index 57b048314..884b2aa9c 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -110,7 +110,30 @@ function playThirdTutorial() { cy.get('.continue').click(); } -export function playPA(startText, breakText, breakText2, endText) { +export function playPA({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, + startText = 'In this game we are going to look for words that BEGIN with the same sound.', + breakText = 'Take a break if needed', + breakText2 = { + break1: 'Great job', + break2: 'Look at all those carrots', + break3: 'You are doing great', + }, + endText = { + endText1: 'Take a break if needed', + endText2: 'I have been swimming so much', + endText3: 'You have helped me and all my friends!', + }, +} = {}) { + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + cy.visit('/'); + + cy.selectAdministration(administration); + + cy.visit('/game/pa'); + playIntro(startText); playFirstTutorial(); @@ -140,6 +163,14 @@ export function playPA(startText, breakText, breakText2, endText) { playTrial(breakText2.break3); cy.get('.continue', { timeout: 2 * timeout }).click(); playTrial(endText.endText3); + + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); + cy.get('.tabview-nav-link-label', { timeout: 3 * timeout }) + .contains('ROAR - Phoneme') + .should('exist'); + // playIntro(startText); // playFirstTutorial(); diff --git a/cypress/support/helper-functions/roar-sre/sreHelpers.js b/cypress/support/helper-functions/roar-sre/sreHelpers.js index f2ff0871b..fd5c4c6ef 100644 --- a/cypress/support/helper-functions/roar-sre/sreHelpers.js +++ b/cypress/support/helper-functions/roar-sre/sreHelpers.js @@ -2,7 +2,11 @@ import { languageOptions } from './languageOptions'; const timeout = Cypress.env('timeout'); -export const playSRE = (administration, language, optional = false) => { +export const playSRE = ({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, +} = {}) => { Cypress.on('uncaught:exception', () => { return false; }); diff --git a/cypress/support/helper-functions/roar-swr/swrHelpers.js b/cypress/support/helper-functions/roar-swr/swrHelpers.js index 2f7aaf38e..1206ef8d6 100644 --- a/cypress/support/helper-functions/roar-swr/swrHelpers.js +++ b/cypress/support/helper-functions/roar-swr/swrHelpers.js @@ -2,7 +2,11 @@ import { languageOptions } from './languageOptions'; const timeout = Cypress.env('timeout'); -export const playSWR = (administration, language, optional = false) => { +export const playSWR = ({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, +} = {}) => { // Log in once at the beginning of the test case that calls playSWR cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); From 735d47a3a86fdb627bc47d27c20d3ed1d57efe82 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 19 Apr 2024 15:39:25 -0700 Subject: [PATCH 02/34] rebase onto main --- .github/workflows/cypress-network-tests.yml | 2 +- .../workflows/firebase-hosting-production.yml | 42 ++++++- .../es-tests/playFluency-ARF-ES.cy.js | 31 ++--- .../es-tests/playFluency-CALF-ES.cy.js | 34 ++---- .../es-tests/playLetter-ES.cy.js | 6 +- .../participant/default-tests/playCVA.cy.js | 7 ++ .../default-tests/playMorphology.cy.js | 7 ++ .../participant/default-tests/playVocab.cy.js | 7 ++ .../roam-fluency/playFluency-ARF-3G.cy.js | 28 +---- .../playFluency-ARF-HighLatency.cy.js | 28 +---- .../network-tests/roar-swr/playSWR-2G.cy.js | 9 +- .../network-tests/roar-swr/playSWR-3G.cy.js | 9 +- .../roar-swr/playSWR-HighLatency.cy.js | 9 +- .../playOptionalGames.cy.js | 0 .../testOpenAdministrations.cy.js | 77 ++++++------ .../getOpenAdministrations.cy.js | 6 +- .../roam-fluency/fluencyHelpers.js | 16 ++- .../roam-fluency/languageOptions.js | 22 ++++ .../roar-multichoice/languageOptions.js | 16 +++ .../roar-multichoice/multichoiceHelpers.js | 110 ++++++++++++++++++ .../roar-pa/languageOptions.js | 14 +++ .../roar-vocab/languageOptions.js | 10 ++ .../roar-vocab/vocabHelpers.js | 85 ++++++++++++++ src/sentry.js | 2 +- 24 files changed, 422 insertions(+), 155 deletions(-) create mode 100644 cypress/e2e/participant/default-tests/playCVA.cy.js create mode 100644 cypress/e2e/participant/default-tests/playMorphology.cy.js create mode 100644 cypress/e2e/participant/default-tests/playVocab.cy.js rename cypress/e2e/participant/{default-tests => old-tests}/playOptionalGames.cy.js (100%) rename cypress/e2e/{pre-release-tests => super-admin/default-tests}/getOpenAdministrations.cy.js (63%) create mode 100644 cypress/support/helper-functions/roam-fluency/languageOptions.js create mode 100644 cypress/support/helper-functions/roar-multichoice/languageOptions.js create mode 100644 cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js create mode 100644 cypress/support/helper-functions/roar-pa/languageOptions.js create mode 100644 cypress/support/helper-functions/roar-vocab/languageOptions.js create mode 100644 cypress/support/helper-functions/roar-vocab/vocabHelpers.js diff --git a/.github/workflows/cypress-network-tests.yml b/.github/workflows/cypress-network-tests.yml index 8314d1281..dddc5480a 100644 --- a/.github/workflows/cypress-network-tests.yml +++ b/.github/workflows/cypress-network-tests.yml @@ -1,4 +1,4 @@ -name: Cypress Network Tests +name: Cypress Pre-Release Tests on: workflow_run: workflows: ['Deploy to Firebase Hosting (production)'] diff --git a/.github/workflows/firebase-hosting-production.yml b/.github/workflows/firebase-hosting-production.yml index ab9abd649..fb95fd2ab 100644 --- a/.github/workflows/firebase-hosting-production.yml +++ b/.github/workflows/firebase-hosting-production.yml @@ -1,7 +1,7 @@ # This file was auto-generated by the Firebase CLI # https://github.com/firebase/firebase-tools -name: Deploy to Firebase Hosting (production) +name: Deploy to Firebase Hosting (production) with Pre-Release Tests 'on': push: tags: @@ -9,8 +9,44 @@ name: Deploy to Firebase Hosting (production) - 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+' - 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' jobs: - build_and_deploy: - name: Deploy + pre-release-tests: + name: Run Cypress Pre-Release Tests + needs: [build-and-preview] + runs-on: ubuntu-latest + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + browser: [chromium, edge] + containers: [1, 2, 3, 4] + env: + NODE_ENV: 'test' + CYPRESS_BASE_URL: 'http://localhost:5173' + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + COMMIT_INFO_MESSAGE: Pre release tests for ROAR Dashboard release ${{ github.event.release.tag_name }} "${{ github.event.release.name }}" + COMMIT_INFO_SHA: ${{ github.event.release.release_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: npm ci && npm run build + start: npm run dev + wait-on: ${{ env.CYPRESS_BASE_URL }} + wait-on-timeout: 120 + record: true + parallel: true + spec: 'cypress/e2e/pre-release-tests/**/*' + ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} + + build-and-deploy: + name: Deploy to Firebase Production Hosting Channel + needs: [pre-release-tests] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js index 6ee638b65..d8d20059e 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js @@ -1,34 +1,17 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; -const timeout = Cypress.env('timeout'); const administration = Cypress.env('testSpanishRoarAppsAdministration'); +const language = 'es'; +const task = 'fluency-arf-es'; const endText = 'Has terminado.'; describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - Cypress.on('uncaught:exception', () => { - return false; + playFluencyARF({ + administration: administration, + language: language, + task: task, + endText: endText, }); - - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.visit('/'); - - cy.selectAdministration(administration); - - cy.get('.p-tabview').contains('ROAM - Un Dígito'); - cy.visit(`/game/fluency-arf-es`); - - // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 5 * timeout }) - .should('be.visible') - .click(); - - playFluencyARF(endText); - - // Check if game is marked as complete on the dashboard - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(administration); - cy.get('.tabview-nav-link-label').contains('ROAM - Un Dígito').should('exist'); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js index 353813a97..6bab4e184 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js @@ -1,35 +1,19 @@ -import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { playFluencyCALF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; -const timeout = Cypress.env('timeout'); const administration = Cypress.env('testSpanishRoarAppsAdministration'); +const language = 'es'; +const task = 'fluency-calf-es'; const endText = 'Has terminado.'; const continueText = 'continuar'; describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - Cypress.on('uncaught:exception', () => { - return false; + playFluencyCALF({ + administration: administration, + language: language, + task: task, + endText: endText, + continueText: continueText, }); - - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.visit('/'); - - cy.selectAdministration(administration); - - cy.get('.p-tabview').contains('ROAM - Varios Dígitos'); - cy.visit(`/game/fluency-calf-es`); - - // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 5 * timeout }) - .should('be.visible') - .click(); - - playFluencyARF(endText, continueText); - - // Check if game is marked as complete on the dashboard - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(administration); - cy.get('.tabview-nav-link-label').contains('ROAM - Varios Dígitos').should('exist'); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js index 9e6a87ef2..f31690226 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js @@ -6,6 +6,10 @@ const gameCompleteText = '¡Has terminado! ¡Gracias por ayudarme a encontrar es describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - playLetter(administration, language, gameCompleteText); + playLetter({ + administration: administration, + language: language, + gameCompleteText: gameCompleteText, + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playCVA.cy.js b/cypress/e2e/participant/default-tests/playCVA.cy.js new file mode 100644 index 000000000..90da7951e --- /dev/null +++ b/cypress/e2e/participant/default-tests/playCVA.cy.js @@ -0,0 +1,7 @@ +import { playWrittenVocabulary } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers'; + +describe('ROAR - Written Vocabulary Play Through', () => { + it('Plays Written Vocabulary', () => { + playWrittenVocabulary(); + }); +}); diff --git a/cypress/e2e/participant/default-tests/playMorphology.cy.js b/cypress/e2e/participant/default-tests/playMorphology.cy.js new file mode 100644 index 000000000..902009559 --- /dev/null +++ b/cypress/e2e/participant/default-tests/playMorphology.cy.js @@ -0,0 +1,7 @@ +import { playMorphology } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers'; + +describe('ROAR - Written Vocabulary Play Through', () => { + it('Plays Written Vocabulary', () => { + playMorphology(); + }); +}); diff --git a/cypress/e2e/participant/default-tests/playVocab.cy.js b/cypress/e2e/participant/default-tests/playVocab.cy.js new file mode 100644 index 000000000..9cccd5682 --- /dev/null +++ b/cypress/e2e/participant/default-tests/playVocab.cy.js @@ -0,0 +1,7 @@ +import { playVocabulary } from '../../../support/helper-functions/roar-vocab/vocabHelpers'; + +describe('ROAR - Written Vocabulary Play Through', () => { + it('Plays Written Vocabulary', () => { + playVocabulary(); + }); +}); diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js index 4b26202ed..af4754450 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js @@ -1,31 +1,7 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; -const timeout = Cypress.env('timeout'); -const endText = 'You are all done.'; - -describe('Test playthrough of Fluency as a participant', () => { +describe('Test playthrough of Fluency as a participant in a simulated 3G network', () => { it('Fluency Playthrough Test', () => { - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.wait(0.3 * timeout); - cy.visit('/'); - - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - - cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Single-Digit'); - cy.visit(`/game/fluency-arf`); - - // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 5 * timeout }) - .should('be.visible') - .click(); - - playFluencyARF(endText); - - // Check if game is marked as complete on the dashboard - // Check if game is marked as complete on the dashboard - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - cy.get('.tabview-nav-link-label').contains('ROAM - Single-Digit').should('exist'); + playFluencyARF(); }); }); diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js index 01355492d..253a8d63b 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js @@ -1,31 +1,7 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; -const timeout = Cypress.env('timeout'); -const endText = 'You are all done.'; - -describe('Test playthrough of Fluency as a participant', () => { +describe('Test playthrough of Fluency as a participant in a simulated high latency networkt', () => { it('Fluency Playthrough Test', () => { - cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); - cy.wait(0.3 * timeout); - cy.visit('/'); - - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - - cy.get('.p-tabview', { timeout: timeout }).contains('ROAM - Single-Digit'); - cy.visit(`/game/fluency-arf`); - - // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 12 * timeout }) - .should('be.visible') - .click(); - - playFluencyARF(endText); - - // Check if game is marked as complete on the dashboard - // Check if game is marked as complete on the dashboard - cy.visit('/'); - cy.wait(0.2 * timeout); - cy.selectAdministration(Cypress.env('testRoarAppsAdministration')); - cy.get('.tabview-nav-link-label').contains('ROAM - Single-Digit').should('exist'); + playFluencyARF(); }); }); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js index 21eb416d9..c902447e0 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js @@ -1,3 +1,10 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; -playSWR(Cypress.env('testRoarAppsAdministration')); +const administration = Cypress.env('testRoarAppsAdministration'); +const language = 'en'; + +describe('ROAR - Word Play Through in a simulated 2G network', () => { + it('Plays Word', () => { + playSWR(administration, language); + }); +}); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js index 21eb416d9..4cefd74d1 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js @@ -1,3 +1,10 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; -playSWR(Cypress.env('testRoarAppsAdministration')); +const administration = Cypress.env('testRoarAppsAdministration'); +const language = 'en'; + +describe('ROAR - Word Play Through in a simulated 3G network', () => { + it('Plays Word', () => { + playSWR(administration, language); + }); +}); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js index 21eb416d9..016e75554 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js @@ -1,3 +1,10 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; -playSWR(Cypress.env('testRoarAppsAdministration')); +const administration = Cypress.env('testRoarAppsAdministration'); +const language = 'en'; + +describe('ROAR - Word Play Through in a simulated high latency network', () => { + it('Plays Word', () => { + playSWR(administration, language); + }); +}); diff --git a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js b/cypress/e2e/participant/old-tests/playOptionalGames.cy.js similarity index 100% rename from cypress/e2e/participant/default-tests/playOptionalGames.cy.js rename to cypress/e2e/participant/old-tests/playOptionalGames.cy.js diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index 6ac143e9d..88395b4ea 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -3,6 +3,11 @@ import { playSRE } from '../../support/helper-functions/roar-sre/sreHelpers'; import { playLetter } from '../../support/helper-functions/roar-letter/letterHelpers'; import { playPA } from '../../support/helper-functions/roar-pa/paHelpers'; import { playFluencyARF, playFluencyCALF } from '../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { + playMorphology, + playWrittenVocabulary, +} from '../../support/helper-functions/roar-multichoice/multichoiceHelpers'; +import { playVocabulary } from '../../support/helper-functions/roar-vocab/vocabHelpers'; // Create helper functions for every game which can be called here to play the game // These helper functions must take an object for its parameters, with explicit default values @@ -10,42 +15,42 @@ import { playFluencyARF, playFluencyCALF } from '../../support/helper-functions/ const timeout = Cypress.env('timeout'); const testSpecs = [ - // { - // name: "ROAR - Picture Vocabulary", - // spec: "", - // }, - // { - // name: "ROAR - Written Vocabulary", - // spec: "", - // }, - // { - // name: 'ROAR - Letter', - // spec: playLetter, - // }, - // { - // name: "ROAR - Morphology", - // spec: "", - // }, - // { - // name: 'ROAR - Phoneme', - // spec: playPA, - // }, - // { - // name: 'ROAR - Sentence', - // spec: playSRE, - // }, - // { - // name: 'ROAR - Word', - // spec: playSWR, - // }, - // { - // name: 'ROAM - Single Digit', - // spec: playFluencyARF, - // }, - // { - // name: 'ROAM - Multi Digit', - // spec: playFluencyCALF, - // }, + { + name: 'ROAR - Picture Vocabulary', + spec: playVocabulary, + }, + { + name: 'ROAR - Written Vocabulary', + spec: playWrittenVocabulary, + }, + { + name: 'ROAR - Letter', + spec: playLetter, + }, + { + name: 'ROAR - Morphology', + spec: playMorphology, + }, + { + name: 'ROAR - Phoneme', + spec: playPA, + }, + { + name: 'ROAR - Sentence', + spec: playSRE, + }, + { + name: 'ROAR - Word', + spec: playSWR, + }, + { + name: 'ROAM - Single Digit', + spec: playFluencyARF, + }, + { + name: 'ROAM - Multi Digit', + spec: playFluencyCALF, + }, ]; const openAdmins = []; diff --git a/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js b/cypress/e2e/super-admin/default-tests/getOpenAdministrations.cy.js similarity index 63% rename from cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js rename to cypress/e2e/super-admin/default-tests/getOpenAdministrations.cy.js index ab97cdc51..885655480 100644 --- a/cypress/e2e/pre-release-tests/getOpenAdministrations.cy.js +++ b/cypress/e2e/super-admin/default-tests/getOpenAdministrations.cy.js @@ -1,6 +1,6 @@ -import { signInAsSuperAdmin } from '../../support/helper-functions/super-admin/superAdminHelpers'; -import { getDevFirebase } from '../../support/devFirebase'; -import { getOpenAdministrations } from '../../support/query'; +import { signInAsSuperAdmin } from '../../../support/helper-functions/super-admin/superAdminHelpers'; +import { getDevFirebase } from '../../../support/devFirebase'; +import { getOpenAdministrations } from '../../../support/query'; const adminAuth = getDevFirebase('admin').auth; const adminFirestore = getDevFirebase('admin').db; diff --git a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js index d6eb2f864..301ae325e 100644 --- a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js +++ b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js @@ -1,3 +1,5 @@ +import { languageOptions } from './languageOptions'; + const timeout = Cypress.env('timeout'); const participantId = '123456789'; const questionInput = '42'; @@ -152,6 +154,7 @@ function checkGameComplete(endText, continueText = null) { export function playFluencyARF({ administration = Cypress.env('testRoarAppsAdministration'), language = 'en', + task = 'fluency-arf', optional = false, endText = 'You are all done.', continueText = null, @@ -165,8 +168,8 @@ export function playFluencyARF({ cy.selectAdministration(administration); - cy.get('.p-tabview').contains('ROAM - Single Digit'); - cy.visit(`/game/fluency-arf`); + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language][task].gameTab).should('exist'); + cy.visit(`/game/${task}`); // Click jspsych button to begin cy.get('.jspsych-btn', { timeout: 6 * timeout }) @@ -180,12 +183,13 @@ export function playFluencyARF({ cy.visit('/'); cy.wait(0.2 * timeout); cy.selectAdministration(administration); - cy.get('.tabview-nav-link-label').contains('ROAM - Single Digit').should('exist'); + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language][task].gameTab).should('exist'); } export function playFluencyCALF({ administration = Cypress.env('testRoarAppsAdministration'), language = 'en', + task = 'fluency-calf', optional = false, endText = 'You are all done.', continueText = null, @@ -199,8 +203,8 @@ export function playFluencyCALF({ cy.selectAdministration(administration); - cy.get('.p-tabview').contains('ROAM - Multi Digit'); - cy.visit(`/game/fluency-calf`); + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language][task].gameTab).should('exist'); + cy.visit(`/game/${task}`); // Click jspsych button to begin cy.get('.jspsych-btn', { timeout: 6 * timeout }) @@ -214,5 +218,5 @@ export function playFluencyCALF({ cy.visit('/'); cy.wait(0.2 * timeout); cy.selectAdministration(administration); - cy.get('.tabview-nav-link-label').contains('ROAM - Multi Digit').should('exist'); + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language][task].gameTab).should('exist'); } diff --git a/cypress/support/helper-functions/roam-fluency/languageOptions.js b/cypress/support/helper-functions/roam-fluency/languageOptions.js new file mode 100644 index 000000000..2d86898d4 --- /dev/null +++ b/cypress/support/helper-functions/roam-fluency/languageOptions.js @@ -0,0 +1,22 @@ +export const languageOptions = { + en: { + 'fluency-arf': { + gameTab: 'ROAM - Single Digit', + url: '/game/fluency-arf', + }, + 'fluency-calf': { + gameTab: 'ROAM - Multi Digit', + url: '/game/fluency-calf', + }, + }, + es: { + 'fluency-arf-es': { + gameTab: 'ROAM - Un Dígito', + url: '/game/fluency-arf-es', + }, + 'fluency-calf-es': { + gameTab: 'ROAM - Varios Dígitos', + url: '/game/fluency-calf-es', + }, + }, +}; diff --git a/cypress/support/helper-functions/roar-multichoice/languageOptions.js b/cypress/support/helper-functions/roar-multichoice/languageOptions.js new file mode 100644 index 000000000..e22d60c4d --- /dev/null +++ b/cypress/support/helper-functions/roar-multichoice/languageOptions.js @@ -0,0 +1,16 @@ +export const languageOptions = { + en: { + morphology: { + gameTab: 'ROAR - Morphology', + url: '/game/morphology', + }, + cva: { + gameTab: 'ROAR - Written Vocabulary', + url: '/game/cva', + }, + }, + // es: { + // gameTab: 'ROAR - Letra', + // url: '/game/letter-es', + // }, +}; diff --git a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js new file mode 100644 index 000000000..d1a95c56a --- /dev/null +++ b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js @@ -0,0 +1,110 @@ +import { languageOptions } from './languageOptions'; + +const timeout = Cypress.env('timeout'); + +function clickButton(selector) { + cy.get(selector).then(($btn) => { + if ($btn.length > 0) { + $btn.click(); + } + }); +} + +function checkGameTab(language, task) { + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language][task].gameTab).should('exist'); +} + +function makeChoiceOrContinue(gameCompleteText) { + cy.wait(0.2 * timeout); + cy.get('body').then((body) => { + const text = body.text().replace(/\s\s+/g, ' ').trim(); + cy.log('Found text: ', text); + if (text.includes(gameCompleteText)) { + cy.log('Game is complete.').then(() => true); + } else { + if (body.find('.go-button').length > 0) { + clickButton('.go-button'); + } else if (body.find('.glowingButton').length > 0) { + clickButton('.glowingButton'); + } else { + clickButton('button:first'); + } + cy.log('Making choice or continuing.'); + makeChoiceOrContinue(gameCompleteText); + } + }); +} + +export function startGame(administration, language, optional, task) { + Cypress.on('uncaught:exception', () => false); + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + + cy.visit('/', { timeout: 2 * timeout }); + cy.selectAdministration(administration); + + if (optional) { + cy.switchToOptionalAssessments(); + } + + checkGameTab(language, task); + cy.visit(languageOptions[language][task].url); + + cy.get('.jspsych-btn', { timeout: 3 * timeout }) + .should('be.visible') + .click(); + + cy.wait(0.1 * timeout); + Cypress.on('uncaught:exception', () => { + return false; + }); + + cy.get('.go-button', { timeout: timeout }).should('be.visible').click(); +} + +export function playMorphology({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, + task = 'morphology', + gameCompleteText = "You're all done", +} = {}) { + startGame(administration, language, optional, task); + + makeChoiceOrContinue(gameCompleteText); + cy.log('Game finished successfully.'); + + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(administration); + + if (optional) { + cy.switchToOptionalAssessments(); + } + + checkGameTab(language, task); + cy.log('Test completed successfully.'); +} + +export function playWrittenVocabulary({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + optional = false, + task = 'cva', + gameCompleteText = "You're all done", +} = {}) { + startGame(administration, language, optional, task); + + makeChoiceOrContinue(gameCompleteText); + cy.log('Game finished successfully.'); + + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(administration); + + if (optional) { + cy.switchToOptionalAssessments(); + } + + checkGameTab(language, task); + cy.log('Test completed successfully.'); +} diff --git a/cypress/support/helper-functions/roar-pa/languageOptions.js b/cypress/support/helper-functions/roar-pa/languageOptions.js new file mode 100644 index 000000000..44aad155a --- /dev/null +++ b/cypress/support/helper-functions/roar-pa/languageOptions.js @@ -0,0 +1,14 @@ +export const languageOptions = { + en: { + pa: { + gameTab: 'ROAR - Phoneme', + url: '/game/pa', + }, + }, + es: { + 'pa-es': { + gameTab: 'ROAR - Fonema', + url: '/game/pa-es', + }, + }, +}; diff --git a/cypress/support/helper-functions/roar-vocab/languageOptions.js b/cypress/support/helper-functions/roar-vocab/languageOptions.js new file mode 100644 index 000000000..561239600 --- /dev/null +++ b/cypress/support/helper-functions/roar-vocab/languageOptions.js @@ -0,0 +1,10 @@ +export const languageOptions = { + en: { + gameTab: 'ROAR - Picture Vocabulary', + url: '/game/vocab', + }, + // es: { + // gameTab: 'ROAR - Letra', + // url: '/game/letter-es', + // }, +}; diff --git a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js new file mode 100644 index 000000000..e63ba85bc --- /dev/null +++ b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js @@ -0,0 +1,85 @@ +import { languageOptions } from './languageOptions'; + +const timeout = Cypress.env('timeout'); + +function checkGameTab(language) { + cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language].gameTab).should('exist'); +} + +function makeChoiceOrContinue(gameCompleteText) { + cy.wait(0.2 * timeout); + cy.get('body').then((body) => { + // If a go button is found, click it and then return to playMultichoice loop + if (body.find('.continue').length > 0) { + cy.get('body') + .invoke('text') + .then((text) => { + if (text.includes(gameCompleteText)) { + cy.log('Game completed.'); + cy.get('.continue').click(); + } else { + cy.log('Game not completed.'); + cy.get('.continue').click(); + makeChoiceOrContinue(gameCompleteText); + } + }); + } else { + cy.get('img.vocab_img').first().click(); + makeChoiceOrContinue(gameCompleteText); + } + }); +} +function selectAlienAvatar() { + cy.get('img.intro_aliens', { timeout: 2 * timeout }) + .should('be.visible') + .first() + .click(); +} + +function startGame(administration, language, optional) { + cy.wait(0.1 * timeout); + Cypress.on('uncaught:exception', () => { + return false; + }); + cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); + + cy.visit('/', { timeout: 2 * timeout }); + cy.selectAdministration(administration); + + if (optional) { + cy.switchToOptionalAssessments(); + } + + checkGameTab(language); + cy.visit(languageOptions[language].url); + + cy.get('.jspsych-btn', { timeout: 6 * timeout }) + .should('be.visible') + .click(); + + selectAlienAvatar(); +} + +export function playVocabulary({ + administration = Cypress.env('testRoarAppsAdministration'), + language = 'en', + gameCompleteText = 'We’ve all learned so much!', + optional = false, +} = {}) { + startGame(administration, language, optional); + + makeChoiceOrContinue(gameCompleteText); + + cy.log('Game finished successfully.'); + + cy.visit('/'); + cy.wait(0.2 * timeout); + cy.selectAdministration(administration); + + if (optional) { + cy.switchToOptionalAssessments(); + } + + checkGameTab(language); + cy.log('Test completed successfully.'); +} diff --git a/src/sentry.js b/src/sentry.js index 2698458a4..a0e98d272 100644 --- a/src/sentry.js +++ b/src/sentry.js @@ -13,7 +13,7 @@ export function initSentry(app) { return; } // Only initialize Sentry in production - if (process.env.NODE_ENV === 'production') { + if (process.env.NODE_ENV === 'production' && process.env.MODE !== 'LEVANTE') { Sentry.init({ app, dsn: 'https://f15e3ff866394e93e00514b42113d03d@o4505913837420544.ingest.us.sentry.io/4506820782129152', From 775aa7340d72202442c520ee1d24238ccf6bf069 Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 19 Apr 2024 16:48:10 -0700 Subject: [PATCH 03/34] Add test retries function; more logging --- .../workflows/firebase-hosting-production.yml | 2 +- .../testOpenAdministrations.cy.js | 33 +++++++++++++++---- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/firebase-hosting-production.yml b/.github/workflows/firebase-hosting-production.yml index fb95fd2ab..3f40e67c3 100644 --- a/.github/workflows/firebase-hosting-production.yml +++ b/.github/workflows/firebase-hosting-production.yml @@ -13,7 +13,7 @@ jobs: name: Run Cypress Pre-Release Tests needs: [build-and-preview] runs-on: ubuntu-latest - timeout-minutes: 90 + timeout-minutes: 120 strategy: fail-fast: false matrix: diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index 88395b4ea..90d07dc10 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -53,7 +53,23 @@ const testSpecs = [ }, ]; -const openAdmins = []; +function retryTest(testFunc, retries = 3) { + let attempts = 0; + const run = () => { + attempts++; + try { + testFunc(); + } catch (error) { + if (attempts < retries) { + cy.log(`Test failed, retrying... (${attempts}/${retries})`); + run(); + } else { + throw error; + } + } + }; + run(); +} async function getOpenAdmins() { cy.get('[data-cy=dropdown-select-administration]').click(); @@ -67,12 +83,15 @@ async function getOpenAdmins() { cy.get('[data-cy=dropdown-select-administration]').click(); } +const openAdmins = []; + describe('Testing all open administrations', () => { it('Tests the open administration', () => { cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); cy.visit('/', { timeout: 2 * timeout }); getOpenAdmins(); + cy.log('Found', openAdmins.length, 'open administrations.'); cy.then(() => { openAdmins.forEach((admin) => { @@ -80,23 +99,25 @@ describe('Testing all open administrations', () => { cy.selectAdministration(admin); testSpecs.forEach((spec) => { - cy.log(spec); cy.get('.p-tabview') .invoke('text') .then((text) => { - cy.log('Found text', text); if (text.includes(spec.name)) { - cy.log(`Playing ${spec.name}`); + cy.log(`Initializing test for ${spec.name}`); - spec.spec({ - administration: admin, + retryTest(() => { + spec.spec({ + administration: admin, + }); }); } else { cy.log('No game found for', spec.name); } }); }); + cy.log('Successfully tested all games for administration: ', admin); }); }); + cy.log('Successfully tested all games for all open administrations!'); }); }); From 2fa26ccde00c6bc8dbdc4c66750990916e2daf3f Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 30 Apr 2024 13:32:30 -0700 Subject: [PATCH 04/34] rebase onto main --- .../workflows/firebase-hosting-production.yml | 4 +- .../playOptionalGames.cy.js | 0 .../playButtonGames.cy.js | 0 .../testOpenAdministrations.cy.js | 98 ++++++++++++------- cypress/support/commands.js | 2 +- .../roar-multichoice/languageOptions.js | 4 - .../helper-functions/roar-pa/paHelpers.js | 23 ----- cypress/support/query.js | 12 ++- 8 files changed, 79 insertions(+), 64 deletions(-) rename cypress/e2e/participant/{old-tests => default-tests}/playOptionalGames.cy.js (100%) rename cypress/e2e/participant/{default-tests => old-tests}/playButtonGames.cy.js (100%) diff --git a/.github/workflows/firebase-hosting-production.yml b/.github/workflows/firebase-hosting-production.yml index 3f40e67c3..86973c848 100644 --- a/.github/workflows/firebase-hosting-production.yml +++ b/.github/workflows/firebase-hosting-production.yml @@ -13,7 +13,7 @@ jobs: name: Run Cypress Pre-Release Tests needs: [build-and-preview] runs-on: ubuntu-latest - timeout-minutes: 120 + timeout-minutes: 180 strategy: fail-fast: false matrix: @@ -73,7 +73,7 @@ jobs: SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }} with: environment: production - sourcemap: ./dist/assets/*.js.map + sourcemaps: ./dist/assets/*.js.map version: ${{ github.ref }} - name: Notify on failure diff --git a/cypress/e2e/participant/old-tests/playOptionalGames.cy.js b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js similarity index 100% rename from cypress/e2e/participant/old-tests/playOptionalGames.cy.js rename to cypress/e2e/participant/default-tests/playOptionalGames.cy.js diff --git a/cypress/e2e/participant/default-tests/playButtonGames.cy.js b/cypress/e2e/participant/old-tests/playButtonGames.cy.js similarity index 100% rename from cypress/e2e/participant/default-tests/playButtonGames.cy.js rename to cypress/e2e/participant/old-tests/playButtonGames.cy.js diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index 90d07dc10..6d74bcf01 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -8,10 +8,8 @@ import { playWrittenVocabulary, } from '../../support/helper-functions/roar-multichoice/multichoiceHelpers'; import { playVocabulary } from '../../support/helper-functions/roar-vocab/vocabHelpers'; - -// Create helper functions for every game which can be called here to play the game -// These helper functions must take an object for its parameters, with explicit default values -// Each helper function must be a complete test that logs in, plays the game, and checks for game completion +import { getOpenAdministrations } from '../../support/query'; +import { getDevFirebase } from '../../support/devFirebase'; const timeout = Cypress.env('timeout'); const testSpecs = [ @@ -72,48 +70,82 @@ function retryTest(testFunc, retries = 3) { } async function getOpenAdmins() { - cy.get('[data-cy=dropdown-select-administration]').click(); - cy.get('.p-dropdown-panel').within(() => { - cy.get('li').each((el) => { - if (el.text().includes('Synced Administration')) { - openAdmins.push(el.text()); + const adminFirestore = getDevFirebase('admin').db; + const openAdmins = await getOpenAdministrations(adminFirestore); + + return openAdmins.filter((admin) => admin.includes('Synced Administration')); +} + +function checkOptionalGame(spec, admin, text) { + cy.get('body').then(($body) => { + if ($body.find('[data-cy="switch-show-optional-assessments"]').length > 0) { + cy.switchToOptionalAssessments(); + if (text.includes(spec.name)) { + cy.log(`Initializing test for optional game: ${spec.name}`); + retryTest(() => { + spec.spec({ + administration: admin, + }); + }); + } else { + cy.log('No optional game found for game:', spec.name); } - }); + } else { + cy.log('No game found for game:', spec.name); + } }); - cy.get('[data-cy=dropdown-select-administration]').click(); } -const openAdmins = []; +function testGame(spec, admin) { + cy.get('.p-tabview') + .invoke('text') + .then((text) => { + if (text.includes(spec.name)) { + cy.log(`Initializing test for game: ${spec.name}`); + retryTest(() => { + spec.spec({ + administration: admin, + }); + }); + } else { + checkOptionalGame(spec, admin, text); + } + }); +} describe('Testing all open administrations', () => { - it('Tests the open administration', () => { + let openAdmins; + + beforeEach(() => { + // Log in as a super admin and fetch all open administrations from Firestore + cy.then(async () => { + openAdmins = await getOpenAdmins(); + cy.wrap(openAdmins).as('openAdmins'); + cy.log('Found', openAdmins.length, 'open administrations.'); + }); + }); + + it('Logs the open administrations', () => { + cy.get('@openAdmins').then((openAdmins) => { + cy.log('Found', openAdmins.length, 'open administrations.'); + openAdmins.forEach((admin) => { + cy.log(`Found administration: ${admin}`); + }); + }); + }); + + it('Tests the open administrations', () => { + // Clear all saved sessions and log in as a participant + Cypress.session.clearAllSavedSessions(); cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword')); cy.visit('/', { timeout: 2 * timeout }); - getOpenAdmins(); - cy.log('Found', openAdmins.length, 'open administrations.'); - - cy.then(() => { + cy.get('@openAdmins').then((openAdmins) => { openAdmins.forEach((admin) => { cy.log(`Testing ${admin}`); cy.selectAdministration(admin); - testSpecs.forEach((spec) => { - cy.get('.p-tabview') - .invoke('text') - .then((text) => { - if (text.includes(spec.name)) { - cy.log(`Initializing test for ${spec.name}`); - - retryTest(() => { - spec.spec({ - administration: admin, - }); - }); - } else { - cy.log('No game found for', spec.name); - } - }); + testGame(spec, admin); }); cy.log('Successfully tested all games for administration: ', admin); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5060013db..9dc3b4608 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -105,7 +105,7 @@ Cypress.Commands.add('selectAdministration', (testAdministration) => { .contains(testAdministration) .should('exist') .click(); - cy.log('Selectected administration:', testAdministration); + cy.log('Selected administration:', testAdministration); }); Cypress.Commands.add('getAdministrationCard', (testAdministration) => { diff --git a/cypress/support/helper-functions/roar-multichoice/languageOptions.js b/cypress/support/helper-functions/roar-multichoice/languageOptions.js index e22d60c4d..c94ccc017 100644 --- a/cypress/support/helper-functions/roar-multichoice/languageOptions.js +++ b/cypress/support/helper-functions/roar-multichoice/languageOptions.js @@ -9,8 +9,4 @@ export const languageOptions = { url: '/game/cva', }, }, - // es: { - // gameTab: 'ROAR - Letra', - // url: '/game/letter-es', - // }, }; diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index 884b2aa9c..d801c25e8 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -170,27 +170,4 @@ export function playPA({ cy.get('.tabview-nav-link-label', { timeout: 3 * timeout }) .contains('ROAR - Phoneme') .should('exist'); - - // playIntro(startText); - - // playFirstTutorial(); - // playTrial(breakText.breakText1); - // // fsmBreak - // cy.log('break 1'); - // cy.get('.continue', { timeout: 2 * timeout }).click(); - // playTrial(endText.endText1); - - // playSecondTutorial(); - // playTrial(breakText.breakText2); - // // lsmBreak - // cy.log('break 2'); - // cy.get('.continue', { timeout: 2 * timeout }).click(); - // playTrial(endText.endText2); - - // playThirdTutorial(); - // playTrial(breakText.breakText3); - // // delBreak - // cy.log('break 3'); - // cy.get('.continue', { timeout: 2 * timeout }).click(); - // playTrial(endText.endText3); } diff --git a/cypress/support/query.js b/cypress/support/query.js index 43510f47d..1c580e859 100644 --- a/cypress/support/query.js +++ b/cypress/support/query.js @@ -1,4 +1,6 @@ import { collection, deleteDoc, doc, getDoc, getDocs, query, Timestamp, updateDoc, where } from 'firebase/firestore'; +import { getDevFirebase } from './devFirebase'; +import { getAuth, signInWithEmailAndPassword } from 'firebase/auth'; async function getUserId(user, adminFirestore) { console.log('Grabbing userId for user', user); @@ -47,7 +49,14 @@ export async function deleteTestRuns(user, adminFirestore, assessmentFirestore) }); } +export async function signInAsSuperAdmin(firebaseAuth) { + const auth = getAuth(firebaseAuth); + await signInWithEmailAndPassword(auth, 'testsuperadmin1@roar-auth.com', '!roartestsuperadmin1'); +} + export const getOpenAdministrations = async (db) => { + const auth = getDevFirebase('admin').auth; + await signInAsSuperAdmin(auth); const currentTime = Timestamp.now(); const admins = []; const administrationsRef = collection(db, 'administrations'); @@ -56,7 +65,8 @@ export const getOpenAdministrations = async (db) => { const querySnapshot = await getDocs(q); for (const snapShot of querySnapshot.docs) { - admins.push(snapShot.id); + admins.push(snapShot.data().name); } + return admins; }; From 112ed9fc8b1541e18645c060d6c9740e12eb0e8d Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 30 Apr 2024 15:01:27 -0700 Subject: [PATCH 05/34] add playFluency-CALF to test suite. --- cypress/e2e/participant/default-tests/playFluency-CALF.cy.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js index 3ee713300..6a61766f8 100644 --- a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js @@ -2,7 +2,6 @@ import { playFluencyCALF } from '../../../support/helper-functions/roam-fluency/ describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - // playFluencyCALF(); - cy.log('This test is skipped because the game is not yet available for testing.'); + playFluencyCALF(); }); }); From 27ab921a8c50120e74815037ee25137534b209de Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 30 Apr 2024 15:07:42 -0700 Subject: [PATCH 06/34] Reduce number of testing containers for pre-release tests --- .github/workflows/firebase-hosting-production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firebase-hosting-production.yml b/.github/workflows/firebase-hosting-production.yml index 86973c848..4f0ff8d0a 100644 --- a/.github/workflows/firebase-hosting-production.yml +++ b/.github/workflows/firebase-hosting-production.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: browser: [chromium, edge] - containers: [1, 2, 3, 4] + containers: [1, 2] env: NODE_ENV: 'test' CYPRESS_BASE_URL: 'http://localhost:5173' From cd64c97e21accb1b6f0583aff7e20ee71a1958aa Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 1 May 2024 12:44:37 -0700 Subject: [PATCH 07/34] update timeouts --- .../helper-functions/roar-letter/letterHelpers.js | 2 +- .../support/helper-functions/roar-pa/paHelpers.js | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index 5054dd1a2..949aeb29a 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 3 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index d801c25e8..2c30f7866 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -69,14 +69,12 @@ function playIntro(startText) { handleFullScreenError(); - cy.get('div', { timeout: timeout }).contains(startText, { timeout: timeout }).should('be.visible'); - cy.get('.continue', { timeout: timeout }).should('be.visible').click(); - - // clicks through first introduction pages - // eslint-disable-next-line no-plusplus - // for (let i = 0; i < 2; i++) { - // cy.get(".continue", { timeout: timeout }).should('be.visible').click(); - // } + cy.get('div', { timeout: timeout }) + .contains(startText, { timeout: 2 * timeout }) + .should('be.visible'); + cy.get('.continue', { timeout: 2 * timeout }) + .should('be.visible') + .click(); } function playFirstTutorial() { From 3c31c38e04689325e0178b34a773eeaa7d4d809d Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 1 May 2024 14:14:06 -0700 Subject: [PATCH 08/34] update list of games --- .../testOpenAdministrations.cy.js | 70 ++++++++++++------- 1 file changed, 46 insertions(+), 24 deletions(-) diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index 6d74bcf01..aba2a095d 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -16,59 +16,80 @@ const testSpecs = [ { name: 'ROAR - Picture Vocabulary', spec: playVocabulary, + language: 'en', }, { name: 'ROAR - Written Vocabulary', spec: playWrittenVocabulary, + language: 'en', }, { name: 'ROAR - Letter', spec: playLetter, + language: 'en', + }, + { + name: 'ROAR - Letra', + spec: playLetter, + language: 'es', }, { name: 'ROAR - Morphology', spec: playMorphology, + language: 'en', }, { name: 'ROAR - Phoneme', spec: playPA, + language: 'en', + }, + { + name: 'ROAR - Fonema', + spec: playPA, + language: 'es', }, { name: 'ROAR - Sentence', spec: playSRE, + language: 'en', + }, + { + name: 'ROAR - Frase', + spec: playSRE, + language: 'es', }, { name: 'ROAR - Word', spec: playSWR, + language: 'en', + }, + { + name: 'ROAR - Palabra', + spec: playSWR, + language: 'es', }, { name: 'ROAM - Single Digit', spec: playFluencyARF, + language: 'en', + }, + { + name: 'ROAM - Un Dígito', + spec: playFluencyARF, + language: 'es', }, { name: 'ROAM - Multi Digit', spec: playFluencyCALF, + language: 'en', + }, + { + name: 'ROAM - Varios Dígitos', + spec: playFluencyCALF, + language: 'es', }, ]; -function retryTest(testFunc, retries = 3) { - let attempts = 0; - const run = () => { - attempts++; - try { - testFunc(); - } catch (error) { - if (attempts < retries) { - cy.log(`Test failed, retrying... (${attempts}/${retries})`); - run(); - } else { - throw error; - } - } - }; - run(); -} - async function getOpenAdmins() { const adminFirestore = getDevFirebase('admin').db; const openAdmins = await getOpenAdministrations(adminFirestore); @@ -82,10 +103,9 @@ function checkOptionalGame(spec, admin, text) { cy.switchToOptionalAssessments(); if (text.includes(spec.name)) { cy.log(`Initializing test for optional game: ${spec.name}`); - retryTest(() => { - spec.spec({ - administration: admin, - }); + spec.spec({ + administration: admin, + language: spec.language, }); } else { cy.log('No optional game found for game:', spec.name); @@ -100,11 +120,13 @@ function testGame(spec, admin) { cy.get('.p-tabview') .invoke('text') .then((text) => { + cy.wait(0.1 * timeout); if (text.includes(spec.name)) { - cy.log(`Initializing test for game: ${spec.name}`); - retryTest(() => { + it(`Tests ${spec.name}`, () => { + cy.log(`Initializing test for game: ${spec.name}`); spec.spec({ administration: admin, + language: spec.language, }); }); } else { From 02aff3b819a318171fcf014579242e784c876a8a Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 1 May 2024 14:47:50 -0700 Subject: [PATCH 09/34] remove retry function --- .../testOpenAdministrations.cy.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index aba2a095d..67b894534 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -103,6 +103,7 @@ function checkOptionalGame(spec, admin, text) { cy.switchToOptionalAssessments(); if (text.includes(spec.name)) { cy.log(`Initializing test for optional game: ${spec.name}`); + spec.spec({ administration: admin, language: spec.language, @@ -117,17 +118,16 @@ function checkOptionalGame(spec, admin, text) { } function testGame(spec, admin) { + cy.wait(0.1 * timeout); cy.get('.p-tabview') .invoke('text') .then((text) => { - cy.wait(0.1 * timeout); if (text.includes(spec.name)) { - it(`Tests ${spec.name}`, () => { - cy.log(`Initializing test for game: ${spec.name}`); - spec.spec({ - administration: admin, - language: spec.language, - }); + cy.log(`Initializing test for game: ${spec.name}`); + + spec.spec({ + administration: admin, + language: spec.language, }); } else { checkOptionalGame(spec, admin, text); From 83e8586ab16856cfd0addab2881d4cc21931ff88 Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 9 May 2024 14:18:15 -0700 Subject: [PATCH 10/34] increase initial load timeout to 10 minutes to test load times --- .../support/helper-functions/roam-fluency/fluencyHelpers.js | 2 +- cypress/support/helper-functions/roar-letter/letterHelpers.js | 2 +- .../helper-functions/roar-multichoice/multichoiceHelpers.js | 2 +- cypress/support/helper-functions/roar-pa/paHelpers.js | 4 ++-- cypress/support/helper-functions/roar-sre/sreHelpers.js | 2 +- cypress/support/helper-functions/roar-swr/swrHelpers.js | 2 +- cypress/support/helper-functions/roar-vocab/vocabHelpers.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js index 301ae325e..6124c4800 100644 --- a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js +++ b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js @@ -207,7 +207,7 @@ export function playFluencyCALF({ cy.visit(`/game/${task}`); // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index 949aeb29a..69e68586b 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js index d1a95c56a..e58dbe2a9 100644 --- a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js +++ b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional, task) { checkGameTab(language, task); cy.visit(languageOptions[language][task].url); - cy.get('.jspsych-btn', { timeout: 3 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index 2c30f7866..cbd62d2af 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -55,11 +55,11 @@ const playTrial = (targetText) => { }; function playIntro(startText) { - cy.get('.instructionCanvasNS', { timeout: 6 * timeout }) + cy.get('.instructionCanvasNS', { timeout: 60 * timeout }) .should('be.visible') .click(); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-sre/sreHelpers.js b/cypress/support/helper-functions/roar-sre/sreHelpers.js index fd5c4c6ef..949c2cfd8 100644 --- a/cypress/support/helper-functions/roar-sre/sreHelpers.js +++ b/cypress/support/helper-functions/roar-sre/sreHelpers.js @@ -24,7 +24,7 @@ export const playSRE = ({ .should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-swr/swrHelpers.js b/cypress/support/helper-functions/roar-swr/swrHelpers.js index 1206ef8d6..01f5217b0 100644 --- a/cypress/support/helper-functions/roar-swr/swrHelpers.js +++ b/cypress/support/helper-functions/roar-swr/swrHelpers.js @@ -20,7 +20,7 @@ export const playSWR = ({ cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language].gameTab).should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js index e63ba85bc..35036922e 100644 --- a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js +++ b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js @@ -53,7 +53,7 @@ function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 60 * timeout }) .should('be.visible') .click(); From 9b81cf348df12f32a830695d030725606b13679d Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 13 May 2024 13:34:56 -0700 Subject: [PATCH 11/34] split deployment and cypress testing workflow into separate workflows --- .../workflows/cypress-participant-tests.yml | 34 +++++++++ .../workflows/cypress-partner-admin-tests.yml | 34 +++++++++ .../deploy-firebase-test-cypress.yml | 73 ------------------- .../workflows/firebase-hosting-preview.yml | 32 ++++++++ 4 files changed, 100 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/cypress-participant-tests.yml create mode 100644 .github/workflows/cypress-partner-admin-tests.yml delete mode 100644 .github/workflows/deploy-firebase-test-cypress.yml create mode 100644 .github/workflows/firebase-hosting-preview.yml diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml new file mode 100644 index 000000000..fed1d4cc7 --- /dev/null +++ b/.github/workflows/cypress-participant-tests.yml @@ -0,0 +1,34 @@ +name: Run Cypress Participant Tests +on: + workflow_run: + workflows: ['Build and Deploy'] + types: + - completed + +jobs: + cypress-run: + name: Run Cypress Participant Tests + runs-on: ubuntu-latest + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + browser: [chromium, edge] + containers: [1, 2, 3, 4] + env: + # ... keep the existing environment variables here ... + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + browser: ${{ matrix.browser }} + build: npm ci && npm run build + start: npm run dev + wait-on: ${{ env.CYPRESS_BASE_URL }} + wait-on-timeout: 120 + record: true + parallel: true + spec: 'cypress/e2e/participant/default-tests/**/*' + ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml new file mode 100644 index 000000000..9fa9eca1c --- /dev/null +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -0,0 +1,34 @@ +name: Run Cypress Partner Admin Tests +on: + workflow_run: + workflows: ['Build and Deploy'] + types: + - completed + +jobs: + cypress-run: + name: Run Cypress Partner Admin Tests + runs-on: ubuntu-latest + timeout-minutes: 90 + strategy: + fail-fast: false + matrix: + browser: [chromium, edge] + containers: [1, 2] + env: + # ... keep the existing environment variables here ... + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Cypress run + uses: cypress-io/github-action@v6 + with: + browser: ${{ matrix.browser }} + build: npm ci && npm run build + start: npm run dev + wait-on: ${{ env.CYPRESS_BASE_URL }} + wait-on-timeout: 120 + record: true + parallel: true + spec: 'cypress/e2e/partner-admin/default-tests/**/*' + ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} diff --git a/.github/workflows/deploy-firebase-test-cypress.yml b/.github/workflows/deploy-firebase-test-cypress.yml deleted file mode 100644 index 1e27cb44d..000000000 --- a/.github/workflows/deploy-firebase-test-cypress.yml +++ /dev/null @@ -1,73 +0,0 @@ -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: - name: Deploy 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/*' - - name: 'vite build' - 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: - name: Run Cypress Tests - needs: [build-and-preview] - runs-on: ubuntu-latest - timeout-minutes: 90 - strategy: - fail-fast: false - matrix: - browser: [chromium, edge] - containers: [1, 2, 3, 4] - env: - NODE_OPTIONS: '--max_old_space_size=8192' - NODE_ENV: 'test' - CYPRESS_BASE_URL: 'http://localhost:5173' - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - COMMIT_INFO_MESSAGE: Tests for PR ${{ github.event.number }} "${{ github.event.pull_request.title }}" from commit "${{ github.event.pull_request.head.sha }}" - COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }} - 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 }} - PARTICIPANT_EMAIL: ${{ secrets.PARTICIPANT_EMAIL }} - PARTICIPANT_EMAIL_PASSWORD: ${{ secrets.PARTICIPANT_EMAIL_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: npm ci && npm run build - start: npm run dev - wait-on: ${{ env.CYPRESS_BASE_URL }} - wait-on-timeout: 120 - record: true - parallel: true - spec: 'cypress/e2e/participant/default-tests/**/*,cypress/e2e/partner-admin/default-tests/**/*' - ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} diff --git a/.github/workflows/firebase-hosting-preview.yml b/.github/workflows/firebase-hosting-preview.yml new file mode 100644 index 000000000..c31ffb58d --- /dev/null +++ b/.github/workflows/firebase-hosting-preview.yml @@ -0,0 +1,32 @@ +name: Build and Deploy +on: + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ci-preview-tests-${{ github.ref }}-1 + cancel-in-progress: true + +jobs: + build-and-preview: + name: Deploy 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/*' + - name: 'vite build' + 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] }} From 0794dce7878a4ee35d59c18e8dbfa57f1f3e95be Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 13 May 2024 13:38:09 -0700 Subject: [PATCH 12/34] add env back into workflow files --- .github/workflows/cypress-participant-tests.yml | 15 ++++++++++++++- .github/workflows/cypress-partner-admin-tests.yml | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index fed1d4cc7..8204066c6 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -16,7 +16,20 @@ jobs: browser: [chromium, edge] containers: [1, 2, 3, 4] env: - # ... keep the existing environment variables here ... + NODE_OPTIONS: '--max_old_space_size=8192' + NODE_ENV: 'test' + CYPRESS_BASE_URL: 'http://localhost:5173' + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + COMMIT_INFO_MESSAGE: Tests for PR ${{ github.event.number }} "${{ github.event.pull_request.title }}" from commit "${{ github.event.pull_request.head.sha }}" + COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }} + 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 }} + PARTICIPANT_EMAIL: ${{ secrets.PARTICIPANT_EMAIL }} + PARTICIPANT_EMAIL_PASSWORD: ${{ secrets.PARTICIPANT_EMAIL_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index 9fa9eca1c..628b08e2a 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -16,7 +16,20 @@ jobs: browser: [chromium, edge] containers: [1, 2] env: - # ... keep the existing environment variables here ... + NODE_OPTIONS: '--max_old_space_size=8192' + NODE_ENV: 'test' + CYPRESS_BASE_URL: 'http://localhost:5173' + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + COMMIT_INFO_MESSAGE: Tests for PR ${{ github.event.number }} "${{ github.event.pull_request.title }}" from commit "${{ github.event.pull_request.head.sha }}" + COMMIT_INFO_SHA: ${{ github.event.pull_request.head.sha }} + 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 }} + PARTICIPANT_EMAIL: ${{ secrets.PARTICIPANT_EMAIL }} + PARTICIPANT_EMAIL_PASSWORD: ${{ secrets.PARTICIPANT_EMAIL_PASSWORD }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Checkout uses: actions/checkout@v4 From 60b56e2ddf3834b683ac134782450c8ad7364b9f Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 13 May 2024 14:32:07 -0700 Subject: [PATCH 13/34] add isCurrentVersion Cypress task --- cypress.config.js | 15 +++++++++++++++ .../e2e/participant/default-tests/playSRE.cy.js | 10 +++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/cypress.config.js b/cypress.config.js index 8ac0452e0..df825cd7a 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -14,6 +14,21 @@ module.exports = defineConfig({ console.log(message); return null; }, + isCurrentVersion() { + const { execSync } = require('child_process'); + const fs = require('fs'); + + // Get the version number from the package.json in the main branch + const mainPackageJson = execSync('git show origin/main:package.json', { encoding: 'utf-8' }); + const mainVersion = JSON.parse(mainPackageJson).version; + + // Get the version number from the current package.json + const currentPackageJson = fs.readFileSync('./package.json', 'utf-8'); + const currentVersion = JSON.parse(currentPackageJson).version; + + // Compare the version numbers + return currentVersion === mainVersion; + }, }); }, }, diff --git a/cypress/e2e/participant/default-tests/playSRE.cy.js b/cypress/e2e/participant/default-tests/playSRE.cy.js index 47309f05f..37c63558d 100644 --- a/cypress/e2e/participant/default-tests/playSRE.cy.js +++ b/cypress/e2e/participant/default-tests/playSRE.cy.js @@ -1,7 +1,15 @@ import { playSRE } from '../../../support/helper-functions/roar-sre/sreHelpers'; +const administration = Cypress.env('testRoarAppsAdministration'); +const language = 'en'; + describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - playSRE(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playSRE(administration, language); + } }); }); From de849299f2f270bd50d8dff80a3ed74bf70cc7e5 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 10:44:42 -0700 Subject: [PATCH 14/34] use github api to fetch package json for main branch, use reponse to compare to feature branch package json --- .../workflows/firebase-hosting-production.yml | 68 +++++++++---------- cypress.config.js | 15 ---- .../participant/default-tests/playCVA.cy.js | 7 +- .../default-tests/playFluency-ARF.cy.js | 7 +- .../default-tests/playFluency-CALF.cy.js | 7 +- .../default-tests/playLetter.cy.js | 7 +- .../default-tests/playMorphology.cy.js | 7 +- .../default-tests/playOptionalGames.cy.js | 1 + .../participant/default-tests/playPA.cy.js | 21 ++---- .../participant/default-tests/playSRE.cy.js | 18 ++--- .../participant/default-tests/playSWR.cy.js | 10 +-- .../participant/default-tests/playVocab.cy.js | 7 +- cypress/fixtures/optionalGamesList.js | 2 + cypress/support/utils.js | 29 ++++++++ 14 files changed, 124 insertions(+), 82 deletions(-) diff --git a/.github/workflows/firebase-hosting-production.yml b/.github/workflows/firebase-hosting-production.yml index 4f0ff8d0a..bcea1d8bb 100644 --- a/.github/workflows/firebase-hosting-production.yml +++ b/.github/workflows/firebase-hosting-production.yml @@ -9,40 +9,40 @@ name: Deploy to Firebase Hosting (production) with Pre-Release Tests - 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+' - 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+' jobs: - pre-release-tests: - name: Run Cypress Pre-Release Tests - needs: [build-and-preview] - runs-on: ubuntu-latest - timeout-minutes: 180 - strategy: - fail-fast: false - matrix: - browser: [chromium, edge] - containers: [1, 2] - env: - NODE_ENV: 'test' - CYPRESS_BASE_URL: 'http://localhost:5173' - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - COMMIT_INFO_MESSAGE: Pre release tests for ROAR Dashboard release ${{ github.event.release.tag_name }} "${{ github.event.release.name }}" - COMMIT_INFO_SHA: ${{ github.event.release.release_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: npm ci && npm run build - start: npm run dev - wait-on: ${{ env.CYPRESS_BASE_URL }} - wait-on-timeout: 120 - record: true - parallel: true - spec: 'cypress/e2e/pre-release-tests/**/*' - ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} + # pre-release-tests: + # name: Run Cypress Pre-Release Tests + # needs: [build-and-preview] + # runs-on: ubuntu-latest + # timeout-minutes: 180 + # strategy: + # fail-fast: false + # matrix: + # browser: [chromium, edge] + # containers: [1, 2] + # env: + # NODE_ENV: 'test' + # CYPRESS_BASE_URL: 'http://localhost:5173' + # CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + # COMMIT_INFO_MESSAGE: Pre release tests for ROAR Dashboard release ${{ github.event.release.tag_name }} "${{ github.event.release.name }}" + # COMMIT_INFO_SHA: ${{ github.event.release.release_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: npm ci && npm run build + # start: npm run dev + # wait-on: ${{ env.CYPRESS_BASE_URL }} + # wait-on-timeout: 120 + # record: true + # parallel: true + # spec: 'cypress/e2e/pre-release-tests/**/*' + # ci-build-id: ${{ github.run_id }}-${{ matrix.browser }} build-and-deploy: name: Deploy to Firebase Production Hosting Channel diff --git a/cypress.config.js b/cypress.config.js index df825cd7a..8ac0452e0 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -14,21 +14,6 @@ module.exports = defineConfig({ console.log(message); return null; }, - isCurrentVersion() { - const { execSync } = require('child_process'); - const fs = require('fs'); - - // Get the version number from the package.json in the main branch - const mainPackageJson = execSync('git show origin/main:package.json', { encoding: 'utf-8' }); - const mainVersion = JSON.parse(mainPackageJson).version; - - // Get the version number from the current package.json - const currentPackageJson = fs.readFileSync('./package.json', 'utf-8'); - const currentVersion = JSON.parse(currentPackageJson).version; - - // Compare the version numbers - return currentVersion === mainVersion; - }, }); }, }, diff --git a/cypress/e2e/participant/default-tests/playCVA.cy.js b/cypress/e2e/participant/default-tests/playCVA.cy.js index 90da7951e..7bff57bfb 100644 --- a/cypress/e2e/participant/default-tests/playCVA.cy.js +++ b/cypress/e2e/participant/default-tests/playCVA.cy.js @@ -2,6 +2,11 @@ import { playWrittenVocabulary } from '../../../support/helper-functions/roar-mu describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - playWrittenVocabulary(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playWrittenVocabulary(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js index 4369c4fdb..da0c50881 100644 --- a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js @@ -2,6 +2,11 @@ import { playFluencyARF } from '../../../support/helper-functions/roam-fluency/f describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - playFluencyARF(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playFluencyARF(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js index 6a61766f8..91943a770 100644 --- a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js @@ -2,6 +2,11 @@ import { playFluencyCALF } from '../../../support/helper-functions/roam-fluency/ describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - playFluencyCALF(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playFluencyCALF(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playLetter.cy.js b/cypress/e2e/participant/default-tests/playLetter.cy.js index 2f1dec478..96f68ee3f 100644 --- a/cypress/e2e/participant/default-tests/playLetter.cy.js +++ b/cypress/e2e/participant/default-tests/playLetter.cy.js @@ -2,6 +2,11 @@ import { playLetter } from '../../../support/helper-functions/roar-letter/letter describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - playLetter(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playLetter(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playMorphology.cy.js b/cypress/e2e/participant/default-tests/playMorphology.cy.js index 902009559..87298e4ca 100644 --- a/cypress/e2e/participant/default-tests/playMorphology.cy.js +++ b/cypress/e2e/participant/default-tests/playMorphology.cy.js @@ -2,6 +2,11 @@ import { playMorphology } from '../../../support/helper-functions/roar-multichoi describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - playMorphology(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playMorphology(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js index 57149bce0..647649d50 100644 --- a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js +++ b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js @@ -1,4 +1,5 @@ import { optionalGames } from '../../../fixtures/optionalGamesList'; +import { isCurrentVersion } from '../../../support/utils'; const administration = Cypress.env('testOptionalRoarAppsAdministration'); const language = 'en'; diff --git a/cypress/e2e/participant/default-tests/playPA.cy.js b/cypress/e2e/participant/default-tests/playPA.cy.js index 4a4c9960b..faced16ca 100644 --- a/cypress/e2e/participant/default-tests/playPA.cy.js +++ b/cypress/e2e/participant/default-tests/playPA.cy.js @@ -1,21 +1,12 @@ import { playPA } from '../../../support/helper-functions/roar-pa/paHelpers'; -// const timeout = Cypress.env('timeout'); -// const startText = 'In this game we are going to look for words that BEGIN with the same sound.'; -// const endBlockText = { -// endText1: 'Take a break if needed', -// endText2: 'I have been swimming so much', -// endText3: 'You have helped me and all my friends!', -// }; -// const breakBlockText = 'Take a break if needed'; -// const breakBlockText2 = { -// break1: 'Great job', -// break2: 'Look at all those carrots', -// break3: 'You are doing great', -// }; - describe('Testing playthrough of ROAR-Phoneme as a participant', () => { it(`ROAR-Phoneme Playthrough Test`, () => { - playPA(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playPA(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playSRE.cy.js b/cypress/e2e/participant/default-tests/playSRE.cy.js index 37c63558d..4e43ce9ef 100644 --- a/cypress/e2e/participant/default-tests/playSRE.cy.js +++ b/cypress/e2e/participant/default-tests/playSRE.cy.js @@ -1,15 +1,17 @@ import { playSRE } from '../../../support/helper-functions/roar-sre/sreHelpers'; +import { isCurrentVersion } from '../../../support/utils'; -const administration = Cypress.env('testRoarAppsAdministration'); -const language = 'en'; +const app = '@bdelab/roar-sre'; describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playSRE(administration, language); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSRE(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playSWR.cy.js b/cypress/e2e/participant/default-tests/playSWR.cy.js index fb0ffe893..6c42bfbd9 100644 --- a/cypress/e2e/participant/default-tests/playSWR.cy.js +++ b/cypress/e2e/participant/default-tests/playSWR.cy.js @@ -1,10 +1,12 @@ import { playSWR } from '../../../support/helper-functions/roar-swr/swrHelpers.js'; -const administration = Cypress.env('testRoarAppsAdministration'); -const language = 'en'; - describe('ROAR - Word Play Through', () => { it('Plays Word', () => { - playSWR(administration, language); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playSWR(); + } }); }); diff --git a/cypress/e2e/participant/default-tests/playVocab.cy.js b/cypress/e2e/participant/default-tests/playVocab.cy.js index 9cccd5682..a2556541c 100644 --- a/cypress/e2e/participant/default-tests/playVocab.cy.js +++ b/cypress/e2e/participant/default-tests/playVocab.cy.js @@ -2,6 +2,11 @@ import { playVocabulary } from '../../../support/helper-functions/roar-vocab/voc describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - playVocabulary(); + if (cy.task('isCurrentVersion')) { + cy.log('Detected most recent version of the app; skipping test.'); + } else { + cy.log('Detected new version of the app; running test.'); + playVocabulary(); + } }); }); diff --git a/cypress/fixtures/optionalGamesList.js b/cypress/fixtures/optionalGamesList.js index 1e6d127e9..3ba5f71e7 100644 --- a/cypress/fixtures/optionalGamesList.js +++ b/cypress/fixtures/optionalGamesList.js @@ -11,9 +11,11 @@ export const optionalGames = [ { name: 'ROAR - Sentence', testSpec: playSRE, + app: '@bdelab/roar-sre', }, { name: 'ROAR - Word', testSpec: playSWR, + app: '@bdelab/roar-swr', }, ]; diff --git a/cypress/support/utils.js b/cypress/support/utils.js index a4967ab8c..717f93e8b 100644 --- a/cypress/support/utils.js +++ b/cypress/support/utils.js @@ -1,3 +1,32 @@ +import axios from 'axios'; + export const randomizeName = (orgName) => { return `${orgName}` + ' ' + `${Math.floor(1000000000 + Math.random() * 9000000000)}`; }; + +export const isCurrentVersion = async (app) => { + // This function checks if the feature package.json version is the same as the main package.json version + // It returns a true or false value based on the comparison + const featurePackageJson = require('../../package.json'); + const featureDependencies = featurePackageJson.dependencies; + + const owner = 'yeatmanlab'; // Your GitHub username + const repository = 'roar-dashboard'; // Your repository name + const filePath = 'package.json'; // Path to the file in the repository + const branch = 'main'; // Branch to fetch from + + const url = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`; + + const response = await axios.get(url); + + const mainPackageJson = JSON.parse(atob(response.data.content), 'utf-8'); + const mainDependencies = mainPackageJson.dependencies; + + // Slice the carat ^ from the version number + const mainAppVersion = mainDependencies[app].slice(1); + const currentAppVersion = featureDependencies[app].slice(1); + console.log('main', mainAppVersion); + console.log('feature', currentAppVersion); + + return mainAppVersion === currentAppVersion; +}; From d5f5ebba8acd4c0e89dc7c52b3daa17ea3a616fb Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 11:37:03 -0700 Subject: [PATCH 15/34] add isCurrentVersion check to each game spec --- .../es-tests/playFluency-ARF-ES.cy.js | 20 ++++++++++++----- .../es-tests/playFluency-CALF-ES.cy.js | 22 ++++++++++++++----- .../es-tests/playLetter-ES.cy.js | 18 +++++++++++---- .../es-tests/playSentence-ES.cy.js | 15 ++++++++++++- .../default-tests/es-tests/playWord-ES.cy.js | 15 ++++++++++++- .../participant/default-tests/playCVA.cy.js | 21 +++++++++++------- .../default-tests/playFluency-ARF.cy.js | 17 +++++++++----- .../default-tests/playFluency-CALF.cy.js | 17 +++++++++----- .../default-tests/playLetter.cy.js | 17 +++++++++----- .../default-tests/playMorphology.cy.js | 17 +++++++++----- .../default-tests/playOptionalGames.cy.js | 7 +++++- .../participant/default-tests/playPA.cy.js | 17 +++++++++----- .../participant/default-tests/playSWR.cy.js | 17 +++++++++----- .../participant/default-tests/playVocab.cy.js | 16 +++++++++----- .../roam-fluency/playFluency-ARF-3G.cy.js | 12 +++++++++- .../playFluency-ARF-HighLatency.cy.js | 11 +++++++++- .../network-tests/roar-swr/playSWR-2G.cy.js | 11 +++++++++- .../network-tests/roar-swr/playSWR-3G.cy.js | 13 +++++++++-- .../roar-swr/playSWR-HighLatency.cy.js | 13 +++++++++-- .../testOpenAdministrations.cy.js | 15 +++++++++++++ 20 files changed, 236 insertions(+), 75 deletions(-) diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js index d8d20059e..bac09a6e5 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js @@ -1,17 +1,27 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testSpanishRoarAppsAdministration'); const language = 'es'; const task = 'fluency-arf-es'; const endText = 'Has terminado.'; +const app = '@bdelab/roam-fluency'; + describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - playFluencyARF({ - administration: administration, - language: language, - task: task, - endText: endText, + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyARF({ + administration: administration, + language: language, + task: task, + endText: endText, + }); + } }); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js index 6bab4e184..b930d3690 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js @@ -1,4 +1,5 @@ import { playFluencyCALF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testSpanishRoarAppsAdministration'); const language = 'es'; @@ -6,14 +7,23 @@ const task = 'fluency-calf-es'; const endText = 'Has terminado.'; const continueText = 'continuar'; +const app = '@bdelab/roam-fluency'; + describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - playFluencyCALF({ - administration: administration, - language: language, - task: task, - endText: endText, - continueText: continueText, + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyCALF({ + administration: administration, + language: language, + task: task, + endText: endText, + continueText: continueText, + }); + } }); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js index f31690226..4b2cd45b8 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js @@ -1,15 +1,25 @@ import { playLetter } from '../../../../support/helper-functions/roar-letter/letterHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testSpanishRoarAppsAdministration'); const language = 'es'; const gameCompleteText = '¡Has terminado! ¡Gracias por ayudarme a encontrar esas letras!'; +const app = '@bdelab/roar-letter'; + describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - playLetter({ - administration: administration, - language: language, - gameCompleteText: gameCompleteText, + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playLetter({ + administration: administration, + language: language, + gameCompleteText: gameCompleteText, + }); + } }); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js index 8fdc17102..c326cd37f 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js @@ -1,10 +1,23 @@ import { playSRE } from '../../../../support/helper-functions/roar-sre/sreHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testSpanishRoarAppsAdministration'); const language = 'es'; +const app = '@bdelab/roar-sre'; + describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - playSRE(administration, language); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSRE({ + administration: administration, + language: language, + }); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js index 18ac0b656..edaa172f7 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js @@ -1,10 +1,23 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testSpanishRoarAppsAdministration'); const language = 'es'; +const app = '@bdelab/roar-swr'; + describe('ROAR - Palabra Play Through', () => { it('Plays Word', () => { - playSWR(administration, language); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSWR({ + administration: administration, + language: language, + }); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playCVA.cy.js b/cypress/e2e/participant/default-tests/playCVA.cy.js index 7bff57bfb..5e51d7c2f 100644 --- a/cypress/e2e/participant/default-tests/playCVA.cy.js +++ b/cypress/e2e/participant/default-tests/playCVA.cy.js @@ -1,12 +1,17 @@ import { playWrittenVocabulary } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers'; +import { isCurrentVersion } from '../../../support/utils'; -describe('ROAR - Written Vocabulary Play Through', () => { - it('Plays Written Vocabulary', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playWrittenVocabulary(); - } +const app = '@bdelab/roar-multichoice'; + +describe('ROAR - Written Vocabulary Playthrough', () => { + it('Plays CVA', () => { + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playWrittenVocabulary(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js index da0c50881..9b2a93051 100644 --- a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js @@ -1,12 +1,17 @@ import { playFluencyARF } from '../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playFluencyARF(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyARF(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js index 91943a770..b6d135c16 100644 --- a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js @@ -1,12 +1,17 @@ import { playFluencyCALF } from '../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playFluencyCALF(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyCALF(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playLetter.cy.js b/cypress/e2e/participant/default-tests/playLetter.cy.js index 96f68ee3f..60806f02f 100644 --- a/cypress/e2e/participant/default-tests/playLetter.cy.js +++ b/cypress/e2e/participant/default-tests/playLetter.cy.js @@ -1,12 +1,17 @@ import { playLetter } from '../../../support/helper-functions/roar-letter/letterHelpers'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roar-letter'; describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playLetter(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playLetter(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playMorphology.cy.js b/cypress/e2e/participant/default-tests/playMorphology.cy.js index 87298e4ca..4f7a6811b 100644 --- a/cypress/e2e/participant/default-tests/playMorphology.cy.js +++ b/cypress/e2e/participant/default-tests/playMorphology.cy.js @@ -1,12 +1,17 @@ import { playMorphology } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roar-multichoice'; describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playMorphology(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playMorphology(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js index 647649d50..ed18509dc 100644 --- a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js +++ b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js @@ -11,7 +11,12 @@ function playOptionalGame(game, administration, language, optional) { describe('Play Optional Games', () => { optionalGames.forEach((game) => { it(`Plays ${game.name}`, () => { - playOptionalGame(game, administration, language, true); + if (isCurrentVersion(game.app) === true) { + cy.log(`Did not detect a new version of ${game.app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${game.app}, running test.`); + playOptionalGame(game, administration, language, true); + } }); }); }); diff --git a/cypress/e2e/participant/default-tests/playPA.cy.js b/cypress/e2e/participant/default-tests/playPA.cy.js index faced16ca..17c6aa80a 100644 --- a/cypress/e2e/participant/default-tests/playPA.cy.js +++ b/cypress/e2e/participant/default-tests/playPA.cy.js @@ -1,12 +1,17 @@ import { playPA } from '../../../support/helper-functions/roar-pa/paHelpers'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roar-pa'; describe('Testing playthrough of ROAR-Phoneme as a participant', () => { it(`ROAR-Phoneme Playthrough Test`, () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playPA(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playPA(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playSWR.cy.js b/cypress/e2e/participant/default-tests/playSWR.cy.js index 6c42bfbd9..29fa371d9 100644 --- a/cypress/e2e/participant/default-tests/playSWR.cy.js +++ b/cypress/e2e/participant/default-tests/playSWR.cy.js @@ -1,12 +1,17 @@ import { playSWR } from '../../../support/helper-functions/roar-swr/swrHelpers.js'; +import { isCurrentVersion } from '../../../support/utils'; + +const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through', () => { it('Plays Word', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playSWR(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSWR(); + } + }); }); }); diff --git a/cypress/e2e/participant/default-tests/playVocab.cy.js b/cypress/e2e/participant/default-tests/playVocab.cy.js index a2556541c..33ad5d53f 100644 --- a/cypress/e2e/participant/default-tests/playVocab.cy.js +++ b/cypress/e2e/participant/default-tests/playVocab.cy.js @@ -1,12 +1,16 @@ import { playVocabulary } from '../../../support/helper-functions/roar-vocab/vocabHelpers'; +import { isCurrentVersion } from '../../../support/utils'; +const app = '@bdelab/roar-vocab'; describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - if (cy.task('isCurrentVersion')) { - cy.log('Detected most recent version of the app; skipping test.'); - } else { - cy.log('Detected new version of the app; running test.'); - playVocabulary(); - } + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playVocabulary(); + } + }); }); }); diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js index af4754450..d95fb2d0a 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js @@ -1,7 +1,17 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; + +const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant in a simulated 3G network', () => { it('Fluency Playthrough Test', () => { - playFluencyARF(); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyARF(); + } + }); }); }); diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js index 253a8d63b..ac333f21d 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js @@ -1,7 +1,16 @@ import { playFluencyARF } from '../../../../support/helper-functions/roam-fluency/fluencyHelpers'; +import { isCurrentVersion } from '../../../../support/utils'; +const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant in a simulated high latency networkt', () => { it('Fluency Playthrough Test', () => { - playFluencyARF(); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playFluencyARF({ networkProfile: '3g', latency: 500 }); + } + }); }); }); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js index c902447e0..48f677947 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js @@ -1,10 +1,19 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testRoarAppsAdministration'); const language = 'en'; +const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - playSWR(administration, language); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSWR({ administration: administration, language: language }); + } + }); }); }); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js index 4cefd74d1..48f677947 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js @@ -1,10 +1,19 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testRoarAppsAdministration'); const language = 'en'; +const app = '@bdelab/roar-swr'; -describe('ROAR - Word Play Through in a simulated 3G network', () => { +describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - playSWR(administration, language); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSWR({ administration: administration, language: language }); + } + }); }); }); diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js index 016e75554..48f677947 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js @@ -1,10 +1,19 @@ import { playSWR } from '../../../../support/helper-functions/roar-swr/swrHelpers.js'; +import { isCurrentVersion } from '../../../../support/utils'; const administration = Cypress.env('testRoarAppsAdministration'); const language = 'en'; +const app = '@bdelab/roar-swr'; -describe('ROAR - Word Play Through in a simulated high latency network', () => { +describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - playSWR(administration, language); + isCurrentVersion(app).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${app}, running test.`); + playSWR({ administration: administration, language: language }); + } + }); }); }); diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index 67b894534..5433d4152 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -15,76 +15,91 @@ const timeout = Cypress.env('timeout'); const testSpecs = [ { name: 'ROAR - Picture Vocabulary', + app: '@bdelab/roar-vocab', spec: playVocabulary, language: 'en', }, { name: 'ROAR - Written Vocabulary', + app: '@bdelab/roar-multichoice', spec: playWrittenVocabulary, language: 'en', }, { name: 'ROAR - Letter', + app: '@bdelab/roar-letter', spec: playLetter, language: 'en', }, { name: 'ROAR - Letra', + app: '@bdelab/roar-letter', spec: playLetter, language: 'es', }, { name: 'ROAR - Morphology', + app: '@bdelab/roar-multichoice', spec: playMorphology, language: 'en', }, { name: 'ROAR - Phoneme', + app: '@bdelab/roar-pa', spec: playPA, language: 'en', }, { name: 'ROAR - Fonema', + app: '@bdelab/roar-pa', spec: playPA, language: 'es', }, { name: 'ROAR - Sentence', + app: '@bdelab/roar-sre', spec: playSRE, language: 'en', }, { name: 'ROAR - Frase', + app: '@bdelab/roar-sre', spec: playSRE, language: 'es', }, { name: 'ROAR - Word', + app: '@bdelab/roar-swr', spec: playSWR, language: 'en', }, { name: 'ROAR - Palabra', + app: '@bdelab/roar-swr', spec: playSWR, language: 'es', }, { name: 'ROAM - Single Digit', + app: '@bdelab/roam-fluency', spec: playFluencyARF, language: 'en', }, { name: 'ROAM - Un Dígito', + app: '@bdelab/roam-fluency', spec: playFluencyARF, language: 'es', }, { name: 'ROAM - Multi Digit', + app: '@bdelab/roam-fluency', spec: playFluencyCALF, language: 'en', }, { name: 'ROAM - Varios Dígitos', + app: '@bdelab/roam-fluency', spec: playFluencyCALF, language: 'es', }, From a51fb9eba27532fef5fc244bbc171434202dac5b Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 11:40:52 -0700 Subject: [PATCH 16/34] refactor isCurrentVersion function --- cypress/support/utils.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cypress/support/utils.js b/cypress/support/utils.js index 717f93e8b..a4d2d495a 100644 --- a/cypress/support/utils.js +++ b/cypress/support/utils.js @@ -10,23 +10,25 @@ export const isCurrentVersion = async (app) => { const featurePackageJson = require('../../package.json'); const featureDependencies = featurePackageJson.dependencies; - const owner = 'yeatmanlab'; // Your GitHub username - const repository = 'roar-dashboard'; // Your repository name - const filePath = 'package.json'; // Path to the file in the repository - const branch = 'main'; // Branch to fetch from + const owner = 'yeatmanlab'; + const repository = 'roar-dashboard'; + const filePath = 'package.json'; + const branch = 'main'; const url = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`; - const response = await axios.get(url); + try { + const response = await axios.get(url); + const mainPackageJson = JSON.parse(atob(response.data.content), 'utf-8'); + const mainDependencies = mainPackageJson.dependencies; - const mainPackageJson = JSON.parse(atob(response.data.content), 'utf-8'); - const mainDependencies = mainPackageJson.dependencies; + // Slice the version number to remove the caret (^) symbol + const mainAppVersion = mainDependencies[app].slice(1); + const currentAppVersion = featureDependencies[app].slice(1); - // Slice the carat ^ from the version number - const mainAppVersion = mainDependencies[app].slice(1); - const currentAppVersion = featureDependencies[app].slice(1); - console.log('main', mainAppVersion); - console.log('feature', currentAppVersion); - - return mainAppVersion === currentAppVersion; + return mainAppVersion === currentAppVersion; + } catch (error) { + console.error(`Failed to check if ${app} is the current version: ${error}`); + return false; + } }; From bdb75c88df5bb6069760fcd541a139227c743388 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 11:45:28 -0700 Subject: [PATCH 17/34] prepend window object to atob function --- cypress/support/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/utils.js b/cypress/support/utils.js index a4d2d495a..e06eff245 100644 --- a/cypress/support/utils.js +++ b/cypress/support/utils.js @@ -19,7 +19,7 @@ export const isCurrentVersion = async (app) => { try { const response = await axios.get(url); - const mainPackageJson = JSON.parse(atob(response.data.content), 'utf-8'); + const mainPackageJson = JSON.parse(window.atob(response.data.content), 'utf-8'); const mainDependencies = mainPackageJson.dependencies; // Slice the version number to remove the caret (^) symbol From 348e0596576eb2c6e6a438f9202475b8def918da Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 11:58:09 -0700 Subject: [PATCH 18/34] rename gitHub action for deploy preview, adjust workflow dependencies for test workflows. --- .github/workflows/cypress-participant-tests.yml | 2 +- .github/workflows/cypress-partner-admin-tests.yml | 2 +- .github/workflows/firebase-hosting-preview.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index 8204066c6..0f24a3265 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -1,7 +1,7 @@ name: Run Cypress Participant Tests on: workflow_run: - workflows: ['Build and Deploy'] + workflows: ['Deploy Preview'] types: - completed diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index 628b08e2a..c398a5351 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -1,7 +1,7 @@ name: Run Cypress Partner Admin Tests on: workflow_run: - workflows: ['Build and Deploy'] + workflows: ['Deploy Preview'] types: - completed diff --git a/.github/workflows/firebase-hosting-preview.yml b/.github/workflows/firebase-hosting-preview.yml index c31ffb58d..0a8b9d3d5 100644 --- a/.github/workflows/firebase-hosting-preview.yml +++ b/.github/workflows/firebase-hosting-preview.yml @@ -9,7 +9,7 @@ concurrency: jobs: build-and-preview: - name: Deploy preview + name: Deploy Preview if: '${{ github.event.pull_request.head.repo.full_name == github.repository }}' runs-on: ubuntu-latest steps: From d326647d092d8c622d687c84e62690b0d06b3a21 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 12:06:42 -0700 Subject: [PATCH 19/34] change workflow_run dependency --- .github/workflows/cypress-participant-tests.yml | 2 +- .github/workflows/cypress-partner-admin-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index 0f24a3265..09963f033 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -1,7 +1,7 @@ name: Run Cypress Participant Tests on: workflow_run: - workflows: ['Deploy Preview'] + workflows: ['firebase-hosting-preview.yml'] types: - completed diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index c398a5351..cde089817 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -1,7 +1,7 @@ name: Run Cypress Partner Admin Tests on: workflow_run: - workflows: ['Deploy Preview'] + workflows: ['firebase-hosting-preview.yml'] types: - completed From 39ec96bf890cc77ba40d620448dfbb89772f9f90 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 13:03:39 -0700 Subject: [PATCH 20/34] remove workflow dependencies from cypress tests --- .github/workflows/cypress-participant-tests.yml | 10 ++++++---- .github/workflows/cypress-partner-admin-tests.yml | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index 09963f033..c4a9f2946 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -1,9 +1,11 @@ name: Run Cypress Participant Tests on: - workflow_run: - workflows: ['firebase-hosting-preview.yml'] - types: - - completed + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ci-preview-tests-${{ github.ref }}-1 + cancel-in-progress: true jobs: cypress-run: diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index cde089817..7ed83e0f2 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -1,9 +1,11 @@ name: Run Cypress Partner Admin Tests on: - workflow_run: - workflows: ['firebase-hosting-preview.yml'] - types: - - completed + pull_request: + types: [opened, reopened, synchronize] + +concurrency: + group: ci-preview-tests-${{ github.ref }}-1 + cancel-in-progress: true jobs: cypress-run: From 8f5ed186bcab763da2d0f7e5e98630bb1975375a Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 13:05:09 -0700 Subject: [PATCH 21/34] change concurrency groups in github workflows --- .github/workflows/cypress-participant-tests.yml | 2 +- .github/workflows/cypress-partner-admin-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index c4a9f2946..8c1222581 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -4,7 +4,7 @@ on: types: [opened, reopened, synchronize] concurrency: - group: ci-preview-tests-${{ github.ref }}-1 + group: ci-preview-tests-${{ github.ref }}-3 cancel-in-progress: true jobs: diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index 7ed83e0f2..aea727d4e 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -4,7 +4,7 @@ on: types: [opened, reopened, synchronize] concurrency: - group: ci-preview-tests-${{ github.ref }}-1 + group: ci-preview-tests-${{ github.ref }}-2 cancel-in-progress: true jobs: From ae024cb1670ba08b8bf0567010bf6ab87bf131e7 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 13:54:43 -0700 Subject: [PATCH 22/34] remove slice from utils.js, reduce game timeouts to one minute --- .../support/helper-functions/roam-fluency/fluencyHelpers.js | 2 +- .../support/helper-functions/roar-letter/letterHelpers.js | 2 +- .../helper-functions/roar-multichoice/multichoiceHelpers.js | 2 +- cypress/support/helper-functions/roar-pa/paHelpers.js | 4 ++-- cypress/support/helper-functions/roar-sre/sreHelpers.js | 2 +- cypress/support/helper-functions/roar-swr/swrHelpers.js | 2 +- cypress/support/helper-functions/roar-vocab/vocabHelpers.js | 2 +- cypress/support/utils.js | 5 ++--- 8 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js index 6124c4800..301ae325e 100644 --- a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js +++ b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js @@ -207,7 +207,7 @@ export function playFluencyCALF({ cy.visit(`/game/${task}`); // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index 69e68586b..949aeb29a 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js index e58dbe2a9..181c5771e 100644 --- a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js +++ b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional, task) { checkGameTab(language, task); cy.visit(languageOptions[language][task].url); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index cbd62d2af..2c30f7866 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -55,11 +55,11 @@ const playTrial = (targetText) => { }; function playIntro(startText) { - cy.get('.instructionCanvasNS', { timeout: 60 * timeout }) + cy.get('.instructionCanvasNS', { timeout: 6 * timeout }) .should('be.visible') .click(); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-sre/sreHelpers.js b/cypress/support/helper-functions/roar-sre/sreHelpers.js index 949c2cfd8..fd5c4c6ef 100644 --- a/cypress/support/helper-functions/roar-sre/sreHelpers.js +++ b/cypress/support/helper-functions/roar-sre/sreHelpers.js @@ -24,7 +24,7 @@ export const playSRE = ({ .should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-swr/swrHelpers.js b/cypress/support/helper-functions/roar-swr/swrHelpers.js index 01f5217b0..1206ef8d6 100644 --- a/cypress/support/helper-functions/roar-swr/swrHelpers.js +++ b/cypress/support/helper-functions/roar-swr/swrHelpers.js @@ -20,7 +20,7 @@ export const playSWR = ({ cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language].gameTab).should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js index 35036922e..e63ba85bc 100644 --- a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js +++ b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js @@ -53,7 +53,7 @@ function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 60 * timeout }) + cy.get('.jspsych-btn', { timeout: 6 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/utils.js b/cypress/support/utils.js index e06eff245..b70a7af1a 100644 --- a/cypress/support/utils.js +++ b/cypress/support/utils.js @@ -22,9 +22,8 @@ export const isCurrentVersion = async (app) => { const mainPackageJson = JSON.parse(window.atob(response.data.content), 'utf-8'); const mainDependencies = mainPackageJson.dependencies; - // Slice the version number to remove the caret (^) symbol - const mainAppVersion = mainDependencies[app].slice(1); - const currentAppVersion = featureDependencies[app].slice(1); + const mainAppVersion = mainDependencies[app]; + const currentAppVersion = featureDependencies[app]; return mainAppVersion === currentAppVersion; } catch (error) { From b1400c031277b8714f9e08268c2c3873cbbf69f9 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 14:13:03 -0700 Subject: [PATCH 23/34] increase test timeout --- .../support/helper-functions/roam-fluency/fluencyHelpers.js | 2 +- .../support/helper-functions/roar-letter/letterHelpers.js | 2 +- .../helper-functions/roar-multichoice/multichoiceHelpers.js | 2 +- cypress/support/helper-functions/roar-pa/paHelpers.js | 6 +++--- cypress/support/helper-functions/roar-sre/sreHelpers.js | 2 +- cypress/support/helper-functions/roar-swr/swrHelpers.js | 2 +- cypress/support/helper-functions/roar-vocab/vocabHelpers.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js index 301ae325e..0a4670e48 100644 --- a/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js +++ b/cypress/support/helper-functions/roam-fluency/fluencyHelpers.js @@ -207,7 +207,7 @@ export function playFluencyCALF({ cy.visit(`/game/${task}`); // Click jspsych button to begin - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index 949aeb29a..0e4fc1d9f 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js index 181c5771e..af022eb2d 100644 --- a/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js +++ b/cypress/support/helper-functions/roar-multichoice/multichoiceHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional, task) { checkGameTab(language, task); cy.visit(languageOptions[language][task].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-pa/paHelpers.js b/cypress/support/helper-functions/roar-pa/paHelpers.js index 2c30f7866..4dd796244 100644 --- a/cypress/support/helper-functions/roar-pa/paHelpers.js +++ b/cypress/support/helper-functions/roar-pa/paHelpers.js @@ -55,15 +55,15 @@ const playTrial = (targetText) => { }; function playIntro(startText) { - cy.get('.instructionCanvasNS', { timeout: 6 * timeout }) + cy.get('.instructionCanvasNS', { timeout: 12 * timeout }) .should('be.visible') .click(); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); - cy.get('.continue', { timeout: 6 * timeout }) + cy.get('.continue', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-sre/sreHelpers.js b/cypress/support/helper-functions/roar-sre/sreHelpers.js index fd5c4c6ef..614ee863d 100644 --- a/cypress/support/helper-functions/roar-sre/sreHelpers.js +++ b/cypress/support/helper-functions/roar-sre/sreHelpers.js @@ -24,7 +24,7 @@ export const playSRE = ({ .should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-swr/swrHelpers.js b/cypress/support/helper-functions/roar-swr/swrHelpers.js index 1206ef8d6..8bedd5f7a 100644 --- a/cypress/support/helper-functions/roar-swr/swrHelpers.js +++ b/cypress/support/helper-functions/roar-swr/swrHelpers.js @@ -20,7 +20,7 @@ export const playSWR = ({ cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language].gameTab).should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js index e63ba85bc..df889c3d9 100644 --- a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js +++ b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js @@ -53,7 +53,7 @@ function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 6 * timeout }) + cy.get('.jspsych-btn', { timeout: 12 * timeout }) .should('be.visible') .click(); From 813c3e582fca9781a78d2f7afe15f918996d69a8 Mon Sep 17 00:00:00 2001 From: Kyle Date: Tue, 14 May 2024 14:33:31 -0700 Subject: [PATCH 24/34] reduce number of test containers for participant tests --- .github/workflows/cypress-participant-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress-participant-tests.yml b/.github/workflows/cypress-participant-tests.yml index 8c1222581..12b85f993 100644 --- a/.github/workflows/cypress-participant-tests.yml +++ b/.github/workflows/cypress-participant-tests.yml @@ -16,7 +16,7 @@ jobs: fail-fast: false matrix: browser: [chromium, edge] - containers: [1, 2, 3, 4] + containers: [1, 2] env: NODE_OPTIONS: '--max_old_space_size=8192' NODE_ENV: 'test' From 66d0c2e7cd463739aadad45fca4d6c6af6fb15f7 Mon Sep 17 00:00:00 2001 From: lucasxsong Date: Tue, 14 May 2024 11:10:16 -0700 Subject: [PATCH 25/34] comment out vite favicon --- vite.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index 3c65e586c..a56730278 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,7 +12,7 @@ export default defineConfig({ Vue({ include: [/\.vue$/, /\.md$/], }), - vitePluginFaviconsInject('./src/assets/roar-icon.svg'), + // vitePluginFaviconsInject('./src/assets/roar-icon.svg'), ...(process.env.NODE_ENV === 'development' ? [basicSsl()] : []), nodePolyfills({ globals: { From 794edc2cc92a4e5bfd5ba46df4438059be73103e Mon Sep 17 00:00:00 2001 From: lucasxsong Date: Tue, 14 May 2024 11:20:56 -0700 Subject: [PATCH 26/34] update import and add min-width attribute to videoplayer --- vite.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vite.config.js b/vite.config.js index a56730278..3c65e586c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -12,7 +12,7 @@ export default defineConfig({ Vue({ include: [/\.vue$/, /\.md$/], }), - // vitePluginFaviconsInject('./src/assets/roar-icon.svg'), + vitePluginFaviconsInject('./src/assets/roar-icon.svg'), ...(process.env.NODE_ENV === 'development' ? [basicSsl()] : []), nodePolyfills({ globals: { From 608d52e59d5608a87cf7695934f7abceb2441b1f Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 12:53:57 -0700 Subject: [PATCH 27/34] add cy.then() statement in SRE test to wait for test completion. --- cypress/e2e/participant/default-tests/playMorphology.cy.js | 5 +++-- cypress/e2e/participant/default-tests/playSRE.cy.js | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/participant/default-tests/playMorphology.cy.js b/cypress/e2e/participant/default-tests/playMorphology.cy.js index 4f7a6811b..e332d11d5 100644 --- a/cypress/e2e/participant/default-tests/playMorphology.cy.js +++ b/cypress/e2e/participant/default-tests/playMorphology.cy.js @@ -5,8 +5,9 @@ const app = '@bdelab/roar-multichoice'; describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - isCurrentVersion(app).then((isCurrentVersion) => { - if (isCurrentVersion) { + isCurrentVersion(app).then((currentVersion) => { + cy.log(currentVersion); + if (currentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { cy.log(`Detected a new version of ${app}, running test.`); diff --git a/cypress/e2e/participant/default-tests/playSRE.cy.js b/cypress/e2e/participant/default-tests/playSRE.cy.js index 4e43ce9ef..a13e014ee 100644 --- a/cypress/e2e/participant/default-tests/playSRE.cy.js +++ b/cypress/e2e/participant/default-tests/playSRE.cy.js @@ -11,6 +11,9 @@ describe('ROAR - Sentence Play Through', () => { } else { cy.log(`Detected a new version of ${app}, running test.`); playSRE(); + cy.then(() => { + cy.log('SRE test completed.'); + }); } }); }); From b1d92b443459caca961a223c4d66415269649af7 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 13:08:38 -0700 Subject: [PATCH 28/34] wrap isCurrentVersion and call .then() to wait for result --- cypress/e2e/participant/default-tests/playMorphology.cy.js | 5 ++--- cypress/e2e/participant/default-tests/playSRE.cy.js | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/participant/default-tests/playMorphology.cy.js b/cypress/e2e/participant/default-tests/playMorphology.cy.js index e332d11d5..279ee5a45 100644 --- a/cypress/e2e/participant/default-tests/playMorphology.cy.js +++ b/cypress/e2e/participant/default-tests/playMorphology.cy.js @@ -5,9 +5,8 @@ const app = '@bdelab/roar-multichoice'; describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - isCurrentVersion(app).then((currentVersion) => { - cy.log(currentVersion); - if (currentVersion) { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { + if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { cy.log(`Detected a new version of ${app}, running test.`); diff --git a/cypress/e2e/participant/default-tests/playSRE.cy.js b/cypress/e2e/participant/default-tests/playSRE.cy.js index a13e014ee..5cce3aace 100644 --- a/cypress/e2e/participant/default-tests/playSRE.cy.js +++ b/cypress/e2e/participant/default-tests/playSRE.cy.js @@ -5,15 +5,12 @@ const app = '@bdelab/roar-sre'; describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { cy.log(`Detected a new version of ${app}, running test.`); playSRE(); - cy.then(() => { - cy.log('SRE test completed.'); - }); } }); }); From b641322e82b30fefdb9fe05c0e28e434d7d7e5d6 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 13:20:23 -0700 Subject: [PATCH 29/34] wrap isCurrentVersion and call .then() to wait for result for all game tests --- .../participant/default-tests/es-tests/playFluency-ARF-ES.cy.js | 2 +- .../default-tests/es-tests/playFluency-CALF-ES.cy.js | 2 +- .../e2e/participant/default-tests/es-tests/playLetter-ES.cy.js | 2 +- .../participant/default-tests/es-tests/playSentence-ES.cy.js | 2 +- .../e2e/participant/default-tests/es-tests/playWord-ES.cy.js | 2 +- cypress/e2e/participant/default-tests/playCVA.cy.js | 2 +- cypress/e2e/participant/default-tests/playFluency-ARF.cy.js | 2 +- cypress/e2e/participant/default-tests/playFluency-CALF.cy.js | 2 +- cypress/e2e/participant/default-tests/playLetter.cy.js | 2 +- cypress/e2e/participant/default-tests/playPA.cy.js | 2 +- cypress/e2e/participant/default-tests/playSWR.cy.js | 2 +- cypress/e2e/participant/default-tests/playVocab.cy.js | 2 +- .../network-tests/roam-fluency/playFluency-ARF-3G.cy.js | 2 +- .../roam-fluency/playFluency-ARF-HighLatency.cy.js | 2 +- cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js | 2 +- cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js | 2 +- .../network-tests/roar-swr/playSWR-HighLatency.cy.js | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js index bac09a6e5..98165662b 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-ARF-ES.cy.js @@ -10,7 +10,7 @@ const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js index b930d3690..21283b5a8 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playFluency-CALF-ES.cy.js @@ -11,7 +11,7 @@ const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency ARF ES as a participant', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js index 4b2cd45b8..6f847d1a6 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playLetter-ES.cy.js @@ -9,7 +9,7 @@ const app = '@bdelab/roar-letter'; describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js index c326cd37f..f1fe8dc9e 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playSentence-ES.cy.js @@ -8,7 +8,7 @@ const app = '@bdelab/roar-sre'; describe('ROAR - Sentence Play Through', () => { it('Plays SRE', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js b/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js index edaa172f7..35ef69fd4 100644 --- a/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js +++ b/cypress/e2e/participant/default-tests/es-tests/playWord-ES.cy.js @@ -8,7 +8,7 @@ const app = '@bdelab/roar-swr'; describe('ROAR - Palabra Play Through', () => { it('Plays Word', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playCVA.cy.js b/cypress/e2e/participant/default-tests/playCVA.cy.js index 5e51d7c2f..628caf4d4 100644 --- a/cypress/e2e/participant/default-tests/playCVA.cy.js +++ b/cypress/e2e/participant/default-tests/playCVA.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roar-multichoice'; describe('ROAR - Written Vocabulary Playthrough', () => { it('Plays CVA', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js index 9b2a93051..b6c27afc4 100644 --- a/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-ARF.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js index b6d135c16..85656b488 100644 --- a/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js +++ b/cypress/e2e/participant/default-tests/playFluency-CALF.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playLetter.cy.js b/cypress/e2e/participant/default-tests/playLetter.cy.js index 60806f02f..3394853b7 100644 --- a/cypress/e2e/participant/default-tests/playLetter.cy.js +++ b/cypress/e2e/participant/default-tests/playLetter.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roar-letter'; describe('ROAR - Letra Play Through', () => { it('Plays Letra', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playPA.cy.js b/cypress/e2e/participant/default-tests/playPA.cy.js index 17c6aa80a..09c1a7d64 100644 --- a/cypress/e2e/participant/default-tests/playPA.cy.js +++ b/cypress/e2e/participant/default-tests/playPA.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roar-pa'; describe('Testing playthrough of ROAR-Phoneme as a participant', () => { it(`ROAR-Phoneme Playthrough Test`, () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playSWR.cy.js b/cypress/e2e/participant/default-tests/playSWR.cy.js index 29fa371d9..4c4dcf040 100644 --- a/cypress/e2e/participant/default-tests/playSWR.cy.js +++ b/cypress/e2e/participant/default-tests/playSWR.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through', () => { it('Plays Word', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/default-tests/playVocab.cy.js b/cypress/e2e/participant/default-tests/playVocab.cy.js index 33ad5d53f..4da72600d 100644 --- a/cypress/e2e/participant/default-tests/playVocab.cy.js +++ b/cypress/e2e/participant/default-tests/playVocab.cy.js @@ -4,7 +4,7 @@ import { isCurrentVersion } from '../../../support/utils'; const app = '@bdelab/roar-vocab'; describe('ROAR - Written Vocabulary Play Through', () => { it('Plays Written Vocabulary', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js index d95fb2d0a..657e9584a 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-3G.cy.js @@ -5,7 +5,7 @@ const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant in a simulated 3G network', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js index ac333f21d..2ccf63413 100644 --- a/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roam-fluency/playFluency-ARF-HighLatency.cy.js @@ -4,7 +4,7 @@ import { isCurrentVersion } from '../../../../support/utils'; const app = '@bdelab/roam-fluency'; describe('Test playthrough of Fluency as a participant in a simulated high latency networkt', () => { it('Fluency Playthrough Test', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js index 48f677947..0211e5ca3 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-2G.cy.js @@ -7,7 +7,7 @@ const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js index 48f677947..0211e5ca3 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-3G.cy.js @@ -7,7 +7,7 @@ const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { diff --git a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js index 48f677947..0211e5ca3 100644 --- a/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js +++ b/cypress/e2e/participant/network-tests/roar-swr/playSWR-HighLatency.cy.js @@ -7,7 +7,7 @@ const app = '@bdelab/roar-swr'; describe('ROAR - Word Play Through in a simulated 2G network', () => { it('Plays Word', () => { - isCurrentVersion(app).then((isCurrentVersion) => { + cy.wrap(isCurrentVersion(app)).then((isCurrentVersion) => { if (isCurrentVersion) { cy.log(`Did not detect a new version of ${app}, skipping test.`); } else { From c249b32d3df82983f693f62a99b75fd963ca25b6 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 13:22:54 -0700 Subject: [PATCH 30/34] wrap isCurrentVersion and call .then() to wait for result for optional game test --- .../default-tests/playOptionalGames.cy.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js index ed18509dc..99604d04d 100644 --- a/cypress/e2e/participant/default-tests/playOptionalGames.cy.js +++ b/cypress/e2e/participant/default-tests/playOptionalGames.cy.js @@ -11,12 +11,14 @@ function playOptionalGame(game, administration, language, optional) { describe('Play Optional Games', () => { optionalGames.forEach((game) => { it(`Plays ${game.name}`, () => { - if (isCurrentVersion(game.app) === true) { - cy.log(`Did not detect a new version of ${game.app}, skipping test.`); - } else { - cy.log(`Detected a new version of ${game.app}, running test.`); - playOptionalGame(game, administration, language, true); - } + cy.wrap(isCurrentVersion(game.app)).then((isCurrentVersion) => { + if (isCurrentVersion) { + cy.log(`Did not detect a new version of ${game.app}, skipping test.`); + } else { + cy.log(`Detected a new version of ${game.app}, running test.`); + playOptionalGame(game, administration, language, game.optional); + } + }); }); }); }); From 3553deaba8dc2c95fd85c5fa89c9186f05934430 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 13:33:15 -0700 Subject: [PATCH 31/34] increase SRE timeout --- cypress/support/helper-functions/roar-sre/sreHelpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/helper-functions/roar-sre/sreHelpers.js b/cypress/support/helper-functions/roar-sre/sreHelpers.js index 614ee863d..2de27b98a 100644 --- a/cypress/support/helper-functions/roar-sre/sreHelpers.js +++ b/cypress/support/helper-functions/roar-sre/sreHelpers.js @@ -24,7 +24,7 @@ export const playSRE = ({ .should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 12 * timeout }) + cy.get('.jspsych-btn', { timeout: 18 * timeout }) .should('be.visible') .click(); From a2b30bb6418d49285c4a9e7813c0ca44596cc8e1 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 14:27:59 -0700 Subject: [PATCH 32/34] increase timeouts for letter, swr, vocab tests --- cypress/support/helper-functions/roar-letter/letterHelpers.js | 2 +- cypress/support/helper-functions/roar-swr/swrHelpers.js | 2 +- cypress/support/helper-functions/roar-vocab/vocabHelpers.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/support/helper-functions/roar-letter/letterHelpers.js b/cypress/support/helper-functions/roar-letter/letterHelpers.js index 0e4fc1d9f..6f9fe67ce 100644 --- a/cypress/support/helper-functions/roar-letter/letterHelpers.js +++ b/cypress/support/helper-functions/roar-letter/letterHelpers.js @@ -49,7 +49,7 @@ export function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 12 * timeout }) + cy.get('.jspsych-btn', { timeout: 18 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-swr/swrHelpers.js b/cypress/support/helper-functions/roar-swr/swrHelpers.js index 8bedd5f7a..534ddeb45 100644 --- a/cypress/support/helper-functions/roar-swr/swrHelpers.js +++ b/cypress/support/helper-functions/roar-swr/swrHelpers.js @@ -20,7 +20,7 @@ export const playSWR = ({ cy.get('.p-tabview', { timeout: timeout }).contains(languageOptions[language].gameTab).should('exist'); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 12 * timeout }) + cy.get('.jspsych-btn', { timeout: 18 * timeout }) .should('be.visible') .click(); diff --git a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js index df889c3d9..cb89c4248 100644 --- a/cypress/support/helper-functions/roar-vocab/vocabHelpers.js +++ b/cypress/support/helper-functions/roar-vocab/vocabHelpers.js @@ -53,7 +53,7 @@ function startGame(administration, language, optional) { checkGameTab(language); cy.visit(languageOptions[language].url); - cy.get('.jspsych-btn', { timeout: 12 * timeout }) + cy.get('.jspsych-btn', { timeout: 18 * timeout }) .should('be.visible') .click(); From 04def63b7ce844d945897214e2ca95f2626c6f34 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 15 May 2024 16:56:25 -0700 Subject: [PATCH 33/34] rebase onto main, rollback swr to test new cypress functionality --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f6bf23ad..924ba7786 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "@bdelab/roar-multichoice": "^1.11.3", "@bdelab/roar-pa": "^2.2.0", "@bdelab/roar-sre": "^1.15.1", - "@bdelab/roar-swr": "^1.12.1", + "@bdelab/roar-swr": "^1.12.0", "@bdelab/roar-utils": "^1.2.1", "@bdelab/roar-vocab": "^1.7.2", "@bdelab/roav-crowding": "^1.0.36", @@ -3584,9 +3584,9 @@ } }, "node_modules/@bdelab/roar-swr": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.1.tgz", - "integrity": "sha512-nmzQL3srAjjEafJUxWL/SS/hunmYl8UdnkZ/AMADmWP08/9rgOyGy5oJ4iPYkSdutrRhwRgojnn/gqP4zTtMyQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.0.tgz", + "integrity": "sha512-LZWLqOpod1XjgbZds8El6QRPvU1Axlhok++euBLmHlhb4GrdEIXsz2NqGxENETZnAZeBY8HWRP0jDW/EvrNTww==", "dependencies": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", @@ -32378,9 +32378,9 @@ } }, "@bdelab/roar-swr": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.1.tgz", - "integrity": "sha512-nmzQL3srAjjEafJUxWL/SS/hunmYl8UdnkZ/AMADmWP08/9rgOyGy5oJ4iPYkSdutrRhwRgojnn/gqP4zTtMyQ==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.0.tgz", + "integrity": "sha512-LZWLqOpod1XjgbZds8El6QRPvU1Axlhok++euBLmHlhb4GrdEIXsz2NqGxENETZnAZeBY8HWRP0jDW/EvrNTww==", "requires": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", diff --git a/package.json b/package.json index 07b37e32c..773883a43 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "@bdelab/roar-multichoice": "^1.11.3", "@bdelab/roar-pa": "^2.2.0", "@bdelab/roar-sre": "^1.15.1", - "@bdelab/roar-swr": "^1.12.1", + "@bdelab/roar-swr": "^1.12.0", "@bdelab/roar-utils": "^1.2.1", "@bdelab/roar-vocab": "^1.7.2", "@bdelab/roav-crowding": "^1.0.36", From e625fb904d83c88fcb6c52bcc934aea1ab37939a Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 16 May 2024 09:35:52 -0700 Subject: [PATCH 34/34] update roar apps to their latest versions --- package-lock.json | 28 ++++++++++++++-------------- package.json | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 924ba7786..838292ddc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,10 +14,10 @@ "@bdelab/roar-multichoice": "^1.11.3", "@bdelab/roar-pa": "^2.2.0", "@bdelab/roar-sre": "^1.15.1", - "@bdelab/roar-swr": "^1.12.0", + "@bdelab/roar-swr": "^1.12.1", "@bdelab/roar-utils": "^1.2.1", "@bdelab/roar-vocab": "^1.7.2", - "@bdelab/roav-crowding": "^1.0.36", + "@bdelab/roav-crowding": "^1.1.0", "@bdelab/roav-ran": "^1.0.14", "@sentry/browser": "^8.0.0", "@sentry/integrations": "^7.114.0", @@ -3584,9 +3584,9 @@ } }, "node_modules/@bdelab/roar-swr": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.0.tgz", - "integrity": "sha512-LZWLqOpod1XjgbZds8El6QRPvU1Axlhok++euBLmHlhb4GrdEIXsz2NqGxENETZnAZeBY8HWRP0jDW/EvrNTww==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.1.tgz", + "integrity": "sha512-nmzQL3srAjjEafJUxWL/SS/hunmYl8UdnkZ/AMADmWP08/9rgOyGy5oJ4iPYkSdutrRhwRgojnn/gqP4zTtMyQ==", "dependencies": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", @@ -4595,9 +4595,9 @@ } }, "node_modules/@bdelab/roav-crowding": { - "version": "1.0.36", - "resolved": "https://registry.npmjs.org/@bdelab/roav-crowding/-/roav-crowding-1.0.36.tgz", - "integrity": "sha512-dRRaqBbsferzp/wpk7guoPNjSZxM1WQOPqmJlwgGj1cNprGqZCjlWpYTqWB8sHpLfElL/dNEEzsOclv7icCMCg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@bdelab/roav-crowding/-/roav-crowding-1.1.0.tgz", + "integrity": "sha512-JLyiwwDMdADwL85JFvwBoX53qrpt1qCD7AY12uvk8nOOhUpmu3yiZCVy9tiYEBbISTaEnAU1nW/J7Id3cyfj5A==", "dependencies": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", @@ -32378,9 +32378,9 @@ } }, "@bdelab/roar-swr": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.0.tgz", - "integrity": "sha512-LZWLqOpod1XjgbZds8El6QRPvU1Axlhok++euBLmHlhb4GrdEIXsz2NqGxENETZnAZeBY8HWRP0jDW/EvrNTww==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@bdelab/roar-swr/-/roar-swr-1.12.1.tgz", + "integrity": "sha512-nmzQL3srAjjEafJUxWL/SS/hunmYl8UdnkZ/AMADmWP08/9rgOyGy5oJ4iPYkSdutrRhwRgojnn/gqP4zTtMyQ==", "requires": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", @@ -33148,9 +33148,9 @@ } }, "@bdelab/roav-crowding": { - "version": "1.0.36", - "resolved": "https://registry.npmjs.org/@bdelab/roav-crowding/-/roav-crowding-1.0.36.tgz", - "integrity": "sha512-dRRaqBbsferzp/wpk7guoPNjSZxM1WQOPqmJlwgGj1cNprGqZCjlWpYTqWB8sHpLfElL/dNEEzsOclv7icCMCg==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@bdelab/roav-crowding/-/roav-crowding-1.1.0.tgz", + "integrity": "sha512-JLyiwwDMdADwL85JFvwBoX53qrpt1qCD7AY12uvk8nOOhUpmu3yiZCVy9tiYEBbISTaEnAU1nW/J7Id3cyfj5A==", "requires": { "@bdelab/jscat": "^4.0.0", "@bdelab/roar-firekit": "^4.7.0", diff --git a/package.json b/package.json index 773883a43..6809ccf3f 100644 --- a/package.json +++ b/package.json @@ -33,10 +33,10 @@ "@bdelab/roar-multichoice": "^1.11.3", "@bdelab/roar-pa": "^2.2.0", "@bdelab/roar-sre": "^1.15.1", - "@bdelab/roar-swr": "^1.12.0", + "@bdelab/roar-swr": "^1.12.1", "@bdelab/roar-utils": "^1.2.1", "@bdelab/roar-vocab": "^1.7.2", - "@bdelab/roav-crowding": "^1.0.36", + "@bdelab/roav-crowding": "^1.1.0", "@bdelab/roav-ran": "^1.0.14", "@sentry/browser": "^8.0.0", "@sentry/integrations": "^7.114.0",