Skip to content

Commit

Permalink
fix: fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
jake4take committed Nov 28, 2024
1 parent 77b3614 commit ff82a50
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 51 deletions.
6 changes: 3 additions & 3 deletions playwright-tests/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ STAND_LINK_TYPE=testnet
# Wallet configurations
## Secret phase of the wallet to set up the wallet extension
WALLET_SECRET_PHRASE=
## Wallet password
WALLET_PASSWORD=QwerTY!123!
## Lido rpc private key (ask QA team)
## Wallet password (use minimal 10 symbols with uppercase, lowercase, numbers, and symbols)
WALLET_PASSWORD=
## Drpc private key
RPC_URL_KEY=

# Qase reporter
Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const STAND_TYPE = {
};

export const STAND_LINK = {
testnet: 'https://lidofinance.github.io/',
testnet: 'https://lidofinance.github.io/reef-knot/',
localhost: 'http://localhost:3000/',
};

Expand Down
3 changes: 1 addition & 2 deletions playwright-tests/pages/components/header.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Page } from 'playwright';
import { Locator } from '@playwright/test';
import { Locator, Page } from '@playwright/test';

export class Header {
page: Page;
Expand Down
4 changes: 4 additions & 0 deletions playwright-tests/pages/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './header';
export * from './stats';
export * from './wallet-list-modal';
export * from './wallet-modal';
3 changes: 1 addition & 2 deletions playwright-tests/pages/components/stats.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Page } from 'playwright';
import { Locator } from '@playwright/test';
import { Locator, Page } from '@playwright/test';

export class StatsBlock {
page: Page;
Expand Down
3 changes: 1 addition & 2 deletions playwright-tests/pages/components/wallet-list-modal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Page } from 'playwright';
import { Locator, test } from '@playwright/test';
import { Page, Locator, test } from '@playwright/test';

export class WalletListModal {
page: Page;
Expand Down
3 changes: 1 addition & 2 deletions playwright-tests/pages/components/wallet-modal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Locator } from '@playwright/test';
import { Page } from 'playwright';
import { Page, Locator } from '@playwright/test';

