Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/cypress-e2e' into cypress-e2e
Browse files Browse the repository at this point in the history
# Conflicts:
#	cypress.config.js
#	cypress/e2e/partner-admin/viewProgressReports.spec.cy.js
#	src/components/CreateOrgs.vue
  • Loading branch information
ksmontville committed Dec 9, 2023
2 parents c7f7a8c + e2e63d0 commit 3e87a7b
Show file tree
Hide file tree
Showing 35 changed files with 1,122 additions and 1,108 deletions.
74 changes: 38 additions & 36 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { defineConfig } = require("cypress");
require('dotenv').config()
const { defineConfig } = require('cypress');
require('dotenv').config();

module.exports = defineConfig({
projectId: "cobw62",
projectId: 'cobw62',
e2e: {
baseUrl: "https://localhost:5173/",
baseUrl: 'https://localhost:5173/',
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
// implement node event listeners here
Expand All @@ -14,7 +14,7 @@ module.exports = defineConfig({
// ]
},
env: {
baseUrl: "https://localhost:5173",
baseUrl: 'https://localhost:5173',
timeout: 10000,
sessionCookieName: process.env.SESSION_COOKIE_NAME,
sessionCookieValue: process.env.SESSION_COOKIE_VALUE,
Expand All @@ -24,38 +24,40 @@ module.exports = defineConfig({
partnerAdminUsername: process.env.PARTNER_ADMIN_USERNAME,
partnerAdminPassword: process.env.PARTNER_ADMIN_PASSWORD,
partnerAdminId: process.env.PARTNER_ADMIN_ID,
testAdministrationName: "zzzTestAdministration",
participantUsername: process.env.PARTICIPANT_USERNAME,
participantPassword: process.env.PARTICIPANT_PASSWORD,
testAdministrationName: 'zzzTestAdministration',
testAdministrationId: "pdOfQuakqN4re3cI5mr5",
testAdministratorFirstName: "zzzTestAdministratorFirstName",
testAdministratorMiddleName: "zzzTestAdministratorMiddleName",
testAdministratorLastName: "zzzTestAdministratorLastName",
testAdministratorEmail: "zzzTestAdministratorEmail",
testDistrictName: "zzzTestDistrict",
testDistrictInitials: "TD",
testDistrictNcesId: "123456789",
testAdministratorFirstName: 'zzzTestAdministratorFirstName',
testAdministratorMiddleName: 'zzzTestAdministratorMiddleName',
testAdministratorLastName: 'zzzTestAdministratorLastName',
testAdministratorEmail: 'zzzTestAdministratorEmail',
testDistrictName: 'zzzTestDistrict',
testDistrictInitials: 'TD',
testDistrictNcesId: '123456789',
testDistrictId: "yGGlUDTB5xzzCecoYucj",
testSchoolName: "zzzTestSchool",
testSchoolInitials: "TS",
testSchoolNcesId: "987654321",
testClassName: "zzzTestClass",
testClassInitials: "TC",
testGroupName: "zzzTestGroup",
testGroupInitials: "TG",
testPartnerAdministrationName: "zzzCypressTestAdministration",
testPartnerDistrictName: "zzzCypressTestDistrict",
testPartnerDistrictInitials: "CTD",
testPartnerDistrictNcesId: "123456789",
testPartnerSchoolName: "zzzCypressTestSchool",
testPartnerSchoolInitials: "CTS",
testPartnerSchoolNcesId: "987654321",
testPartnerClassName: "zzzCypressTestClass",
testPartnerClassInitials: "CTC",
testPartnerGroupName: "zzzCypressTestGroup",
testPartnerGroupInitials: "CTG",
testGrade: "Grade 5",
stanfordUniversityAddress: "450 Jane Stanford Way, Stanford, CA 94305, USA",
testTag: "stanford university",
cypressDownloads: "cypress/Downloads",
testSchoolName: 'zzzTestSchool',
testSchoolInitials: 'TS',
testSchoolNcesId: '987654321',
testClassName: 'zzzTestClass',
testClassInitials: 'TC',
testGroupName: 'zzzTestGroup',
testGroupInitials: 'TG',
testPartnerAdministrationName: 'zzzCypressTestAdministration',
testPartnerDistrictName: 'zzzCypressTestDistrict',
testPartnerDistrictInitials: 'CTD',
testPartnerDistrictNcesId: '123456789',
testPartnerSchoolName: 'zzzCypressTestSchool',
testPartnerSchoolInitials: 'CTS',
testPartnerSchoolNcesId: '987654321',
testPartnerClassName: 'zzzCypressTestClass',
testPartnerClassInitials: 'CTC',
testPartnerGroupName: 'zzzCypressTestGroup',
testPartnerGroupInitials: 'CTG',
testGrade: 'Grade 5',
stanfordUniversityAddress: '450 Jane Stanford Way, Stanford, CA 94305, USA',
testTag: 'stanford university',
cypressDownloads: 'cypress/Downloads',
testUserList: [
"zzzCypressTestStudent0",
"zzzCypressTestStudent1",
Expand All @@ -69,4 +71,4 @@ module.exports = defineConfig({
"zzzCypressTestStudent9",
]
},
});
});
114 changes: 56 additions & 58 deletions cypress/e2e/participant/buttonGamesList.js
Original file line number Diff line number Diff line change
@@ -1,64 +1,62 @@

export const games = [
{
name: "ROAR Picture Vocabulary",
id: "vocab",
startBtn: ".jspsych-btn",
introBtn: ".continue",
introIters: 3,
numChoices: 3,
stimulus: "",
preChoiceDelay: 700,
setUpChoice: ".intro_aliens",
clickableItem: ".vocab_img",
numIter: 4,
},
{
name: "ROAR Written Vocabulary",
id: "cva",
startBtn: ".jspsych-btn",
introBtn: ".go-button",
introIters: 2,
setupChoice: "",
stimulus: ".item-stimulus-cva",
preChoiceDelay: 1700,
clickableItem: "button",
correctChoice: ".glowingButton",
numIter: 4,
},
{
name: "ROAR-Morphology",
id: "multichoice",
startBtn: ".jspsych-btn",
introBtn: ".go-button",
introIters: 3 ,
numChoices: 3,
stimulus: ".item-stimulus",
clickableItem: "button",
preChoiceDelay: 1500,
setupChoice: "",
correctChoice: ".glowingButton",
numIter: 4,
},
{
name: "Letter",
id: "letter",
startBtn: ".jspsych-btn",
introBtn: ".go-button",
introIters: 5,
correctChoice: ".glowingButton",
numChoices: 3,
stimulus: "",
setupChoice: "",
clickableItem: "button",
preChoiceDelay: 600,
numIter: 27,
},
]
{
name: 'ROAR Picture Vocabulary',
id: 'vocab',
startBtn: '.jspsych-btn',
introBtn: '.continue',
introIters: 3,
numChoices: 3,
stimulus: '',
preChoiceDelay: 700,
setUpChoice: '.intro_aliens',
clickableItem: '.vocab_img',
numIter: 4,
},
{
name: 'ROAR Written Vocabulary',
id: 'cva',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 2,
setupChoice: '',
stimulus: '.item-stimulus-cva',
preChoiceDelay: 1700,
clickableItem: 'button',
correctChoice: '.glowingButton',
numIter: 4,
},
{
name: 'ROAR-Morphology',
id: 'multichoice',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 3,
numChoices: 3,
stimulus: '.item-stimulus',
clickableItem: 'button',
preChoiceDelay: 1500,
setupChoice: '',
correctChoice: '.glowingButton',
numIter: 4,
},
{
name: 'Letter',
id: 'letter',
startBtn: '.jspsych-btn',
introBtn: '.go-button',
introIters: 5,
correctChoice: '.glowingButton',
numChoices: 3,
stimulus: '',
setupChoice: '',
clickableItem: 'button',
preChoiceDelay: 600,
numIter: 27,
},
];

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

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

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

cy.login(test_login, test_pw);
cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword'));

cy.wait(1000);
cy.get("button").contains("Sign Out").click();
cy.wait(1000);
cy.get('button').contains('Sign Out').click();

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

0 comments on commit 3e87a7b

Please sign in to comment.