Skip to content

Commit

Permalink
Produch Hub - Updates and temporarili diasbling tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-langa committed Apr 19, 2024
1 parent 0959257 commit 72c155c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/pages/homepage/productHub/header/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, Locator, Page } from '@playwright/test';
import { Locator } from '@playwright/test';
import { Position } from './position';

export class Header {
Expand Down
15 changes: 11 additions & 4 deletions src/pages/homepage/productHub/header/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/noWallet/borrowPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tests/noWallet/earnPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tests/noWallet/header.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ test.describe('Header', async () => {
})
);

// To be UPDATED after 'Improved Product Discovery Experience' release
(
[
{ protocol: 'Aave', product: 'Borrow' },
Expand All @@ -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({
Expand Down
12 changes: 5 additions & 7 deletions tests/noWallet/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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',
Expand Down
3 changes: 2 additions & 1 deletion tests/noWallet/multiplyPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 72c155c

Please sign in to comment.