From 284d1d3946b9d7c8a0b678a962390424fbacaab1 Mon Sep 17 00:00:00 2001 From: Dhaiwat Date: Wed, 15 May 2024 04:20:41 +0530 Subject: [PATCH] update test logic --- e2e-tests/example.spec.ts | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/e2e-tests/example.spec.ts b/e2e-tests/example.spec.ts index b92ddb4627f..ddc2e142ce3 100644 --- a/e2e-tests/example.spec.ts +++ b/e2e-tests/example.spec.ts @@ -1,18 +1,21 @@ import { test, expect } from '@playwright/test'; test('has title', async ({ page }) => { - await page.goto('http://localhost:3000/'); + await page.goto('http://localhost:3000/', { waitUntil: 'networkidle' }); - const title = page.getByRole('heading', { name: 'Welcome to Fuel' }); - expect(title).toBeVisible(); -}); + await page.waitForTimeout(2000); + + const topUpWalletButton = page.getByText('Top-up Wallet'); + await topUpWalletButton.click(); -// test('get started link', async ({ page }) => { -// await page.goto('https://playwright.dev/'); + await page.reload(); -// // Click the get started link. -// await page.getByRole('link', { name: 'Get started' }).click(); + await page.waitForTimeout(2000); -// // Expects page to have a heading with the name of Installation. -// await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -// }); + const incrementButton = page.getByText('Increment Counter'); + await incrementButton.click(); + + // the counter should be incremented + const counter = page.getByText('1'); + await expect(counter).toBeVisible(); +});