From 14885fa595b0e49a3758b178c358d544e33daf50 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Sun, 8 Feb 2026 17:42:43 +0100 Subject: [PATCH 1/2] test: remove Internet Identity usage Signed-off-by: David Dal Busco --- e2e/constants/test-ids.constants.ts | 5 ++- e2e/page-objects/console.page.ts | 26 ++----------- e2e/snapshots.spec.ts | 60 ++++++++++++++--------------- e2e/utils/init.utils.ts | 8 ++-- package-lock.json | 22 ----------- package.json | 1 - 6 files changed, 39 insertions(+), 83 deletions(-) diff --git a/e2e/constants/test-ids.constants.ts b/e2e/constants/test-ids.constants.ts index 4ee4b8a..23e1df7 100644 --- a/e2e/constants/test-ids.constants.ts +++ b/e2e/constants/test-ids.constants.ts @@ -2,7 +2,10 @@ import type {TestIds} from '../types/test-id'; export const testIds = { auth: { - signInII: 'btn-sign-in-ii' + signInDev: 'btn-sign-in-dev', + switchDevAccount: 'btn-switch-account-dev', + inputDevIdentifier: 'input-dev-identifier', + continueDevAccount: 'btn-continue-dev' }, launchpad: { launch: 'btn-launch-first-satellite', diff --git a/e2e/page-objects/console.page.ts b/e2e/page-objects/console.page.ts index 80f2e40..2f901ef 100644 --- a/e2e/page-objects/console.page.ts +++ b/e2e/page-objects/console.page.ts @@ -1,4 +1,3 @@ -import {InternetIdentityPage} from '@dfinity/internet-identity-playwright'; import {notEmptyString} from '@dfinity/utils'; import {PrincipalText, PrincipalTextSchema} from '@dfinity/zod-schemas'; import {expect} from '@playwright/test'; @@ -8,23 +7,13 @@ import {IdentityPage, type IdentityPageParams} from './identity.page'; import {SatellitePage} from './satellite.page'; export class ConsolePage extends IdentityPage { - readonly #consoleIIPage: InternetIdentityPage; - private constructor(params: IdentityPageParams) { super(params); - - this.#consoleIIPage = new InternetIdentityPage({ - page: this.page, - context: this.context, - browser: this.browser - }); } static async initWithSignIn(params: IdentityPageParams): Promise { const consolePage = new ConsolePage(params); - await consolePage.waitReady(); - await consolePage.goto(); await consolePage.signIn(); @@ -36,19 +25,10 @@ export class ConsolePage extends IdentityPage { await this.page.goto(path); } - async signIn(): Promise { - await this.#consoleIIPage.signIn({ - passkey: { - selector: `[data-tid=${testIds.auth.signInII}]` - } - }); - } - - async waitReady(): Promise { - const CONTAINER_URL = 'http://127.0.0.1:5987'; - const INTERNET_IDENTITY_ID = 'rdmx6-jaaaa-aaaaa-aaadq-cai'; + private async signIn(): Promise { + await expect(this.page.getByTestId(testIds.auth.signInDev)).toBeVisible(TIMEOUT_AVERAGE); - await this.#consoleIIPage.waitReady({url: CONTAINER_URL, canisterId: INTERNET_IDENTITY_ID}); + await this.page.getByTestId(testIds.auth.signInDev).click(); } async createSatellite(params: {kind: 'website' | 'application'}): Promise { diff --git a/e2e/snapshots.spec.ts b/e2e/snapshots.spec.ts index bd7aef5..cf9fe76 100644 --- a/e2e/snapshots.spec.ts +++ b/e2e/snapshots.spec.ts @@ -1,16 +1,15 @@ -import {testWithII} from '@dfinity/internet-identity-playwright'; -import {expect} from '@playwright/test'; +import {expect, test} from '@playwright/test'; import {initTestSuite} from './utils/init.utils'; -testWithII.describe.configure({mode: 'serial'}); +test.describe.configure({mode: 'serial'}); const snapshotTests = ({satelliteKind}: {satelliteKind: 'website' | 'application'}) => { - testWithII.describe(`satellite ${satelliteKind}`, () => { + test.describe(`satellite ${satelliteKind}`, () => { const getTestPages = initTestSuite({satelliteKind}); const SNAPSHOT_TARGET = {target: 'satellite' as const}; - testWithII('should create and restore a snapshot', async () => { + test('should create and restore a snapshot', async () => { const {consolePage, cliPage} = getTestPages(); await cliPage.createSnapshot(SNAPSHOT_TARGET); @@ -28,8 +27,8 @@ const snapshotTests = ({satelliteKind}: {satelliteKind: 'website' | 'application await satellitePage.assertScreenshot(); }); - testWithII('should create, download, delete, upload and restore a snapshot', async () => { - testWithII.setTimeout(120_000); + test('should create, download, delete, upload and restore a snapshot', async () => { + test.setTimeout(120_000); const {consolePage, cliPage} = getTestPages(); @@ -57,46 +56,43 @@ const snapshotTests = ({satelliteKind}: {satelliteKind: 'website' | 'application await satellitePage.assertScreenshot(); }); - testWithII( - 'should create, download, delete, upload and restore a snapshot to another satellite', - async () => { - testWithII.setTimeout(120_000); + test('should create, download, delete, upload and restore a snapshot to another satellite', async () => { + test.setTimeout(120_000); - const {consolePage, cliPage} = getTestPages(); + const {consolePage, cliPage} = getTestPages(); - await consolePage.getCycles(); + await consolePage.getCycles(); - await consolePage.goto(); + await consolePage.goto(); - await consolePage.openCreateAdditionalSatelliteWizard({kind: 'application'}); + await consolePage.openCreateAdditionalSatelliteWizard({kind: 'application'}); - const satelliteId = await consolePage.copySatelliteID(); + const satelliteId = await consolePage.copySatelliteID(); - await cliPage.toggleSatelliteId({satelliteId}); + await cliPage.toggleSatelliteId({satelliteId}); - const {accessKey} = await cliPage.whoami(); + const {accessKey} = await cliPage.whoami(); - await consolePage.addSatelliteAdminAccessKey({accessKey, satelliteId}); + await consolePage.addSatelliteAdminAccessKey({accessKey, satelliteId}); - await cliPage.deployHosting({clear: true}); + await cliPage.deployHosting({clear: true}); - await consolePage.goto({path: `/satellite/?s=${satelliteId}`}); + await consolePage.goto({path: `/satellite/?s=${satelliteId}`}); - const satellitePage = await consolePage.visitSatelliteSite({ - title: 'Hello World' - }); - await satellitePage.assertScreenshot(); + const satellitePage = await consolePage.visitSatelliteSite({ + title: 'Hello World' + }); + await satellitePage.assertScreenshot(); - const {snapshotFolder} = await cliPage.getSnapshotFsFolder(); + const {snapshotFolder} = await cliPage.getSnapshotFsFolder(); - await cliPage.uploadSnapshot({...SNAPSHOT_TARGET, folder: snapshotFolder}); + await cliPage.uploadSnapshot({...SNAPSHOT_TARGET, folder: snapshotFolder}); - await cliPage.restoreSnapshot(SNAPSHOT_TARGET); + await cliPage.restoreSnapshot(SNAPSHOT_TARGET); - await satellitePage.reload(); - await satellitePage.assertScreenshot(); - } - ); + await satellitePage.reload(); + await satellitePage.assertScreenshot(); + }); }); }; diff --git a/e2e/utils/init.utils.ts b/e2e/utils/init.utils.ts index 65165c2..51ccaf1 100644 --- a/e2e/utils/init.utils.ts +++ b/e2e/utils/init.utils.ts @@ -1,4 +1,4 @@ -import {testWithII} from '@dfinity/internet-identity-playwright'; +import {test} from '@playwright/test'; import {CliPage} from '../page-objects/cli.page'; import {ConsolePage} from '../page-objects/console.page'; @@ -15,8 +15,8 @@ export const initTestSuite = ({ let consolePage: ConsolePage; let cliPage: CliPage; - testWithII.beforeAll(async ({playwright}) => { - testWithII.setTimeout(120000); + test.beforeAll(async ({playwright}) => { + test.setTimeout(120000); const browser = await playwright.chromium.launch(); @@ -36,7 +36,7 @@ export const initTestSuite = ({ cliPage = await CliPage.initWithEmulatorLogin({satelliteId}); }); - testWithII.afterAll(async () => { + test.afterAll(async () => { const results = await Promise.allSettled([consolePage.close(), cliPage.close()]); if (results.find(({status}) => status === 'rejected')) { diff --git a/package-lock.json b/package-lock.json index 69a6553..4300da6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,6 @@ "juno": "dist/index.js" }, "devDependencies": { - "@dfinity/internet-identity-playwright": "^3.0.0-next-2026-01-31", "@eslint/eslintrc": "^3.3.3", "@eslint/js": "^9.39.2", "@junobuild/functions": "^0.5.5", @@ -668,20 +667,6 @@ "integrity": "sha512-GPJpH73kDEKbUBdUjY80lz7cq9l0vm1h/7ppejPV6O0ZTqCLrYspssYvqjRmK4aNnJ/SKXsP0rg9LYX7zpegaA==", "license": "Apache-2.0" }, - "node_modules/@dfinity/internet-identity-playwright": { - "version": "3.0.0-next-2026-01-31", - "resolved": "https://registry.npmjs.org/@dfinity/internet-identity-playwright/-/internet-identity-playwright-3.0.0-next-2026-01-31.tgz", - "integrity": "sha512-agJcgDZWf9EyfuDHd72mCiofxaENVYpngn3oHnZ2+Pa4t2khtNkhehB+hgJ/B7C18HuBpr6Pk/O9Fl4DmOwbDg==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=24", - "npm": ">=11.5.1 <12.0.0" - }, - "peerDependencies": { - "@playwright/test": "^1.52.0" - } - }, "node_modules/@dfinity/utils": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@dfinity/utils/-/utils-4.1.0.tgz", @@ -6976,13 +6961,6 @@ "resolved": "https://registry.npmjs.org/@dfinity/cbor/-/cbor-0.2.2.tgz", "integrity": "sha512-GPJpH73kDEKbUBdUjY80lz7cq9l0vm1h/7ppejPV6O0ZTqCLrYspssYvqjRmK4aNnJ/SKXsP0rg9LYX7zpegaA==" }, - "@dfinity/internet-identity-playwright": { - "version": "3.0.0-next-2026-01-31", - "resolved": "https://registry.npmjs.org/@dfinity/internet-identity-playwright/-/internet-identity-playwright-3.0.0-next-2026-01-31.tgz", - "integrity": "sha512-agJcgDZWf9EyfuDHd72mCiofxaENVYpngn3oHnZ2+Pa4t2khtNkhehB+hgJ/B7C18HuBpr6Pk/O9Fl4DmOwbDg==", - "dev": true, - "requires": {} - }, "@dfinity/utils": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@dfinity/utils/-/utils-4.1.0.tgz", diff --git a/package.json b/package.json index 65a6ce1..cb55f64 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ "zod": "^4.3.5" }, "devDependencies": { - "@dfinity/internet-identity-playwright": "^3.0.0-next-2026-01-31", "@eslint/eslintrc": "^3.3.3", "@eslint/js": "^9.39.2", "@junobuild/functions": "^0.5.5", From b11f3043ce6011c3f281d7739b89df62fdd00af6 Mon Sep 17 00:00:00 2001 From: David Dal Busco Date: Sun, 8 Feb 2026 18:00:36 +0100 Subject: [PATCH 2/2] test: custom id for login Signed-off-by: David Dal Busco --- e2e/page-objects/console.page.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/e2e/page-objects/console.page.ts b/e2e/page-objects/console.page.ts index 2f901ef..374e51c 100644 --- a/e2e/page-objects/console.page.ts +++ b/e2e/page-objects/console.page.ts @@ -26,9 +26,19 @@ export class ConsolePage extends IdentityPage { } private async signIn(): Promise { - await expect(this.page.getByTestId(testIds.auth.signInDev)).toBeVisible(TIMEOUT_AVERAGE); + await expect(this.page.getByTestId(testIds.auth.switchDevAccount)).toBeVisible(TIMEOUT_AVERAGE); - await this.page.getByTestId(testIds.auth.signInDev).click(); + await this.page.getByTestId(testIds.auth.switchDevAccount).click(); + + await expect(this.page.getByTestId(testIds.auth.inputDevIdentifier)).toBeVisible(); + + await this.page + .getByTestId(testIds.auth.inputDevIdentifier) + .fill(crypto.randomUUID().replaceAll('-', '')); + + await expect(this.page.getByTestId(testIds.auth.continueDevAccount)).toBeVisible(); + + await this.page.getByTestId(testIds.auth.continueDevAccount).click(); } async createSatellite(params: {kind: 'website' | 'application'}): Promise {