-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from ReadAlongs/dev.del/gear-menu
feat: created a settings dialog
- Loading branch information
Showing
16 changed files
with
599 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
context("Testing end user enabled settings", () => { | ||
beforeEach(() => { | ||
cy.intercept(/\.readalong/).as("text"); | ||
cy.intercept(/\.m4a/).as("audio"); | ||
|
||
cy.visit("/ej-fra/"); | ||
cy.wait("@text"); | ||
cy.wait("@audio"); | ||
}); | ||
it("can open the settings", () => { | ||
cy.readalong().within(() => { | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings]").should("be.visible"); | ||
}); | ||
}); | ||
it("can close the settings", () => { | ||
cy.readalong().within(() => { | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings]").should("be.visible"); | ||
cy.get("[data-test-id=settings-close-button]").click(); | ||
cy.get("[data-test-id=settings]").should("not.exist"); | ||
}); | ||
}); | ||
it("can change page animation settings", () => { | ||
cy.readalong().within(() => { | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings]").should("be.visible"); | ||
cy.get("[data-test-id=settings-scroll-behavior]").should( | ||
"have.text", | ||
"check_box", | ||
); | ||
cy.get("[data-test-id=settings-scroll-behavior]").click(); | ||
cy.get("[data-test-id=settings-scroll-behavior]").should( | ||
"have.text", | ||
"check_box_outline_blank", | ||
); | ||
cy.get("[data-test-id=settings-close-button]").click(); | ||
cy.get("[data-test-id=settings]").should("not.exist"); | ||
}); | ||
}); | ||
it("can change page turn settings", () => { | ||
cy.readalong().within(() => { | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings]").should("be.visible"); | ||
cy.get("[data-test-id=settings-auto-pause]").should( | ||
"have.text", | ||
"check_box_outline_blank", | ||
); | ||
cy.get("[data-test-id=settings-auto-pause]").click(); | ||
cy.get("[data-test-id=settings-auto-pause]").should( | ||
"have.text", | ||
"check_box", | ||
); | ||
cy.get("[data-test-id=settings-pause-timeout]").should("not.exist"); | ||
cy.get("[data-test-id=settings-close-button]").click(); | ||
cy.get("[data-test-id=settings]").should("not.exist"); | ||
cy.get("[data-cy=play-button]").click(); | ||
cy.wait(7000); //6740 timestamp of the first word on second page | ||
cy.get("#t0b0d1p0s0w0").should("not.be.visible"); | ||
|
||
cy.get("[data-cy=play-button]").should("be.visible"); | ||
}); | ||
}); | ||
it("can save user preference", () => { | ||
cy.readalong().within(() => { | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings]").should("be.visible"); | ||
cy.get("[data-test-id=settings-auto-pause]").should( | ||
"have.text", | ||
"check_box_outline_blank", | ||
); | ||
cy.get("[data-test-id=settings-save").should("be.disabled"); | ||
cy.get("[data-test-id=settings-auto-pause]").click(); | ||
cy.get("[data-test-id=settings-auto-pause]").should( | ||
"have.text", | ||
"check_box", | ||
); | ||
cy.get("[data-test-id=settings-save").should("be.enabled").click(); | ||
cy.get("[data-test-id=settings-close-button]").click(); | ||
cy.reload(); | ||
cy.get("[data-test-id=settings-button]").click(); | ||
cy.get("[data-test-id=settings-auto-pause]").should( | ||
"have.text", | ||
"check_box", | ||
); | ||
|
||
//reset back to default | ||
cy.getAllLocalStorage(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.