Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d878942
feat(e2e): add Playwright configuration and setup for end-to-end testing
CaioBalieir0 Jun 25, 2025
597cf13
feat(e2e): implement home page tests
CaioBalieir0 Jun 26, 2025
fc654ca
feat(e2e): implement home page tests with fund return functionality
CaioBalieir0 Jun 27, 2025
576e518
fix(tests): update search an existing profile
CaioBalieir0 Jul 2, 2025
83f23cb
feat(tests): add profile editing functionality
CaioBalieir0 Jul 8, 2025
12ff7ec
chore(tests): update Playwright configuration
CaioBalieir0 Jul 8, 2025
0e597b7
feat(tests): add validation for searching handles
CaioBalieir0 Jul 11, 2025
932f935
feat(tests): add test for creating new handle to other resolver
CaioBalieir0 Jul 24, 2025
83f3a2b
feat(e2e): create new handle with bako safe
CaioBalieir0 Jul 29, 2025
c0998d2
feat(e2e): add paralel test execution
CaioBalieir0 Jul 30, 2025
150d21b
chore: resolve pnpm-lock conflict
luisburigo Jul 31, 2025
ddb54a8
Merge remote-tracking branch 'origin/preview' into tests
luisburigo Jul 31, 2025
82b07a0
chore: resolve pnpm-lock conflict
luisburigo Jul 31, 2025
56eb480
Merge branch 'tests' of github.com:infinitybase/bako-id into tests
CaioBalieir0 Aug 1, 2025
d3e4623
chore: change route rewrites
luisburigo Aug 1, 2025
e9c50d8
chore(e2e): move test files to a new folder
CaioBalieir0 Aug 1, 2025
235a65e
Merge branch 'tests' of github.com:infinitybase/bako-id into tests
CaioBalieir0 Aug 1, 2025
d4689ce
test(e2e): add tests for connecting and minting NFTs with Fuel Wallet
CaioBalieir0 Aug 7, 2025
7f75ef1
chore: update Playwright workflow
CaioBalieir0 Aug 19, 2025
f6379ef
chore: update Playwright workflow
CaioBalieir0 Aug 19, 2025
ca6ed69
Merge branch 'main' into tests
CaioBalieir0 Aug 19, 2025
09adb41
chore: pnpm-lock
CaioBalieir0 Aug 20, 2025
002b002
chore: update Playwright test path for fuel-wallet
CaioBalieir0 Aug 20, 2025
057942a
chore: use xvfb-run for Playwright tests in workflow
CaioBalieir0 Aug 20, 2025
30236f4
chore: update workflow and set test to run only for specific case
CaioBalieir0 Aug 28, 2025
4076eef
chore: refactor tests and merge reports in pipeline
CaioBalieir0 Aug 29, 2025
dee947c
chore: remove forbidOnly option from Playwright config
CaioBalieir0 Aug 29, 2025
81d3280
chore: update Playwright workflow and simplify fuel wallet test logic
CaioBalieir0 Aug 29, 2025
7c28dab
chore: add helper function to retrieve multiple wallet addresses and …
CaioBalieir0 Aug 31, 2025
9a9cae2
chore: update screenshot setting in Playwright config and comment out…
CaioBalieir0 Sep 1, 2025
9647b16
chore: enable only the 'search an existing profile' test for focused …
CaioBalieir0 Sep 1, 2025
62c8a84
chore: refactor fuel wallet tests to restore afterEach logic and remo…
CaioBalieir0 Sep 1, 2025
727abfb
chore: comment out afterEach logic and enable focused execution for p…
CaioBalieir0 Sep 1, 2025
e0023e7
chore: testing create new handle to other resolver
CaioBalieir0 Sep 1, 2025
8c6eebb
chore: rename test cases for clarity and update network switching logic
CaioBalieir0 Sep 1, 2025
408ae64
chore: update fuel wallet test to handle dialog closure and streamlin…
CaioBalieir0 Sep 1, 2025
fac156b
chore: refactor tests to utilize NewHandleService and clean up helper…
CaioBalieir0 Sep 10, 2025
0d8c831
chore: setup wallet in tests
CaioBalieir0 Sep 10, 2025
d6fc56c
chore: only create new handle
CaioBalieir0 Sep 10, 2025
e2b9ecd
chore: update save button selectors to use exact match for improved r…
CaioBalieir0 Sep 10, 2025
fccb922
chore: run all fuel wallet tests
CaioBalieir0 Sep 11, 2025
a383a2b
chore: improve wallet connection tests and enhance button interactions
CaioBalieir0 Sep 12, 2025
a299bda
feat: add tests for creating and searching new handles in bako safe
CaioBalieir0 Sep 16, 2025
3bb7b56
chore(test): update dependencies
CaioBalieir0 Sep 17, 2025
aca40f2
feat(tests): add tests for editing resolver and ownership
CaioBalieir0 Sep 17, 2025
f72c581
chore(tests): reduce Playwright timeout
CaioBalieir0 Sep 18, 2025
9ead2a2
Merge remote-tracking branch 'origin/main' into tests
CaioBalieir0 Sep 18, 2025
92af64c
feat(tests): implement global setup for Fuel Wallet extension and upd…
CaioBalieir0 Sep 18, 2025
c459942
fix(tests): adjust Playwright worker count and remove 'only' from tes…
CaioBalieir0 Sep 18, 2025
2629cf9
fix(tests): adjust retries for CI and update test visibility timeout
CaioBalieir0 Sep 18, 2025
8e2a8da
fix(tests): increase retries for non-CI environments and remove 'only…
CaioBalieir0 Sep 18, 2025
e93e3e5
fix(tests): refactort tests and enable retry on CI
CaioBalieir0 Sep 18, 2025
766afd4
fix(tests): enable focused tests for handle creation and resolver edi…
CaioBalieir0 Sep 19, 2025
296ed74
fix(tests): remove 'only' from test cases and enhance clipboard addre…
CaioBalieir0 Sep 19, 2025
aed6297
fix(tests): ownership
CaioBalieir0 Sep 22, 2025
7db804e
fix(tests): update handle visibility check to include '@' prefix
CaioBalieir0 Sep 22, 2025
2a049b2
fix(tests): fix pipeline bakoid tests
CaioBalieir0 Sep 24, 2025
ff38a23
fix(tests): adjust timeout in Playwright config and enhance wallet di…
CaioBalieir0 Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Playwright Tests
on:
pull_request:
branches: ['**']
workflow_dispatch:

