-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added titles check tests; * added titles check tests; * added fixture for whitepaper; * add sidemenu navigation test (skip for now); * add comment * added test ids * update navigation on sidemenu test * update scroll flow for navigation test
- Loading branch information
Showing
5 changed files
with
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { whitepaperTitles } from "../fixture/whitepaper.config"; | ||
|
||
const viewports = ["macbook-16", "iphone-xr", "ipad-2"]; | ||
|
||
viewports.forEach((viewport) => { | ||
context(`/white-paper on ${viewport}`, () => { | ||
beforeEach(() => { | ||
cy.visit("/white-paper"); | ||
cy.viewport(<Cypress.ViewportPreset>viewport); | ||
}); | ||
|
||
it("should have Documentation section visible expected text", () => { | ||
cy.checkElementVisibilityAndText( | ||
"section-title-white-paper-documentation", | ||
"DOCUMENTATION FOR DEFICHAIN ECOSYSTEM" | ||
); | ||
cy.checkElementVisibilityAndText( | ||
"section-header-white-paper-documentation", | ||
"Whitepaper" | ||
); | ||
}); | ||
|
||
it("should have all the expected Titles visible expected text", () => { | ||
whitepaperTitles.forEach((wpTitle) => { | ||
cy.findByTestId(wpTitle.id) | ||
.scrollIntoView() | ||
.should("be.visible") | ||
.and("include.text", wpTitle.text); | ||
}); | ||
}); | ||
|
||
it("should be able to navigate on sidemenu", () => { | ||
if (viewport === "macbook-16") { | ||
whitepaperTitles.forEach((wpTitle) => { | ||
cy.findByTestId(`link-${wpTitle.id}`) | ||
.scrollIntoView() | ||
.and("have.attr", "href") | ||
.and("include", `#${wpTitle.id}`); | ||
}); | ||
} | ||
}); | ||
}); | ||
}); |
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,16 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
export const whitepaperTitles = [ | ||
{ id: "abstract", text: "1. Abstract" }, | ||
{ id: "executive-summary", text: "2. Executive summary" }, | ||
{ id: "background", text: "3. Background/Industry" }, | ||
{ id: "alternatives", text: "4. Comparing existing DeFi alternatives" }, | ||
{ id: "solution", text: "5. DeFiChain Solution" }, | ||
{ id: "design", text: "6. DeFiChain Design" }, | ||
{ id: "building-blocks", text: "7. DeFi Building Blocks" }, | ||
{ id: "dfi-coin", text: "8. $DFI coin" }, | ||
{ id: "defichain-foundation", text: "9. DeFiChain Foundation" }, | ||
{ id: "marketing", text: "10. Marketing" }, | ||
{ id: "roadmap", text: "11. Roadmap and Milestones" }, | ||
{ id: "future", text: "12. A Glimpse into the Future" }, | ||
{ id: "footnotes", text: "13. Footnotes" }, | ||
]; |
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