diff --git a/tests/test_specs/dappstaking-transactions.spec.ts b/tests/test_specs/dappstaking-transactions.spec.ts index ea5a5975a..1cb6984cf 100644 --- a/tests/test_specs/dappstaking-transactions.spec.ts +++ b/tests/test_specs/dappstaking-transactions.spec.ts @@ -1,3 +1,4 @@ +import { clickDisclaimerButton } from 'src/modules/playwright'; import { BrowserContext, Page, expect } from '@playwright/test'; import { ALICE_ACCOUNT_NAME, @@ -42,8 +43,8 @@ const stake = async (page: Page, context: BrowserContext, amount: bigint): Promi test.beforeEach(async ({ page, context }) => { await page.goto('/astar/dapp-staking/discover'); - // Close cookies popup - await page.getByRole('button', { name: 'Accept' }).click(); + // Close disclaimer popup + await clickDisclaimerButton(page); const closeButton = page.getByText('Polkadot.js'); await closeButton.click(); diff --git a/tests/test_specs/dappstaking.spec.ts b/tests/test_specs/dappstaking.spec.ts index f86817b52..47f16e48f 100644 --- a/tests/test_specs/dappstaking.spec.ts +++ b/tests/test_specs/dappstaking.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { checkPolicyInLocalStorage, checkInjectedWeb3 } from 'src/modules/playwright'; +import { clickDisclaimerButton, checkInjectedWeb3 } from 'src/modules/playwright'; test.beforeEach(async ({ page }) => { await page.goto('/astar/dapp-staking/discover'); @@ -39,6 +39,7 @@ test.describe('on dapp staking screen', () => { }); test('should clickable the banner after loading is complete', async ({ page }) => { + await clickDisclaimerButton(page); const closeButton = page.locator('.modal-close'); await closeButton.click(); const bannerCard = page.locator('.wrapper--banners .card:first-child'); @@ -48,6 +49,7 @@ test.describe('on dapp staking screen', () => { }); test('should redirect to dapp page when click the dapp card', async ({ page }) => { + await clickDisclaimerButton(page); const closeButton = page.locator('.modal-close'); await closeButton.click(); await page.waitForSelector('.loader', { state: 'hidden' }); @@ -58,6 +60,7 @@ test.describe('on dapp staking screen', () => { }); test('should display staking button when over the dapp card', async ({ page }) => { + await clickDisclaimerButton(page); const closeButton = page.locator('.modal-close'); await closeButton.click(); await page.waitForSelector('.loader', { state: 'hidden' }); @@ -69,6 +72,7 @@ test.describe('on dapp staking screen', () => { }); test('should clickable item on the on chain data after loading is complete', async ({ page }) => { + await clickDisclaimerButton(page); const closeButton = page.locator('.modal-close'); await closeButton.click(); await page.waitForSelector('.loader', { state: 'hidden' });