Skip to content

Commit

Permalink
Merge branch 'main' into feat/optional-index-canister
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Nov 7, 2024
2 parents fd0e891 + b58b349 commit ada54c2
Show file tree
Hide file tree
Showing 22 changed files with 1,033 additions and 45 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ backend-v*.wasm.gz
pocket-ic

e2e/*-snapshots/*-darwin.png

coverage/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions e2e/transactions-page.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { testWithII } from '@dfinity/internet-identity-playwright';
import { expect } from '@playwright/test';
import { TransactionsPage } from './utils/pages/transactions.page';

testWithII('should display BTC transactions page', async ({ page, iiPage }) => {
const transactionsPage = new TransactionsPage({ page, iiPage, tokenSymbol: 'BTC' });

await transactionsPage.waitForReady();

await expect(page).toHaveScreenshot({ fullPage: true });
});

testWithII('should display ETH transactions page', async ({ page, iiPage }) => {
const transactionsPage = new TransactionsPage({ page, iiPage, tokenSymbol: 'ETH' });

await transactionsPage.waitForReady();

await expect(page).toHaveScreenshot({ fullPage: true });
});

testWithII('should display ICP transactions page', async ({ page, iiPage }) => {
const transactionsPage = new TransactionsPage({ page, iiPage, tokenSymbol: 'ICP' });

await transactionsPage.waitForReady();

await expect(page).toHaveScreenshot({ fullPage: true });
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion e2e/utils/pages/homepage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface HomepageParams {
viewportSize?: ViewportSize;
}

type HomepageLoggedInParams = {
export type HomepageLoggedInParams = {
iiPage: InternetIdentityPage;
} & HomepageParams;

Expand Down Expand Up @@ -277,6 +277,10 @@ export class HomepageLoggedIn extends Homepage {
await expect(qrCodeOutputLocator).toHaveText(qrCode ?? '');
}

async extendWaitForReady(): Promise<void> {
// Extend the waitForReady method in a subclass
}

/**
* @override
*/
Expand All @@ -288,5 +292,7 @@ export class HomepageLoggedIn extends Homepage {
await this.waitForLoaderModal({ state: 'hidden', timeout: 60000 });

await this.waitForTokensInitialization();

await this.extendWaitForReady();
}
}
23 changes: 23 additions & 0 deletions e2e/utils/pages/transactions.page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { TOKEN_CARD } from '../../../src/frontend/src/lib/constants/test-ids.constants';
import { HomepageLoggedIn, type HomepageLoggedInParams } from './homepage.page';

export type TransactionsPageParams = {
tokenSymbol: string;
} & HomepageLoggedInParams;

export class TransactionsPage extends HomepageLoggedIn {
readonly #tokenSymbol: string;

constructor({ page, iiPage, viewportSize, tokenSymbol }: TransactionsPageParams) {
super({ page, iiPage, viewportSize });

this.#tokenSymbol = tokenSymbol;
}

/**
* @override
*/
async extendWaitForReady(): Promise<void> {
await this.clickByTestId(`${TOKEN_CARD}-${this.#tokenSymbol}`);
}
}
Loading

0 comments on commit ada54c2

Please sign in to comment.