Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Annelein committed Jun 12, 2024
1 parent 2b39812 commit d9049e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ teachers.forEach((teacher) => {
cy.intercept('/for-teachers/customize-class/*').as('updateCustomizations');
// Fill in the quiz score
cy.getDataCy('quiz_input').clear().type("50").should("have.value", "50");
cy.wait(500);
cy.wait('@updateCustomizations').should('have.nested.property', 'response.statusCode', 200);
cy.wait(4000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ describe('customize class page', () => {
selectLevel('2');

// remove the quiz
cy.getDataCy('hide_quiz').scrollIntoView().should('be.visible');
cy.getDataCy('hide_quiz').click();
cy.getDataCy('quiz').should("not.exist")

// remove the puzzle
cy.getDataCy('hide_parsons').scrollIntoView().should('be.visible');
cy.getDataCy('hide_parsons').click();
cy.getDataCy('parsons').should("not.exist")

Expand All @@ -30,11 +32,9 @@ describe('customize class page', () => {
cy.getDataCy('available_adventures_current_level').select("parsons")

// Now the order should be quiz as last, then parsons.
cy.getDataCy('parsons').should("exist")

cy.getDataCy('parsons').scrollIntoView().should("exist")
// scrol to get quiz into view and make sure its the last one
cy.getDataCy('quiz').scrollIntoView().should('be.visible');
cy.getDataCy('quiz').last().should("exist")
cy.getDataCy('quiz').scrollIntoView().last().should("exist");

// make sure they are visible
loginForStudent();
Expand Down
3 changes: 2 additions & 1 deletion tests/cypress/e2e/tools/classes/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,11 @@ export function openClass(classname) {
}

export function removeCustomizations(){
cy.getDataCy('customize_class_button').click();
cy.intercept('/for-teachers/restore-customizations*').as('restoreCustomizations');
cy.getDataCy('customize_class_button').click();
cy.getDataCy('remove_customizations_button').click();
cy.getDataCy('modal_yes_button').click();
cy.wait(500);
cy.wait('@restoreCustomizations').should('have.nested.property', 'response.statusCode', 200);
cy.wait(4000);
}
Expand Down

0 comments on commit d9049e3

Please sign in to comment.