export class WalletModal {
page: Page;
Expand Down
1 change: 1 addition & 0 deletions playwright-tests/pages/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './reefKnot.page';
15 changes: 4 additions & 11 deletions playwright-tests/pages/reefKnot.page.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { Page } from 'playwright';
import { Header } from './components/header';
import { REEF_KNOT_CONFIG } from '../config';
import { WalletListModal } from './components/wallet-list-modal';
import { test } from '@playwright/test';
import { TIMEOUT } from '../test-data/timeout.data';
import { StatsBlock } from './components/stats';
import { WalletModal } from './components/wallet-modal';
import { Header, WalletListModal, StatsBlock, WalletModal } from './components';
import { Page, test } from '@playwright/test';
import { TIMEOUT } from '@test-data';

export class ReefKnotPage {
readonly page: Page;
Expand All @@ -23,9 +18,7 @@ export class ReefKnotPage {
}

async goto(param = '') {
const link =
REEF_KNOT_CONFIG.STAND_LINK_TYPE === 'testnet' ? '/reef-knot' : '';
await this.page.goto(link + param);
await this.page.goto(param);
}

async allowUseCookies() {
Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/services/browser/browser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
WALLET_PAGES,
} from './browser.constants';
import { BrowserContextService } from './browser-context.service';
import { REEF_KNOT_CONFIG } from '../../config';
import { REEF_KNOT_CONFIG } from '@config';

export class BrowserService {
private walletPage: WalletPage;
Expand Down
2 changes: 1 addition & 1 deletion playwright-tests/services/fixture.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { test as base } from '@playwright/test';
import { METAMASK_COMMON_CONFIG } from '@lidofinance/wallets-testing-wallets';
import { ETHEREUM_WIDGET_CONFIG } from '@lidofinance/wallets-testing-widgets';
import { ExtensionService } from '@lidofinance/wallets-testing-extensions';
import { BrowserService } from './browser';
import { BrowserService } from '@browser';
import { ReefKnotService } from './reef-knot.service';

type Fixtures = object;
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions playwright-tests/services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './reef-knot.service';
export * from './fixture.service';
export * from './sdk.service';
export * from './helpers';
7 changes: 3 additions & 4 deletions playwright-tests/services/reef-knot.service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { expect, test } from '@playwright/test';
import { Page } from 'playwright';
import { ReefKnotPage } from '../pages/reefKnot.page';
import { expect, test, Page } from '@playwright/test';
import { ReefKnotPage } from '@pages';
import { WalletPage } from '@lidofinance/wallets-testing-wallets';
import { TIMEOUT } from '../test-data/timeout.data';
import { TIMEOUT } from '@test-data';
import { HDAccount, mnemonicToAccount } from 'viem/accounts';
import { SdkService } from './sdk.service';

Expand Down
4 changes: 2 additions & 2 deletions playwright-tests/services/sdk.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LidoSDK, VIEM_CHAINS } from '@lidofinance/lido-ethereum-sdk';
import { HDAccount, mnemonicToAccount } from 'viem/accounts';
import { HDAccount } from 'viem/accounts';
import { createWalletClient, http } from 'viem';
import { REEF_KNOT_CONFIG } from '../config';
import { REEF_KNOT_CONFIG } from '@config';

global.fetch = fetch;

Expand Down
3 changes: 3 additions & 0 deletions playwright-tests/test-data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from './matomo.data';
export * from './tags.data';
export * from './timeout.data';
11 changes: 5 additions & 6 deletions playwright-tests/tests/connectWallet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { test } from '../services/fixture.service';
import { Tags } from '../test-data/tags.data';
import { ReefKnotPage } from '../pages/reefKnot.page';
import { test, toCut } from '@services';
import { Tags } from '@test-data';
import { ReefKnotPage } from '@pages';
import { expect } from '@playwright/test';
import { REEF_KNOT_CONFIG } from '../config';
import { REEF_KNOT_CONFIG } from '@config';
import { formatEther } from 'viem';
import { toCut } from '../services/helpers/helpers';
import { qase } from 'playwright-qase-reporter';

test.describe.serial(
Expand Down Expand Up @@ -72,7 +71,7 @@ test.describe.serial(
await reefKnotService.walletPage.page.close();
await expect(
reefKnotPage.statsBlock.ethBalance,
'Expected the ETH balance comply with ReefKnot stats block',
'Expected the wallet ETH balance comply with ReefKnot stats block',
).toContainText(walletEthBalance);
});

Expand Down
12 changes: 6 additions & 6 deletions playwright-tests/tests/matomo-event.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { test } from '../services/fixture.service';
import { ReefKnotPage } from '../pages/reefKnot.page';
import { CONFIG_MATOMO_CLICK_TO_WALLET_EVENTS } from '../test-data/matomo.data';
import { test } from '@services';
import { ReefKnotPage } from '@pages';
import { CONFIG_MATOMO_CLICK_TO_WALLET_EVENTS } from '@test-data';
import { expect } from '@playwright/test';
import { Tags } from '../test-data/tags.data';
import { Tags } from '@test-data';
import { qase } from 'playwright-qase-reporter';

test.describe('ReefKnot. Matomo events', async () => {
Expand Down Expand Up @@ -58,8 +58,8 @@ test.describe('ReefKnot. Matomo events', async () => {
test(
qase(431, 'Click to buttons "More wallets" and "Less wallets"'),
async () => {
const expectedMoreWalletsNameParam = 'More Wallets clicked';
const expectedLessWalletsNameParam = 'Less Wallets clicked';
const expectedMoreWalletsNameParam = 'more wallets clicked';
const expectedLessWalletsNameParam = 'less wallets clicked';

await test.step('Open the wallet popup', async () => {
await reefKnotPage.header.connectWalletButton.click();
Expand Down
13 changes: 5 additions & 8 deletions playwright-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@
],
"baseUrl": ".",
"paths": {
"@testData": ["tests/widget/testData"],
"@config": ["tests/widget/config"],
"@pages": ["tests/widget/pages"],
"@elements/*": ["tests/widget/pages/elements/*"],
"@utils/*": ["tests/widget/utils/*"],
"@services": ["tests/widget/services"],
"@testFixture": ["tests/widget/tests/test.fixture"],
"@browser": ["tests/widget/browser"]
"@test-data": ["test-data"],
"@config": ["config"],
"@pages": ["pages"],
"@services": ["services"],
"@browser": ["services/browser"]
}
},
}

0 comments on commit ff82a50

Please sign in to comment.