From a0adc1517c2bf40d407f173113f67dac18ed9dde Mon Sep 17 00:00:00 2001 From: Jose Olarte III Date: Mon, 29 Jul 2024 19:09:56 +0800 Subject: [PATCH] Playwright: check usage limits (no-ID and with-ID) --- test-playwright/15-check-usage-limits.spec.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test-playwright/15-check-usage-limits.spec.ts diff --git a/test-playwright/15-check-usage-limits.spec.ts b/test-playwright/15-check-usage-limits.spec.ts new file mode 100644 index 000000000..f534ed7a4 --- /dev/null +++ b/test-playwright/15-check-usage-limits.spec.ts @@ -0,0 +1,28 @@ +import { test, expect } from '@playwright/test'; + +test('Check usage limits', async ({ page }) => { + // Check without ID first + await page.goto('./account'); + await expect(page.locator('div.bg-slate-100.rounded-md').filter({ hasText: 'Usage Limits' })).toBeHidden(); + + // Create new ID using seed phrase "island fever beef…" + await page.goto('./start'); + await page.getByText('You have a seed').click(); + await page.getByPlaceholder('Seed Phrase').fill('island fever beef wine urban aim vacant quit afford total poem flame service calm better adult neither color gaze forum month sister imitate excite'); + await page.getByRole('button', { name: 'Import' }).click(); + + // Set name + await page.getByRole('link', { name: 'Set Your Name' }).click(); + await page.getByPlaceholder('Name').fill('User One'); + await page.getByRole('button', { name: 'Save Changes' }).click(); + + // Check DID + await expect(page.getByRole('code')).toContainText('did:ethr:0x111d15564f824D56C7a07b913aA7aDd03382aA39'); + + // Verify that "Usage Limits" section is visible + await expect(page.locator('div.bg-slate-100.rounded-md').filter({ hasText: 'Usage Limits' })).toBeVisible(); + await expect(page.getByText('Your claims counter resets')).toBeVisible(); + await expect(page.getByText('Your registration counter resets')).toBeVisible(); + await expect(page.getByText('Your image counter resets')).toBeVisible(); + await expect(page.getByRole('button', { name: 'Recheck Limits' })).toBeVisible(); +}); \ No newline at end of file