Skip to content

Commit

Permalink
Merge pull request #2115 from ChainSafe/mnt/add-landing-page-tests-2114
Browse files Browse the repository at this point in the history
[Files] Add landing page tests
  • Loading branch information
juans-chainsafe authored May 4, 2022
2 parents 548b68f + fdb3ab2 commit 82741b1
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ export const authenticationPage = {
showMoreButton: () => cy.get("div.svelte-q1527 > .bn-onboard-custom"),
detectedWallet: () => cy.get(":nth-child(3) > .bn-onboard-custom > span.svelte-1799bj2"),
web3SignInButton: () => cy.get("[data-cy=button-sign-in-with-web3]"),
privacyPolicyLink: () => cy.get("[data-cy=link-privacy-policy]"),
termsAndConditionsLink: () => cy.get("[data-cy=link-terms-and-conditions]"),
learnMoreAboutChainsafeLink: () => cy.get("[data-cy=link-learn-more-about-chainsafe]"),

// sign in section elements
loginPasswordButton: () => cy.get("[data-cy=button-login-password]", { timeout: 20000 }),
Expand Down
25 changes: 25 additions & 0 deletions packages/files-ui/cypress/tests/landing-spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { authenticationPage } from "../support/page-objects/authenticationPage"
import { localHost } from "../fixtures/loginData"

describe("Landing", () => {
beforeEach(() => {
cy.visit(localHost)
})
context("desktop", () => {

it("can navigate to privacy policy page", () => {
authenticationPage.privacyPolicyLink().invoke('removeAttr', 'target').click()
cy.url().should("include", "/privacy-policy")
})

it("can navigate to terms & conditions page", () => {
authenticationPage.termsAndConditionsLink().invoke('removeAttr', 'target').click()
cy.url().should("include", "/terms-of-service")
})

it("can navigate to ChainSafe.io from 'Learn more about Chainsafe'", () => {
authenticationPage.learnMoreAboutChainsafeLink().invoke('removeAttr', 'target').click()
cy.url().should("eq", "https://chainsafe.io/")
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ const InitialScreen = ({ className }: IInitialScreen) => {
href={ROUTE_LINKS.PrivacyPolicy}
target="_blank"
rel="noopener noreferrer"
data-cy="link-privacy-policy"
>
<Typography>
<Trans>Privacy Policy</Trans>
Expand All @@ -546,6 +547,7 @@ const InitialScreen = ({ className }: IInitialScreen) => {
href={ROUTE_LINKS.Terms}
target="_blank"
rel="noopener noreferrer"
data-cy="link-terms-and-conditions"
>
<Typography>
<Trans>Terms and Conditions</Trans>
Expand Down
1 change: 1 addition & 0 deletions packages/files-ui/src/Components/Pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const LoginPage = () => {
href={ROUTE_LINKS.ChainSafe}
target="_blank"
rel="noopener noreferrer"
data-cy="link-learn-more-about-chainsafe"
>
<ChainsafeLogo className={classes.logo} />
<Typography>
Expand Down

0 comments on commit 82741b1

Please sign in to comment.