-
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.
* add Protection section test * add Titles check * add side menu clickable check * added test ids
- Loading branch information
Showing
4 changed files
with
122 additions
and
14 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,47 @@ | ||
import { viewports } from "../../fixture/main.config"; | ||
import { titles } from "../../fixture/privacy.config"; | ||
|
||
viewports.forEach((viewport) => { | ||
context(`/privacy-policy on ${viewport}`, () => { | ||
beforeEach(() => { | ||
cy.visit("/privacy-policy"); | ||
cy.viewport(<Cypress.ViewportPreset>viewport); | ||
}); | ||
|
||
it("should have Protection section visible", () => { | ||
cy.checkElementVisibilityAndText( | ||
"section-title-privacy-policy-protecting", | ||
"PROTECTING YOUR PRIVACY" | ||
); | ||
cy.checkElementVisibilityAndText( | ||
"section-header-privacy-policy-protecting", | ||
"Privacy Policy" | ||
); | ||
cy.checkElementVisibilityAndText( | ||
"section-desc-privacy-policy-protecting", | ||
"Discover our commitment to protecting your privacy through our strict privacy policy" | ||
); | ||
}); | ||
|
||
it("should have all the expected Titles visible expected text", () => { | ||
titles.forEach((privacyTitle) => { | ||
cy.findByTestId(privacyTitle.id) | ||
.scrollIntoView() | ||
.should("be.visible") | ||
.and("include.text", privacyTitle.title); | ||
}); | ||
}); | ||
|
||
it("should be able to navigate on side menu", () => { | ||
if (viewport === "macbook-16") { | ||
titles.forEach((privacyTitle) => { | ||
cy.findByTestId(privacyTitle.id).click(); | ||
cy.checkElementVisibilityAndHref( | ||
`link-${privacyTitle.id}`, | ||
`#${privacyTitle.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,60 @@ | ||
/* eslint-disable import/prefer-default-export */ | ||
export const titles = [ | ||
{ | ||
id: "introduction", | ||
title: "1. Introduction", | ||
}, | ||
{ | ||
id: "information-collected", | ||
title: | ||
"2. Information collected from all visitors to our website or webapp", | ||
}, | ||
{ | ||
id: "when-information-collected", | ||
title: "3. When is information collected?", | ||
}, | ||
{ | ||
id: "use-of-information", | ||
title: "4. Use of information and details", | ||
}, | ||
{ | ||
id: "security", | ||
title: "5. Security of your personal information", | ||
}, | ||
{ | ||
id: "cookies", | ||
title: "6. Do you use Cookies?", | ||
}, | ||
{ | ||
id: "third-party", | ||
title: "7. Third party disclosure", | ||
}, | ||
{ | ||
id: "links", | ||
title: "8. Links to other websites", | ||
}, | ||
{ | ||
id: "google", | ||
title: "9. Google", | ||
}, | ||
{ | ||
id: "do-not-track", | ||
title: "10. “Do Not Track” signals", | ||
}, | ||
{ | ||
id: "third-party-tracking", | ||
title: "11. Third party behavioural tracking", | ||
}, | ||
{ | ||
id: "access-personal-information", | ||
title: "12. Access to, updating, and non-use of your personal information", | ||
}, | ||
{ | ||
id: "statement", | ||
title: "13. Changes to this statement", | ||
}, | ||
{ | ||
id: "contact-information", | ||
title: "14. Contact information", | ||
}, | ||
]; |
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