Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/cargo/ic-stable-structures-0.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioVentilii authored Dec 3, 2024
2 parents fdbbd70 + 2ed96f8 commit b0f72e5
Show file tree
Hide file tree
Showing 61 changed files with 778 additions and 248 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}

- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}

- name: Prepare
uses: ./.github/actions/prepare
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/auto-update-i18n.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}

- name: Prepare
uses: ./.github/actions/prepare
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}

- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -43,7 +49,7 @@ jobs:
- name: Create Pull Request
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}
branch: "chore(release)/v${{ steps.bump_version.outputs.new_version }}"
title: "chore(release): v${{ steps.bump_version.outputs.new_version }}"
body: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/frontend-remove-unused-components.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
runs-on: ubuntu-24.04

steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
Expand Down Expand Up @@ -37,7 +43,7 @@ jobs:
if: env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}
branch: bot-frontend-remove-unused-svelte-files
title: 'chore(frontend): Remove Unused Svelte Files'
body: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/update-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
rust-update:
runs-on: ubuntu-24.04
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
- uses: actions/checkout@v4

# First, check rust GitHub releases for a new version. We assume that the
Expand Down Expand Up @@ -51,8 +57,8 @@ jobs:
if: ${{ steps.update.outputs.updated == '1' }}
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}
branch: bot-rust-update
title: 'build(backend): Update Rust version'
body: |
A new Rust version available.
A new Rust version available.
9 changes: 8 additions & 1 deletion .github/workflows/update-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ jobs:
echo "This workflow should not be triggered with workflow_dispatch on main"
exit 1
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}

- name: Checkout
if: ${{ github.event_name != 'pull_request' }}
uses: actions/checkout@v4
Expand All @@ -55,7 +62,7 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}

