Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghislain89 committed Oct 13, 2023
1 parent 92618a3 commit 7b5720a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page } from '@playwright/test';
import type { Page } from '@playwright/test';

export default class CardComponent {
private readonly _page: Page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ export default class NavHeaderComponent {

public constructor(page: Page) {
this._page = page;
this._component = this._page.locator('header')
this._component = this._page.locator('header');
}

public async goTo(link: string): Promise<void> {
return this._component
.getByRole('link', { name: `${link}` })
.click();
return this._component.getByRole('link', { name: `${link}` }).click();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ export default class ToolsHeaderComponent extends NavHeaderComponent {

public constructor(page: Page) {
super(page);
this._page = page
this._page = page;
this.networkCard = new CardComponent(page);
}

public async setNetwork(networkLabel: string): Promise<string[]> {
return this._component
.getByRole('combobox')
.selectOption(networkLabel);
return this._component.getByRole('combobox').selectOption(networkLabel);
}

public async getNetwork(): Promise<Locator> {
Expand All @@ -26,9 +24,7 @@ export default class ToolsHeaderComponent extends NavHeaderComponent {
chainId: string,
host: string,
): Promise<void> {
await this._page
.getByRole('combobox')
.selectOption('+ add network');
await this._page.getByRole('combobox').selectOption('+ add network');
await this.networkCard.setValueForTextbox('Network Label', networkLabel);
await this.networkCard.setValueForTextbox('Network ID', chainId);
await this.networkCard.setValueForTextbox('Network Api', host);
Expand Down
9 changes: 6 additions & 3 deletions packages/tools/e2e-tests/src/tests/tools-app/faucet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ test('Fund existing account @mocks', async ({ page, toolsApp, mockHelper }) => {
await toolsApp.faucetPage.fundAccount(accountsData.publicKey, '0');

await mockHelper.mockResponse('**/poll', pollInProgress);
await expect(page.getByText('Transaction is being processed...')).toBeVisible();
await expect(
page.getByText('Transaction is being processed...'),
).toBeVisible();

await mockHelper.mockResponse('**/poll', pollFinished);
await expect(page.getByText('Transaction successfully completed')).toBeVisible();

await expect(
page.getByText('Transaction successfully completed'),
).toBeVisible();
});
});

0 comments on commit 7b5720a

Please sign in to comment.