-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: adding cypress tests for feature filtering (#25)
* feat: when initializing astral added options to filter which widgets to see, also added more detail in readme * chore: enabled all widgets * chore: changed variable name, docs: updated README file * test: adding cypress tests to check if enabling of features work --------- Co-authored-by: smalik <[email protected]>
- Loading branch information
1 parent
76ff85d
commit 4f0e6c5
Showing
4 changed files
with
139 additions
and
1 deletion.
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
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,113 @@ | ||
describe("tests the enabling of different features", () => { | ||
it("passes", () => { | ||
//checks contract component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { enabledFeatures: ["Contrast"] }); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-contrast"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks screen reader component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Screen Reader"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-screen-reader"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks saturation component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Saturation"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-saturate"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks text size component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Bigger Text"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-text-size"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks text spacing component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Text Spacing"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-text-spacing"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks screen mask component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Screen Mask"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-screen-mask"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-line-height").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
|
||
//checks line height component | ||
cy.visit(Cypress.env("blankUrl")).then(() => { | ||
cy.window().invoke("initializeAstral", { | ||
enabledFeatures: ["Line Height"], | ||
}); | ||
}); | ||
cy.waitForResource("main.js"); | ||
cy.document().find("astral-line-height"); | ||
cy.get("astral-screen-reader").should("not.exist"); | ||
cy.get("astral-contrast").should("not.exist"); | ||
cy.get("astral-saturate").should("not.exist"); | ||
cy.get("astral-text-size").should("not.exist"); | ||
cy.get("astral-text-spacing").should("not.exist"); | ||
cy.get("astral-screen-mask").should("not.exist"); | ||
cy.clearLocalStorage(); | ||
}); | ||
}); |
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,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Astral Accessibility</title> | ||
<link rel="stylesheet" href="styles.css" /> | ||
</head> | ||
<body> | ||
<p>Filter Feature Test</p> | ||
<script src="main.js"></script> | ||
</body> | ||
</html> |