Skip to content

Commit

Permalink
Merge pull request #720 from yeatmanlab/enh/primeview-update
Browse files Browse the repository at this point in the history
Primevue Update from V3 to V4
  • Loading branch information
Emily-ejag authored Aug 16, 2024
2 parents 54c459c + 59679ba commit a39ff4c
Show file tree
Hide file tree
Showing 77 changed files with 1,571 additions and 11,807 deletions.
5 changes: 3 additions & 2 deletions cypress/e2e/participant/default-tests/checkLegalDoc.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe('Test to maintain that assent form shows in when signing in with an un-
// how can we write some logic to reset the already played
cy.login(test_login, test_pw);
cy.visit('/');
cy.get('.p-dialog-title', { timeout: timeout }).contains('CONSENT').should('be.visible');
cy.get('.p-confirm-dialog-accept').contains('Continue').should('be.visible');
cy.wait(1000);
cy.get('.p-dialog-title', { timeout: timeout }).contains('CONSENT FORM').should('be.visible');
cy.get('.p-dialog-footer').contains('Continue').should('be.visible');
});
});
2 changes: 1 addition & 1 deletion cypress/e2e/participant/default-tests/playVideo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Playing Video', () => {
cy.login(Cypress.env('participantUsername'), Cypress.env('participantPassword'));
cy.visit('/', { timeout: 2 * timeout });
cy.selectAdministration(Cypress.env('testRoarAppsAdministration'));
cy.get('.tabview-nav-link-label', { timeout: 2 * timeout })
cy.get('.p-tablist-tab-list', { timeout: 2 * timeout })
.contains('ROAR - Word')
.click();
cy.get('.vjs-big-play-button', { timeout: 2 * timeout }).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('The partner admin can select and export progress reports for a given a
cy.get('button').contains('Progress').first().click();

// make a selection
cy.get('.p-checkbox-box').first().click();
cy.get('input.p-checkbox-input').first().click();

cy.get('button').contains('Export Selected').click();
cy.readFile(`${Cypress.env('cypressDownloads')}/roar-progress-selected.csv`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('The partner admin can select and export progress reports for a given a
cy.get('button').contains('Score').first().click();

// make a selection
cy.get('.p-checkbox-box').first().click();
cy.get('input.p-checkbox-input').first().click();

cy.get('button').contains('Export Selected').click();
cy.readFile(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const orgs = [
const listOrgsUrl = '/list-orgs';

function checkOrgExists(org) {
cy.get('ul > li', { timeout: timeout }).contains(org.tabName, { timeout: timeout }).click();
cy.get('.p-tablist-tab-list', { timeout: timeout }).contains(org.tabName, { timeout: timeout }).click();
cy.log('Tab ' + org.tabName + ' found.');

cy.get('div', { timeout: timeout }).should('contain.text', org.orgName, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ function setFilterByGrade(grade) {
}

function setFilterByProgressCategory(header, category) {
cy.contains('div.p-column-header-content', header).find('button').click();
cy.contains(
'th.p-datatable-header-cell.p-datatable-sortable-column.p-datatable-resizable-column.p-datatable-reorderable-column',
header,
)
.find('button')
.click();
cy.get('[data-cy="progress-filter-dropdown"]', { timeout: timeout }).click();
cy.get('ul>li').find('.p-tag-value', { timeout: timeout }).contains(category).click();
cy.get('ul>li').find('span.p-tag-label', { timeout: timeout }).contains(category).click();
// Click off the dropdown to prevent it from hiding other elements
cy.get('button').contains('Apply').click();
cy.wait(0.05 * timeout);
Expand Down Expand Up @@ -148,7 +153,7 @@ describe('The partner admin can view progress reports for a given administration
cy.getAdministrationCard(roarTestAdministrationName, 'descending');
clickProgressButton(roarTestAdministrationId);
setFilterByProgressCategory('ROAR - Written Vocab', 'started');
cy.get('.p-datatable-emptymessage').contains('No results found');
cy.get('.p-datatable-emptymessage').contains('Reset Filters');
cy.get('.flex.flex-column.align-items-center.align-text-left.my-8').contains('No results found');
cy.get('.flex.flex-column.align-items-center.align-text-left.my-8').contains('Reset Filters');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,25 @@ function setFilterByGrade(grade) {
}

function setFilterByProgressCategory(header, category) {
cy.contains('div.p-column-header-content', header).find('button').click();
cy.contains(
'th.p-datatable-header-cell.p-datatable-sortable-column.p-datatable-resizable-column.p-datatable-reorderable-column',
header,
)
.find('button')
.click();
cy.get('[data-cy="score-filter-dropdown"]', { timeout: timeout }).click();
cy.get('ul>li').find('.p-tag-value', { timeout: timeout }).contains(category).click();
cy.get('ul>li').find('span.p-tag-label', { timeout: timeout }).contains(category).click();
cy.get('button').contains('Apply').click();
cy.wait(0.05 * timeout);
}

function setFilterByScoreCategory(header, category) {
cy.contains('div.p-column-header-content', header).find('button').click();
cy.contains(
'th.p-datatable-header-cell.p-datatable-sortable-column.p-datatable-resizable-column.p-datatable-reorderable-column',
header,
)
.find('button')
.click();
cy.get('[data-cy="score-filter-dropdown"]', { timeout: timeout }).click();
cy.get('ul > li', { timeout: timeout }).contains(category).click();
cy.get('button').contains('Apply').click();
Expand Down Expand Up @@ -134,7 +144,7 @@ describe('The partner admin can view score reports for a given administration an
cy.getAdministrationCard(roarTestAdministrationName, 'descending');
clickScoreButton(roarTestAdministrationId);
setFilterByScoreCategory('ROAR - Written Vocab', 'Optional');
cy.get('.p-datatable-emptymessage').contains('No results found');
cy.get('.p-datatable-emptymessage').contains('Reset Filters');
cy.get('.flex.flex-column.align-items-center.align-text-left.my-8').contains('No results found');
cy.get('.flex.flex-column.align-items-center.align-text-left.my-8').contains('Reset Filters');
});
});
11 changes: 0 additions & 11 deletions cypress/e2e/partner-admin/default-tests/viewIndividualReport.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ function clickScoreButton() {
);
}

function checkAssignmentColumns(assignments) {
cy.get('[data-cy="roar-data-table"] thead th').then(($header) => {
const tableHeaders = $header.map((index, elem) => Cypress.$(elem).text()).get();

assignments.forEach((assignment) => {
expect(tableHeaders).to.include(assignment);
});
});
}

function checkIndividualScoreReport() {
cy.get('[data-cy="route-button"]', { timeout: 3 * timeout })
.first()
Expand All @@ -50,7 +40,6 @@ describe('The partner admin can view individual score reports for a given admini
cy.getAdministrationCard(testPartnerAdministrationName);
clickScoreButton();
cy.checkUserList(testUserList);
checkAssignmentColumns(testAssignments);
checkIndividualScoreReport();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ function clickProgressButton() {
}

function checkProgressTags(headers) {
cy.get('[data-cy="roar-data-table"] thead th').then(($header) => {
const tableHeaders = $header.map((index, elem) => Cypress.$(elem).text()).get();
cy.get('.p-datatable-column-header-content').then(($header) => {
const tableHeaders = Array.from($header).map((elem) => elem.innerText.trim());
cy.log('Table Headers:', tableHeaders);

headers.forEach((header) => {
const headerIndex = tableHeaders.indexOf(header);
Expand All @@ -38,6 +39,8 @@ function checkProgressTags(headers) {
cy.wrap(headerCell).find('span.p-tag.p-component').should('exist');
});
});
} else {
cy.log(`Header "${header}" not found in table headers.`);
}
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ function clickScoreButton() {
}

function checkAssignmentColumns() {
cy.get('[data-cy="roar-data-table"] thead th').then(($header) => {
const tableHeaders = $header.map((index, elem) => Cypress.$(elem).text()).get();
cy.get('.p-datatable-column-header-content').then(($header) => {
const tableHeaders = Array.from($header).map((header) => header.innerText);
cy.log('Table Headers:', tableHeaders);

testAssignments.forEach((assignment) => {
expect(tableHeaders).to.include(assignment);
expect(tableHeaders).to.include(assignment, `Expected header to include ${assignment}`);
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Cypress.Commands.add('selectAdministration', function selectAdministration(testA
cy.agreeToConsent(text);

if (text.includes(testAdministration)) {
cy.get('.p-dropdown-item', { timeout: 2 * Cypress.env('timeout') })
cy.get('.p-select-list-container', { timeout: 2 * Cypress.env('timeout') })
.contains(testAdministration)
.click();
cy.log('Selected administration:', testAdministration);
Expand Down Expand Up @@ -185,7 +185,7 @@ Cypress.Commands.add(
Cypress.Commands.add('checkUserList', (userList) => {
cy.get('[data-cy="roar-data-table"] tbody tr', { timeout: Cypress.env('timeout') }).each((row) => {
cy.wrap(row)
.find('td.p-frozen-column')
.find('td.p-datatable-frozen-column')
.then((cell) => {
// The following cleans the non-breaking space character and any whitespace from the cell text
const cellText = cell
Expand Down
Loading

0 comments on commit a39ff4c

Please sign in to comment.