Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test All Open Administrations on Release #517

Closed
wants to merge 11 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/cypress-network-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Cypress Network Tests
name: Cypress Pre-Release Tests
on:
workflow_run:
workflows: ['Deploy to Firebase Hosting (production)']
Expand Down
44 changes: 40 additions & 4 deletions .github/workflows/firebase-hosting-production.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
# 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:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '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: 180
strategy:
fail-fast: false
matrix:
browser: [chromium, edge]
containers: [1, 2]
env:
NODE_ENV: 'test'
CYPRESS_BASE_URL: 'http://localhost:5173'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this use the staging link instead of localhost?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, because we are testing the open administrations that have been synced from production Firestore to development Firestore. Running on dev will also allow us to run super admin tests which can clean up the dev database on a new relese (i.e. deleting all test runs).

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
Expand All @@ -37,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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
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');
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();

playFluency(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');
});
});
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
import { playFluency } 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();

playFluency(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');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
});
});
7 changes: 7 additions & 0 deletions cypress/e2e/participant/default-tests/playCVA.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { playWrittenVocabulary } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers';

describe('ROAR - Written Vocabulary Play Through', () => {
it('Plays Written Vocabulary', () => {
playWrittenVocabulary();
});
});
30 changes: 2 additions & 28 deletions cypress/e2e/participant/default-tests/playFluency-ARF.cy.js
Original file line number Diff line number Diff line change
@@ -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();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { playFluencyCALF } from '../../../support/helper-functions/roam-fluency/fluencyHelpers';

describe('Test playthrough of Fluency as a participant', () => {
it('Fluency Playthrough Test', () => {
playFluencyCALF();
});
});
7 changes: 7 additions & 0 deletions cypress/e2e/participant/default-tests/playLetter.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { playLetter } from '../../../support/helper-functions/roar-letter/letterHelpers';

describe('ROAR - Letra Play Through', () => {
it('Plays Letra', () => {
playLetter();
});
});
7 changes: 7 additions & 0 deletions cypress/e2e/participant/default-tests/playMorphology.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { playMorphology } from '../../../support/helper-functions/roar-multichoice/multichoiceHelpers';

describe('ROAR - Written Vocabulary Play Through', () => {
it('Plays Written Vocabulary', () => {
playMorphology();
});
});
43 changes: 14 additions & 29 deletions cypress/e2e/participant/default-tests/playPA.cy.js
Original file line number Diff line number Diff line change
@@ -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',
// };
ksmontville marked this conversation as resolved.
Show resolved Hide resolved

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();
});
});
5 changes: 1 addition & 4 deletions cypress/e2e/participant/default-tests/playSRE.cy.js
Original file line number Diff line number Diff line change
@@ -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();
});
});
7 changes: 7 additions & 0 deletions cypress/e2e/participant/default-tests/playVocab.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { playVocabulary } from '../../../support/helper-functions/roar-vocab/vocabHelpers';

describe('ROAR - Written Vocabulary Play Through', () => {
it('Plays Written Vocabulary', () => {
playVocabulary();
});
});
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
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.';

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();

playFluency(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();
});
});
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
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.';

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();

playFluency(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();
});
});
Original file line number Diff line number Diff line change
@@ -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);
});
});
Loading
Loading