Skip to content

Commit

Permalink
more disclaimers
Browse files Browse the repository at this point in the history
  • Loading branch information
gluneau committed Aug 15, 2023
1 parent b1fc701 commit 713cd20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/test_specs/dappstaking-transactions.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { clickDisclaimerButton } from 'src/modules/playwright';
import { BrowserContext, Page, expect } from '@playwright/test';
import {
ALICE_ACCOUNT_NAME,
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion tests/test_specs/dappstaking.spec.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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');
Expand All @@ -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' });
Expand All @@ -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' });
Expand All @@ -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' });
Expand Down

0 comments on commit 713cd20

Please sign in to comment.