- name: Deploy the backend
uses: ./.github/actions/deploy-backend
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/update-tokens.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
update-tokens-sns:
runs-on: ubuntu-24.04
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
Expand All @@ -28,7 +34,7 @@ jobs:
if: env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}
branch: bot-tokens-sns-update
title: 'feat(frontend): Update Sns Tokens'
body: |
Expand All @@ -37,6 +43,12 @@ jobs:
update-tokens-ckerc20:
runs-on: ubuntu-24.04
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.PR_AUTOMATION_BOT_PUBLIC_APP_ID }}
private-key: ${{ secrets.PR_AUTOMATION_BOT_PUBLIC_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@v4
- name: Prepare
Expand All @@ -58,7 +70,7 @@ jobs:
if: env.CHANGES_DETECTED == 'true'
uses: ./.github/actions/create-pr
with:
token: ${{ secrets.GIX_CREATE_PR_PAT }}
token: ${{ steps.app-token.outputs.token }}
branch: bot-tokens-ckerc20-update
title: 'feat(frontend): Update ckErc20 Tokens'
body: |
Expand Down
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.
2 changes: 1 addition & 1 deletion e2e/transactions-page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ testWithII('should display BTC transactions page', async ({ page, iiPage }) => {
});

// TODO: resolve the below test flakiness
testWithII.skip('should display ETH transactions page', async ({ page, iiPage }) => {
testWithII('should display ETH transactions page', async ({ page, iiPage }) => {
const transactionsPage = new TransactionsPage({ page, iiPage, tokenSymbol: 'ETH' });

await transactionsPage.waitForReady();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions e2e/utils/components/promotion-carousel.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import type { Page } from '@playwright/test';

export class PromotionCarousel {
#page: Page;

constructor(page: Page) {
this.#page = page;
}

public async navigateToSlide(slideNumber: number): Promise<void> {
const navigation1Selector = `[data-tid="carousel-slide-navigation-${slideNumber}"]:visible`;
await this.#page.click(navigation1Selector);
}

public async freezeCarousel(): Promise<void> {
// Freeze the carousel by applying the first slide's transform style to all visible slides
await this.#page.$$eval(`div[data-tid="carousel-slide"]:visible`, (elements) => {
elements.forEach((el) => {
const slideStyle = el.style.transform;
el.style.transform = slideStyle;
});
});
// Freeze the carousel navigation indicators by fixing their current width and background color styles
await this.#page.$$eval(`[data-tid^="carousel-slide-navigation-"]:visible`, (elements) => {
elements.forEach((el) => {
const indicatorWidth = el.style.width;
const indicatorBackgroundColor = el.style.backgroundColor;
el.style.width = indicatorWidth;
el.style.backgroundColor = indicatorBackgroundColor;
});
});
}
}
1 change: 1 addition & 0 deletions e2e/utils/pages/activity.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ export class ActivityPage extends HomepageLoggedIn {
// TODO: Implement this method clicking on the navigation item instead of using the URL, when the activity page is implemented
override async extendWaitForReady(): Promise<void> {
await this.#page.goto(ACTIVITY_URL);
await this.waitForLoadState();
}
}
1 change: 1 addition & 0 deletions e2e/utils/pages/explorer.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ export class ExplorerPage extends HomepageLoggedIn {

override async extendWaitForReady(): Promise<void> {
await this.clickByTestId(NAVIGATION_ITEM_EXPLORER);
await this.waitForLoadState();
}
}
22 changes: 21 additions & 1 deletion e2e/utils/pages/homepage.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import {
TOKEN_CARD
} from '$lib/constants/test-ids.constants';
import { type InternetIdentityPage } from '@dfinity/internet-identity-playwright';
import { nonNullish } from '@dfinity/utils';
import { isNullish, nonNullish } from '@dfinity/utils';
import { expect, type Locator, type Page, type ViewportSize } from '@playwright/test';
import { PromotionCarousel } from '../components/promotion-carousel.component';
import { HOMEPAGE_URL, LOCAL_REPLICA_URL } from '../constants/e2e.constants';
import { getQRCodeValueFromDataURL } from '../qr-code.utils';
import { getReceiveTokensModalQrCodeButtonSelector } from '../selectors.utils';
Expand Down Expand Up @@ -55,6 +56,7 @@ interface WaitForLocatorOptions {
abstract class Homepage {
readonly #page: Page;
readonly #viewportSize?: ViewportSize;
private promotionCarousel?: PromotionCarousel;

protected constructor({ page, viewportSize }: HomepageParams) {
this.#page = page;
Expand Down Expand Up @@ -201,6 +203,19 @@ abstract class Homepage {
await expect(modal).toHaveScreenshot();
}

async setCarouselFirstSlide(): Promise<void> {
if (isNullish(this.promotionCarousel)) {
this.promotionCarousel = new PromotionCarousel(this.#page);
}

await this.promotionCarousel.navigateToSlide(1);
await this.promotionCarousel.freezeCarousel();
}

async waitForLoadState() {
await this.#page.waitForLoadState('networkidle');
}

abstract extendWaitForReady(): Promise<void>;

abstract waitForReady(): Promise<void>;
Expand All @@ -218,6 +233,7 @@ export class HomepageLoggedOut extends Homepage {
*/
async waitForReady(): Promise<void> {
await this.waitForHomepageReady();
await this.waitForLoadState();
}
}

Expand Down Expand Up @@ -299,6 +315,10 @@ export class HomepageLoggedIn extends Homepage {

await this.waitForTokensInitialization();

await this.waitForLoadState();

await this.setCarouselFirstSlide();

await this.extendWaitForReady();
}
}
2 changes: 2 additions & 0 deletions e2e/utils/pages/settings.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ export class SettingsPage extends HomepageLoggedIn {
await this.clickByTestId(NAVIGATION_ITEM_SETTINGS);

await this.mockSelector({ selector: `[data-tid="${SETTINGS_ADDRESS_LABEL}"]` });

await this.waitForLoadState();
}
}
1 change: 1 addition & 0 deletions e2e/utils/pages/transactions.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export class TransactionsPage extends HomepageLoggedIn {

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

0 comments on commit b0f72e5

Please sign in to comment.