-
Notifications
You must be signed in to change notification settings - Fork 6
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 #207 from OpenCovenant/settings_cypress_tests
All tests passed without any issues.
- Loading branch information
Showing
7 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
cypress/e2e/check-if-page-settings-opens-from-offcanvas.cy.js
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,11 @@ | ||
describe("Settings page should open from offcanvas page", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("will click on the \"cilesimet\" located on offcanvas and check if it loaded the /settings page ", () => { | ||
cy.get('[data-test="navbar-toggler-icon"]').click(); | ||
cy.get('[data-test="settings-button"]').click(); | ||
cy.url().should("include", "/settings"); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
cypress/e2e/disabling-a-marking-persisted-after-reloading.cy.js
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,19 @@ | ||
describe("Enabling/disabling a marking is persisted after reloading.", () => { | ||
beforeEach(() => { | ||
cy.visit("/settings"); | ||
}); | ||
|
||
it("will uncheck all the switch on the /settings page reload the page and check if they are still disabled ", () => { | ||
cy.get('[data-test="switch-check-testing"]').should('be.checked'); | ||
cy.get('[data-test="switch-check-testing"]').click({ multiple: true, force:true }); | ||
cy.get('[data-test="switch-check-testing"]').should('not.be.checked'); | ||
cy.reload(); | ||
cy.get('[data-test="switch-check-testing"]').should('not.be.checked'); | ||
cy.get('[data-test="switch-check-testing"]').click({ multiple: true, force:true }); | ||
cy.get('[data-test="switch-check-testing"]').should('be.checked'); | ||
cy.reload(); | ||
cy.get('[data-test="switch-check-testing"]').should('be.checked'); | ||
|
||
}); | ||
}); | ||
|
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,10 @@ | ||
describe("Clicking on the gear icon takes you to /settings page", () => { | ||
beforeEach(() => { | ||
cy.visit("/"); | ||
}); | ||
|
||
it("will click on gear icon and check if it goes to /settings", () => { | ||
cy.get('[data-test="gear-button-testing"]').click(); | ||
cy.url().should("include", "/settings"); | ||
}); | ||
}); |
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,45 @@ | ||
describe("A marking type does not appear after being disabled.", () => { | ||
beforeEach(() => { | ||
cy.visit("/settings"); | ||
}); | ||
|
||
it("will disable all the marking types and check if they appeared on the main page", () => { | ||
cy.get('[data-test="switch-check-testing"]').should('be.checked'); | ||
cy.get('[data-test="switch-check-testing"]').click({ multiple: true, force:true }); | ||
cy.get('[data-test="switch-check-testing"]').should('not.be.checked'); | ||
cy.visit("/"); | ||
cy.get('[data-test="editor"]').type("Pra shkoi tek zyra. "); | ||
cy.get("span.typo").contains("gabime shkrimi").should("exist"); | ||
cy.get(".list-group-item b") | ||
.contains("shkrim pa gabime") | ||
.should("exist"); | ||
cy.get(".list-group-item span") | ||
.contains( | ||
"shenjime për fjalë të shkruara gabim, gabime fonetikore, shenja pikësimi" | ||
) | ||
.should("exist"); | ||
cy.get('[data-test="editor"]').type('{enter}'); | ||
cy.get('[data-test="editor"]').type("Pra kaq."); | ||
cy.get("span.typo").contains("gabime shkrimi").should("exist"); | ||
cy.get(".list-group-item b") | ||
.contains("shkrim pa gabime") | ||
.should("exist"); | ||
cy.get(".list-group-item span") | ||
.contains( | ||
"shenjime për fjalë të shkruara gabim, gabime fonetikore, shenja pikësimi" | ||
) | ||
.should("exist"); | ||
cy.get('[data-test="editor"]').clear(); | ||
cy.visit("/settings"); | ||
cy.get('[data-test="switch-check-testing"]').should('not.be.checked'); | ||
cy.get('[data-test="switch-check-testing"]').click({ multiple: true, force:true }); | ||
cy.get('[data-test="switch-check-testing"]').should('be.checked'); | ||
cy.visit("/"); | ||
cy.get('[data-test="editor"]').type("Pra shkoi tek zyra. "); | ||
cy.get('[data-test="text-marking-span"]').contains("tek").should("exist"); | ||
cy.get('[data-test="editor"]').type('{enter}'); | ||
|
||
|
||
}); | ||
}); | ||
|
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
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