diff --git a/.env.example.test b/.env.example.test index 72a0e0735..1d2d50026 100644 --- a/.env.example.test +++ b/.env.example.test @@ -20,4 +20,4 @@ PARENT_EMAIL='your-parent-email' PARENT_PASSWORD='your-parent-password' # Firebase App Check Tokens -VITE_APPCHECK_DEBUG_TOKEN='your-firebase-app-check-debug-token' \ No newline at end of file +VITE_APPCHECK_DEBUG_TOKEN='your-firebase-app-check-debug-token' diff --git a/.github/workflows/cypress-partner-admin-tests.yml b/.github/workflows/cypress-partner-admin-tests.yml index eefcbe86d..b8f11f2f0 100644 --- a/.github/workflows/cypress-partner-admin-tests.yml +++ b/.github/workflows/cypress-partner-admin-tests.yml @@ -37,6 +37,10 @@ jobs: PARTICIPANT_PASSWORD: ${{ secrets.PARTICIPANT_PASSWORD }} PARTICIPANT_EMAIL: ${{ secrets.PARTICIPANT_EMAIL }} PARTICIPANT_EMAIL_PASSWORD: ${{ secrets.PARTICIPANT_EMAIL_PASSWORD }} + PARENT_FIRST_NAME: ${{ secrets.PARENT_FIRST_NAME }} + PARENT_LAST_NAME: ${{ secrets.PARENT_LAST_NAME }} + PARENT_EMAIL: ${{ secrets.PARENT_EMAIL }} + PARENT_PASSWORD: ${{ secrets.PARENT_PASSWORD }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VITE_APPCHECK_DEBUG_TOKEN: ${{ secrets.VITE_APPCHECK_DEBUG_TOKEN }} steps: diff --git a/cypress.config.cjs b/cypress.config.cjs index 794d54b15..aad8acf07 100644 --- a/cypress.config.cjs +++ b/cypress.config.cjs @@ -139,6 +139,10 @@ module.exports = defineConfig({ testOptionalRoarAppsAdministrationId: 'Fuy4nQaMu6YmfNg1eBYH', testSpanishRoarAppsAdministration: 'Cypress Test Spanish Roar Apps Administration', testSpanishRoarAppsAdministrationId: '', + parentFirstName: process.env.PARENT_FIRST_NAME, + parentLastName: process.env.PARENT_LAST_NAME, + parentEmail: process.env.PARENT_EMAIL, + parentPassword: process.env.PARENT_PASSWORD, // Generate a list of test users CypressTestStudent0, CypressTestStudent1, ..., CypressTestStudent50 and push the test_legal_doc user testUserList: (() => { const list = Array.from({ length: 51 }, (_, i) => `CypressTestStudent${i}`); diff --git a/cypress/e2e/partner-admin/default-tests/exportSelectedScoreReport.cy.js b/cypress/e2e/partner-admin/default-tests/exportSelectedScoreReport.cy.js index 51a97aeb9..5d94f2e05 100644 --- a/cypress/e2e/partner-admin/default-tests/exportSelectedScoreReport.cy.js +++ b/cypress/e2e/partner-admin/default-tests/exportSelectedScoreReport.cy.js @@ -14,7 +14,7 @@ describe('The partner admin can select and export progress reports for a given a cy.get('button').contains('Export Selected').click(); cy.readFile( - `${Cypress.env('cypressDownloads')}/roar-scores-partner-test-administration-cypress-test-district-selected.csv`, + `${Cypress.env('cypressDownloads')}/roar-scores-selected-partner-test-administration-cypress-test-district.csv`, ); }); }); diff --git a/cypress/e2e/partner-admin/default-tests/parentSignUpInvitationCode.cy.js b/cypress/e2e/partner-admin/default-tests/parentSignUpInvitationCode.cy.js new file mode 100644 index 000000000..aa165f01b --- /dev/null +++ b/cypress/e2e/partner-admin/default-tests/parentSignUpInvitationCode.cy.js @@ -0,0 +1,67 @@ +const baseUrl = Cypress.env('baseUrl'); +import { APP_ROUTES } from '../../../../src/constants/routes'; + +const orgs = [ + { + tabName: 'Districts', + orgName: Cypress.env('testPartnerDistrictName'), + orgVerified: 'Districts - Cypress Test District', + }, +]; + +function visitSignUpPage(activationCode) { + const registerUrl = `${baseUrl}/register/?code=${activationCode}`; + cy.visit(registerUrl); +} + +function inputLoginValues() { + cy.get('input[name="firstName"]').type(Cypress.env('parentFirstName')); + cy.get('input[name="lastName"]').type(Cypress.env('parentLastName')); + cy.get('input[name="ParentEmail"]').type(Cypress.env('parentEmail')); + cy.get('input[type="password"]').first().type(Cypress.env('parentPassword')); + cy.get('input[type="password"]').eq(1).type(Cypress.env('parentPassword')); +} + +function completeParentSignUp(org) { + cy.get('div.p-checkbox-box').click(); + cy.get('button').contains('Continue').click(); + cy.get('button').contains('Next').click(); + cy.get('h2').should('contain.text', org.orgVerified); +} + +describe('The partner admin user', () => { + beforeEach(() => { + cy.login(Cypress.env('partnerAdminUsername'), Cypress.env('partnerAdminPassword')); + cy.visit(APP_ROUTES.HOME); + cy.visit(APP_ROUTES.LIST_ORGS); + }); + + orgs.forEach((org) => { + context(`when navigating to the ${org.tabName} tab`, () => { + it(`should see the organization ${org.orgName} and should click on Invite Users`, () => { + cy.checkOrgExists(org); + + // Locate the row with the orgName and click the "Invite Users" button specifically for that org + cy.contains('td', org.orgName) + .parents('tr') + .find('button') + .contains('Invite Users') // Ensure the button contains the text "Invite Users" + .click(); + + cy.log(`Invite Users button clicked for ${org.orgName}.`); + + // Invoke the activation code input field to get the value + cy.get('[data-cy="input-text-activation-code"]') + .invoke('attr', 'value') + .then((value) => { + expect(value).to.not.be.empty; + + // Visit the sign-up page with the activation code + visitSignUpPage(value); + inputLoginValues(); + completeParentSignUp(org); + }); + }); + }); + }); +}); diff --git a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js index a1c3575dd..739f09972 100644 --- a/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js +++ b/cypress/e2e/pre-release-tests/testOpenAdministrations.cy.js @@ -105,7 +105,7 @@ // language: 'es', // }, // { -// name: 'Words and Pictures Game', +// name: 'ROAR - Syntax', // app: 'core-tasks', // spec: playSyntax, // language: 'en', diff --git a/cypress/support/commands.js b/cypress/support/commands.js index ebb330d15..ed15d2ab0 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -303,6 +303,29 @@ Cypress.Commands.add('playOptionalGame', (game, administration, optional) => { }); }); +/** + * Custom command to check if a partner district exists in the organization list. + * + * This command performs the following actions: + * 1. Locates and clicks on the 'Districts' option in a list. + * 2. Verifies if the partner district name (retrieved from Cypress environment variables) exists in a specific `div` element. + * 3. Logs a message confirming that the district exists. + * + * @param {number} [timeout=10000] - Optional timeout for each command, defaulting to 10 seconds. + */ +Cypress.Commands.add('checkOrgExists', (org, timeout = 10000) => { + // Click on the 'Districts' item in the list + cy.get('ul > li', { timeout }).contains(org.tabName, { timeout }).click(); + + // Verify the partner district name is present in the div + cy.get('div', { timeout }).should('contain.text', Cypress.env('testPartnerDistrictName'), { + timeout, + }); + + // Log the district name exists + cy.log(`${Cypress.env('testPartnerDistrictName')} exists.`); +}); + /** * Create a mock store for the user type specified. * @param {string} userType - The type of user to create a mock store for. One of 'superAdmin', 'partnerAdmin', or 'participant'. Defaults to 'participant'. diff --git a/cypress/support/helper-functions/roar-syntax/languageOptions.js b/cypress/support/helper-functions/roar-syntax/languageOptions.js index ed96bec8a..8eee718ce 100644 --- a/cypress/support/helper-functions/roar-syntax/languageOptions.js +++ b/cypress/support/helper-functions/roar-syntax/languageOptions.js @@ -1,7 +1,7 @@ export const languageOptions = { en: { syntax: { - gameTab: 'Words and Pictures Game', + gameTab: 'ROAR - Syntax', url: '/game/core-tasks/trog', }, }, diff --git a/package-lock.json b/package-lock.json index 7d05d0543..bd90bab97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "roar-dashboard", - "version": "3.0.0", + "version": "3.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "roar-dashboard", - "version": "3.0.0", + "version": "3.0.1", "dependencies": { "@bdelab/roam-fluency": "1.11.26", "@bdelab/roar-firekit": "9.1.0", @@ -20,7 +20,7 @@ "@bdelab/roav-crowding": "1.1.16", "@bdelab/roav-mep": "^1.1.21", "@bdelab/roav-ran": "^1.0.30", - "@levante-framework/core-tasks": "^1.0.0-beta.18", + "@levante-framework/core-tasks": "1.0.0-beta.16", "@sentry/browser": "^8.0.0", "@sentry/integrations": "^7.114.0", "@sentry/vite-plugin": "^2.16.1", @@ -9085,9 +9085,9 @@ "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==" }, "node_modules/@levante-framework/core-tasks": { - "version": "1.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@levante-framework/core-tasks/-/core-tasks-1.0.0-beta.18.tgz", - "integrity": "sha512-FRq1heE8PlcYUmfV08r35Ev4DbYN/IJPr6qqd6Qekpfq1rZdy5iXgNzcSsUAkbnB5RhFj12XUKtenpSnuoG0wg==", + "version": "1.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@levante-framework/core-tasks/-/core-tasks-1.0.0-beta.16.tgz", + "integrity": "sha512-11+zouZ7JaWAvwEaf5m7Wa4XSjypPB0uqoS4NcjgsK6NjnNsuO38dcmRoYAILJ8rq317o+I2XwTFaiKz95wU0g==", "dependencies": { "@bdelab/jscat": "^3.0.3", "@bdelab/roar-firekit": "^6.1.2", @@ -44690,9 +44690,9 @@ "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==" }, "@levante-framework/core-tasks": { - "version": "1.0.0-beta.18", - "resolved": "https://registry.npmjs.org/@levante-framework/core-tasks/-/core-tasks-1.0.0-beta.18.tgz", - "integrity": "sha512-FRq1heE8PlcYUmfV08r35Ev4DbYN/IJPr6qqd6Qekpfq1rZdy5iXgNzcSsUAkbnB5RhFj12XUKtenpSnuoG0wg==", + "version": "1.0.0-beta.16", + "resolved": "https://registry.npmjs.org/@levante-framework/core-tasks/-/core-tasks-1.0.0-beta.16.tgz", + "integrity": "sha512-11+zouZ7JaWAvwEaf5m7Wa4XSjypPB0uqoS4NcjgsK6NjnNsuO38dcmRoYAILJ8rq317o+I2XwTFaiKz95wU0g==", "requires": { "@bdelab/jscat": "^3.0.3", "@bdelab/roar-firekit": "^6.1.2", diff --git a/package.json b/package.json index 93adc8496..843473f00 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "roar-dashboard", "private": true, - "version": "3.0.0", + "version": "3.0.1", "type": "module", "scripts": { "build": "export VITE_FIREBASE_DATA_SOURCE=live && vite build", @@ -43,7 +43,7 @@ "@bdelab/roav-crowding": "1.1.16", "@bdelab/roav-mep": "^1.1.21", "@bdelab/roav-ran": "^1.0.30", - "@levante-framework/core-tasks": "^1.0.0-beta.18", + "@levante-framework/core-tasks": "1.0.0-beta.16", "@sentry/browser": "^8.0.0", "@sentry/integrations": "^7.114.0", "@sentry/vite-plugin": "^2.16.1", diff --git a/roar-firebase-functions b/roar-firebase-functions index 737a604aa..27875477c 160000 --- a/roar-firebase-functions +++ b/roar-firebase-functions @@ -1 +1 @@ -Subproject commit 737a604aadcb35d6e4588124b33279dff1d5abe8 +Subproject commit 27875477c98d9b65712b2413b3780ed15bf97e6c diff --git a/src/components/ListOrgs.vue b/src/components/ListOrgs.vue index decea127e..a371d5934 100644 --- a/src/components/ListOrgs.vue +++ b/src/components/ListOrgs.vue @@ -95,9 +95,16 @@

Code:

- + diff --git a/src/components/auth/RegisterStudent.vue b/src/components/auth/RegisterStudent.vue index 1fcbfddb1..d23fc94c9 100644 --- a/src/components/auth/RegisterStudent.vue +++ b/src/components/auth/RegisterStudent.vue @@ -51,7 +51,7 @@

You are registering for:

-

{{ student.orgName }}

+

{{ student.orgName }}

-
VIEW
+
VIEW
-
+
+