Skip to content

Commit bd276fa

Browse files
committed
Force Cypress to wait for page load
1 parent 0aa3da5 commit bd276fa

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

cypress/support/component-ada.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ Cypress.on('test:before:run:async', async () => {
4848
});
4949

5050
// Skip visual regression tests in interactive mode - the results are not consistent with headless.
51+
// It may be useful to comment this out when debugging tests locally, but don't commit the snapshots.
5152
if (Cypress.config('isInteractive')) {
5253
Cypress.Commands.add('matchImage', () => {
53-
cy.log('Skipping visual regression test assertion ("matchImage()") - results will not match headless mode.');
54+
cy.log('Skipping snapshot 👀');
5455
});
5556
}

cypress/support/component-phy.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Cypress.on('test:before:run:async', async () => {
4747
await worker.start();
4848
});
4949

50-
// Skip visual regression tests in interactive mode - the results are not consistent with headless
50+
// Skip visual regression tests in interactive mode - the results are not consistent with headless.
51+
// It may be useful to comment this out when debugging tests locally, but don't commit the snapshots.
5152
if (Cypress.config('isInteractive')) {
5253
Cypress.Commands.add('matchImage', () => {
5354
cy.log('Skipping snapshot 👀');

src/app/components/handlers/IsaacSpinner.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface IsaacSpinnerProps {
1414
export const IsaacSpinner = ({size = "md", className, color = "primary", inline = false, displayText = "Loading..."} : IsaacSpinnerProps) => {
1515
const contents = <>
1616
<img style={siteSpecific({width: "auto", height: "5.5rem"}, {})} className={classNames(`isaac-spinner-${size}`, className)} alt="" src={siteSpecific("/assets/phy/isaac-phy-apple-grow.svg", "/assets/cs/icons/loading-spinner-placeholder.svg")}/>
17-
<span className="sr-only">{displayText}</span>
17+
<span data-testid={"loading"} className="sr-only">{displayText}</span>
1818
</>;
1919
return inline
2020
? <span role="status">{contents}</span>

src/test/pages/MyAssignments.cy.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ it('My Assignments should render', () => {
2121
</Provider>
2222
);
2323

24+
cy.get('[data-testid="loading"]').should('not.exist');
25+
2426
cy.matchImage();
2527
});

0 commit comments

Comments
 (0)