jobs:
fuel:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm install -g pnpm && pnpm install

- name: Install Chromium
run: |
cd apps/ui/
pnpm exec playwright install chromium --with-deps

- name: Run Playwright tests
run: |
cd apps/ui/
xvfb-run -a pnpm exec playwright test tests/bako-id/fuel-wallet.test.ts

- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: blob-report-fuel
path: apps/ui/blob-report
retention-days: 1

merge-reports:
if: ${{ !cancelled() }}
needs: [fuel]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: |
cd apps/ui/
npm install -g pnpm && pnpm install

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: apps/ui/all-blob-reports
pattern: blob-report-*
merge-multiple: true

- name: Merge into HTML Report
run: |
cd apps/ui/
pnpm exec playwright merge-reports --reporter html ./all-blob-reports

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report
path: apps/ui/playwright-report
retention-days: 14
7 changes: 7 additions & 0 deletions apps/ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ dist-ssr

routeTree.gen.ts
.vercel

# Playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
.cache
6 changes: 5 additions & 1 deletion apps/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview",
"test:e2e": "playwright test"
},
"dependencies": {
"@bako-id/contracts": "workspace:*",
Expand Down Expand Up @@ -46,9 +47,12 @@
"zustand": "^5.0.7"
},
"devDependencies": {
"@fuels/playwright-utils": "^0.57.1",
"@playwright/test": "^1.53.1",
"@tanstack/react-query-devtools": "^5.59.16",
"@tanstack/router-vite-plugin": "^1.16.5",
"@types/lodash": "^4.17.0",
"@types/node": "^24.0.3",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@types/react-text-mask": "^5.4.14",
Expand Down
21 changes: 21 additions & 0 deletions apps/ui/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { defineConfig } from '@playwright/test';

export default defineConfig({
globalSetup: './tests/ultils/global-setup.ts',
testDir: './tests',
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 2 : 1,
timeout: 150000,
expect: {
timeout: 8000,
},
reporter: 'blob',
use: {
headless: true,
screenshot: 'only-on-failure',
trace: process.env.CI ? 'on-first-retry' : 'retain-on-failure',
baseURL: 'https://preview.bako.id/',
permissions: ['clipboard-read', 'clipboard-write'],
},
});
83 changes: 83 additions & 0 deletions apps/ui/tests/bako-id/bako.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { test, expect } from '@playwright/test';
import { AuthTestService } from '../ultils/service/auth-service';
import { getVaultAddress, transfer } from '../ultils/helpers';
import { Provider, Wallet } from 'fuels';
import { NewHandleService } from '../ultils/service/new-handle';

test.describe('Connect with Bako Safe', () => {
test.fixme('create new bako user', async ({ context }) => {
const bakoIdPage = await context.newPage();
const bakoSafePage = await context.newPage();
await bakoIdPage.goto('/');

await test.step('connect in Bako', async () => {
await expect(bakoIdPage.getByText('Search new Handle')).toBeVisible();
await bakoIdPage.getByRole('button', { name: 'Connect Wallet' }).click();
await bakoIdPage.getByLabel('Connect to Bako Safe').click();
const popup = await bakoIdPage.waitForEvent('popup');
await AuthTestService.loginAuth(popup);

await expect(
bakoIdPage.getByRole('button', { name: 'My Handles' }),
).toBeVisible();

await bakoSafePage.goto('https://safe.bako.global/home');
});

const newHandle = `automation${Date.now()}`;
console.log('new handle: ', newHandle);

await test.step('create new handle', async () => {
await bakoIdPage
.getByRole('textbox', { name: 'Search for an available Handle' })
.fill(newHandle);
await bakoIdPage.waitForTimeout(3000);
await bakoIdPage
.getByRole('button', {
name: 'Continue',
})
.click();

await expect(bakoIdPage.getByText(newHandle)).toBeVisible({
timeout: 10000,
});
await expect(bakoIdPage.getByText('Handles0.001 ETH')).toBeVisible();

const vaultAddress = await getVaultAddress(bakoSafePage);

const { value } = await NewHandleService.getValueNewHandle(bakoIdPage);

const provider = new Provider('http://testnet.fuel.network/v1/graphql');
const genesisWallet = Wallet.fromPrivateKey(
'0x5ac4a3075cfeb0a1238efc082978aa6a7a2efe11e6f2ce2b564d708807fab6ad',
provider,
);
await transfer(genesisWallet, value, vaultAddress);

await bakoIdPage
.getByRole('button', { name: 'Confirm Transaction' })
.click();
await bakoIdPage
.getByLabel('Bako ID Terms Of Use Agreement')
.locator('div')
.filter({ hasText: '1. The Bako IDThe “Bako ID”' })
.nth(2)
.evaluate((el) => {
el.scrollTop = el.scrollHeight;
});
const client = await bakoSafePage.context().newCDPSession(bakoSafePage);
await client.send('WebAuthn.enable');
await client.send('WebAuthn.addVirtualAuthenticator', {
options: {
protocol: 'ctap2',
transport: 'internal',
hasResidentKey: true,
hasUserVerification: true,
isUserVerified: true,
automaticPresenceSimulation: true,
},
});
await bakoIdPage.getByRole('button', { name: 'Accept' }).click();
});
});
});
Loading
Loading