From 7dfc377610879f367ed8c87be329935ca81e58fe Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Fri, 26 Jul 2024 18:51:28 +0800 Subject: [PATCH] Playwright: check no-ID messaging --- test-playwright/00-confirm-test-api.spec.ts | 2 +- .../03-check-noid-messaging.spec.ts | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test-playwright/03-check-noid-messaging.spec.ts diff --git a/test-playwright/00-confirm-test-api.spec.ts b/test-playwright/00-confirm-test-api.spec.ts index 57fb14f55..4631b7bb9 100644 --- a/test-playwright/00-confirm-test-api.spec.ts +++ b/test-playwright/00-confirm-test-api.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from '@playwright/test'; test('Confirm usage of test API', async ({ page }) => { - // Load app homepage + // Load account view await page.goto('./account'); await page.getByRole('heading', { name: 'Advanced' }).click(); await expect(page.getByRole('textbox').nth(1)).toHaveValue('https://test-api.endorser.ch'); diff --git a/test-playwright/03-check-noid-messaging.spec.ts b/test-playwright/03-check-noid-messaging.spec.ts new file mode 100644 index 000000000..751a12878 --- /dev/null +++ b/test-playwright/03-check-noid-messaging.spec.ts @@ -0,0 +1,20 @@ +import { test, expect } from '@playwright/test'; + +test('Check no-ID messaging in homepage', async ({ page }) => { + // Load app homepage + await page.goto('./'); + + // Check 'someone must register you' notice + await expect(page.getByText('To share, someone must register you.')).toBeVisible(); +}); + +test('Check no-ID messaging in account', async ({ page }) => { + // Load account view + await page.goto('./account'); + + // Check 'someone must register you' notice + await expect(page.getByText('Note: Before you can share with others or take any action, you need an identifier.')).toBeVisible(); + + // Check 'a friend needs to register you' notice + await expect(page.getByText('Note: Before you can publicly announce a new project or time commitment, a friend needs to register you.')).toBeVisible(); +}); \ No newline at end of file