From 72c155cb89a04215bbdb28a4bba4c866a64d8651 Mon Sep 17 00:00:00 2001 From: juan-langa Date: Fri, 19 Apr 2024 12:25:36 +0200 Subject: [PATCH] Produch Hub - Updates and temporarili diasbling tests --- src/pages/homepage/productHub/header/index.ts | 2 +- src/pages/homepage/productHub/header/position.ts | 15 +++++++++++---- tests/noWallet/borrowPage.spec.ts | 3 ++- tests/noWallet/earnPage.spec.ts | 3 ++- tests/noWallet/header.spec.ts | 3 ++- tests/noWallet/homepage.spec.ts | 12 +++++------- tests/noWallet/multiplyPage.spec.ts | 3 ++- 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/pages/homepage/productHub/header/index.ts b/src/pages/homepage/productHub/header/index.ts index fe3abb0..9bee47e 100644 --- a/src/pages/homepage/productHub/header/index.ts +++ b/src/pages/homepage/productHub/header/index.ts @@ -1,4 +1,4 @@ -import { expect, Locator, Page } from '@playwright/test'; +import { Locator } from '@playwright/test'; import { Position } from './position'; export class Header { diff --git a/src/pages/homepage/productHub/header/position.ts b/src/pages/homepage/productHub/header/position.ts index 67c6419..ca352c4 100644 --- a/src/pages/homepage/productHub/header/position.ts +++ b/src/pages/homepage/productHub/header/position.ts @@ -9,10 +9,17 @@ export class Position { } @step - async shouldBe(positionCategory: 'Borrow' | 'Multiply' | 'Earn') { - await expect(this.positionLocator.locator('span').nth(0)).toContainText(positionCategory, { - timeout: 15_000, - }); + async shouldBe(positionCategory: 'borrow' | 'earn' | 'multiply') { + const introText = { + borrow: 'Easily borrow stablecoins or other crypto-assets against your collateral', + earn: 'Earn long term yields to compound your crypto capital', + multiply: + 'Multiply allows you to simply and securely increase your exposure to any crypto asset', + }; + await expect( + this.positionLocator.getByText(introText[positionCategory]), + `'introText[positionCategory]' should be visible` + ).toBeVisible(); } @step diff --git a/tests/noWallet/borrowPage.spec.ts b/tests/noWallet/borrowPage.spec.ts index a1827ed..c26ede3 100644 --- a/tests/noWallet/borrowPage.spec.ts +++ b/tests/noWallet/borrowPage.spec.ts @@ -2,7 +2,8 @@ import { test } from '#noWalletFixtures'; import { extremelyLongTestTimeout, longTestTimeout, veryLongTestTimeout } from 'utils/config'; test.describe('Borrow page', async () => { - test('It should list only Borrow positions', async ({ app }) => { + // To be removed after 'Improved Product Discovery Experience' release + test.skip('It should list only Borrow positions', async ({ app }) => { test.setTimeout(longTestTimeout); await app.borrow.open(); diff --git a/tests/noWallet/earnPage.spec.ts b/tests/noWallet/earnPage.spec.ts index 455005e..23ac9e5 100644 --- a/tests/noWallet/earnPage.spec.ts +++ b/tests/noWallet/earnPage.spec.ts @@ -2,7 +2,8 @@ import { test } from '#noWalletFixtures'; import { longTestTimeout } from 'utils/config'; test.describe('Earn page', async () => { - test('It should list only Earn positions', async ({ app }) => { + // To be removed after 'Improved Product Discovery Experience' release + test.skip('It should list only Earn positions', async ({ app }) => { test.setTimeout(longTestTimeout); await app.earn.open(); diff --git a/tests/noWallet/header.spec.ts b/tests/noWallet/header.spec.ts index 44f289d..7bcd0a7 100644 --- a/tests/noWallet/header.spec.ts +++ b/tests/noWallet/header.spec.ts @@ -51,6 +51,7 @@ test.describe('Header', async () => { }) ); + // To be UPDATED after 'Improved Product Discovery Experience' release ( [ { protocol: 'Aave', product: 'Borrow' }, @@ -64,7 +65,7 @@ test.describe('Header', async () => { { protocol: 'Spark', product: 'Earn' }, ] as const ).forEach(({ protocol, product }) => - test(`It should open ${product} page and list only ${protocol} ${product} positions`, async ({ + test.skip(`It should open ${product} page and list only ${protocol} ${product} positions`, async ({ app, }) => { test.info().annotations.push({ diff --git a/tests/noWallet/homepage.spec.ts b/tests/noWallet/homepage.spec.ts index d9286f2..98d2bb4 100644 --- a/tests/noWallet/homepage.spec.ts +++ b/tests/noWallet/homepage.spec.ts @@ -16,15 +16,12 @@ test.describe('Homepage', async () => { }); test('It should list Earn positions by default', async ({ app }) => { - test.setTimeout(longTestTimeout); - - await app.homepage.open(); - await app.homepage.productHub.header.position.shouldBe('Earn'); - await app.homepage.productHub.list.allPoolsShouldBe('Earn'); + await app.homepage.productHub.header.position.shouldBe('earn'); }); + // To be removed after 'Improved Product Discovery Experience' release (['Borrow', 'Multiply', 'Earn'] as const).forEach((positionCategory) => - test(`It should list only ${positionCategory} positions`, async ({ app }) => { + test.skip(`It should list only ${positionCategory} positions`, async ({ app }) => { test.setTimeout(longTestTimeout); await app.homepage.open(); @@ -33,8 +30,9 @@ test.describe('Homepage', async () => { }) ); + // To be UPDATED after 'Improved Product Discovery Experience' release (['Borrow', 'Multiply', 'Earn'] as const).forEach((positionCategory) => - test(`It should link to ${positionCategory} page`, async ({ app }) => { + test.skip(`It should link to ${positionCategory} page`, async ({ app }) => { test.info().annotations.push({ type: 'Test case', description: '12334', diff --git a/tests/noWallet/multiplyPage.spec.ts b/tests/noWallet/multiplyPage.spec.ts index 73abb55..2d7eef1 100644 --- a/tests/noWallet/multiplyPage.spec.ts +++ b/tests/noWallet/multiplyPage.spec.ts @@ -2,7 +2,8 @@ import { test } from '#noWalletFixtures'; import { longTestTimeout } from 'utils/config'; test.describe('Multiply page', async () => { - test('It should list only Multiply positions', async ({ app }) => { + // To be removed after 'Improved Product Discovery Experience' release + test.skip('It should list only Multiply positions', async ({ app }) => { test.setTimeout(longTestTimeout); await app.multiply.open();