From 67026be9598077a083d5ede1bb8d72f8024b6aed Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:03:31 +0100 Subject: [PATCH] Add AfP tests for Payouts and Reports pages (#99) --- tests/afp/dashboard.spec.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/afp/dashboard.spec.js b/tests/afp/dashboard.spec.js index 12ec4e8..fe7cd3f 100644 --- a/tests/afp/dashboard.spec.js +++ b/tests/afp/dashboard.spec.js @@ -37,3 +37,37 @@ test('Transactions', async ({ page }) => { await expect(page.locator('text="My Transactions"')).toBeVisible(); }); +test('Payouts', async ({ page }) => { + await page.goto('/'); + await expect(page).toHaveTitle(/AfP MyPlatform/); + + await page.goto('/login'); + await expect(page.locator('text="Login"')).toBeVisible(); + // perform login + await page.fill('input[name="username"]', utilities.USERNAME); + await page.fill('input[name="password"]', "123"); + await page.getByRole('button', { name: 'Submit' }).click(); + + await expect(page.locator('text="Dashboard"')).toBeVisible(); + + await page.goto('/payouts'); + await expect(page.locator('text="My Payouts"')).toBeVisible(); +}); + +test('Reports', async ({ page }) => { + await page.goto('/'); + await expect(page).toHaveTitle(/AfP MyPlatform/); + + await page.goto('/login'); + await expect(page.locator('text="Login"')).toBeVisible(); + // perform login + await page.fill('input[name="username"]', utilities.USERNAME); + await page.fill('input[name="password"]', "123"); + await page.getByRole('button', { name: 'Submit' }).click(); + + await expect(page.locator('text="Dashboard"')).toBeVisible(); + + await page.goto('/reports'); + await expect(page.locator('text="My Reports"')).toBeVisible(); +}); +