Skip to content

Commit

Permalink
Merge pull request argentlabs#1987 from argentlabs/tests/check-links
Browse files Browse the repository at this point in the history
test: check privacy statement and help links
  • Loading branch information
canlopes committed Apr 4, 2023
2 parents db0ba6a + ef5a610 commit 2294168
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/extension/e2e/src/languages/ILanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface ILanguage {
save: string
create: string
cancel: string
privacyStatement: string
}
account: {
noAccounts: string
Expand Down
2 changes: 2 additions & 0 deletions packages/extension/e2e/src/languages/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const texts = {
save: "Save",
create: "Create",
cancel: "Cancel",
privacyStatement:
"GDPR statement for browser extension wallet: Argent takes the privacy and security of individuals very seriously and takes every reasonable measure and precaution to protect and secure the personal data that we process. The browser extension wallet does not collect any personal information nor does it correlate any of your personal information with anonymous data processed as part of its services. On top of this Argent has robust information security policies and procedures in place to make sure any processing complies with applicable laws. If you would like to know more or have any questions then please visit our website at https://www.argent.xyz/",
},
account: {
noAccounts: "You have no accounts on ",
Expand Down
20 changes: 20 additions & 0 deletions packages/extension/e2e/src/page-objects/Settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,24 @@ export default class Settings {
get copy() {
return this.page.locator(`button:text-is("${lang.settings.copy}")`)
}

get help() {
return this.page.getByRole("link", { name: "Help" })
}

get discord() {
return this.page.getByRole("link", { name: "Discord" })
}

get github() {
return this.page.getByRole("link", { name: "Github" })
}

get privacyStatement() {
return this.page.getByRole("link", { name: "Privacy Statement" })
}

get privacyStatementText() {
return this.page.locator('[aria-label="privacyStatementText"]')
}
}
15 changes: 15 additions & 0 deletions packages/extension/e2e/src/page-objects/Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export default class Wallet extends Navigation {
)
}

get privacyStatement() {
return this.page.getByRole("link", { name: "Privacy Statement" })
}

get privacyStatementText() {
return this.page.locator('[aria-label="privacyStatementText"]')
}

//third screen
get banner3() {
return this.page.locator(`div h1:text-is("${lang.wallet.banner3}")`)
Expand Down Expand Up @@ -90,6 +98,13 @@ export default class Wallet extends Navigation {
expect(this.banner2).toBeVisible(),
expect(this.description2).toBeVisible(),
])
await expect(this.privacyStatement).toBeVisible()
await this.privacyStatement.click()
await expect(this.privacyStatementText).toHaveText(
lang.common.privacyStatement,
)

await this.page.locator('button:text-is("Back")').click()
await this.disclaimerLostOfFunds.click()
await this.disclaimerAlphaVersion.click()
await this.continue.click()
Expand Down
24 changes: 24 additions & 0 deletions packages/extension/e2e/src/specs/links.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { expect } from "@playwright/test"

import { lang } from "../languages"
import test from "../test"

test.describe("Links", () => {
test("Check settings links", async ({ extension }) => {
await extension.wallet.newWalletOnboarding()
await extension.open()
await extension.navigation.showSettings.click()
let href = await extension.settings.discord.getAttribute("href")
expect(href).toContain("https://discord.gg/T4PDFHxm6T")
href = await extension.settings.help.getAttribute("href")
expect(href).toContain(
"https://support.argent.xyz/hc/en-us/categories/5767453283473-Argent-X",
)
href = await extension.settings.github.getAttribute("href")
expect(href).toContain("https://github.com/argentlabs/argent-x/issues")
await extension.settings.privacyStatement.click()
await expect(extension.settings.privacyStatementText).toHaveText(
lang.common.privacyStatement,
)
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Container = styled.span`

export const PrivacyStatementText: FC = () => {
return (
<Container>
<Container aria-label="privacyStatementText">
GDPR statement for browser extension wallet: Argent takes the privacy and
security of individuals very seriously and takes every reasonable measure
and precaution to protect and secure the personal data that we process.
Expand Down

0 comments on commit 2294168

Please sign in to comment.