From c5bdf10503ac9a3810d47b7869c905f3e31afc45 Mon Sep 17 00:00:00 2001 From: Roland Moldovan Date: Tue, 2 Dec 2025 15:09:15 +0200 Subject: [PATCH] re-enable native auth test after fix --- playwright.config.ts | 6 +++--- src/app/dashboard/page.tsx | 3 ++- tests/support/metaMask/setupMetaMaskWallet.ts | 2 +- tests/support/template/testdata.ts | 8 ++++---- tests/templateActions/nativeAuth.spec.ts | 13 +++++-------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/playwright.config.ts b/playwright.config.ts index c4a60e3..bd79a2f 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -33,7 +33,7 @@ export default defineConfig({ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ - baseURL: 'http://localhost:3000', + baseURL: 'https://localhost:3002', ignoreHTTPSErrors: true, /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ @@ -64,8 +64,8 @@ export default defineConfig({ } ], webServer: { - command: 'yarn next start', - url: 'http://localhost:3000', + command: 'yarn start:devnet', + url: 'https://localhost:3002', timeout: 120 * 1000, reuseExistingServer: !process.env.CI, stdout: 'pipe', diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index a0c316b..fdcb0a7 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -58,7 +58,8 @@ const WIDGETS: WidgetType[] = [ widget: NativeAuth, description: 'A secure authentication token can be used to interact with the backend', - reference: 'https://github.com/multiversx/mx-sdk-js-native-auth-server' + reference: 'https://github.com/multiversx/mx-sdk-js-native-auth-server', + anchor: 'native-auth' }, { title: 'Batch Transactions', diff --git a/tests/support/metaMask/setupMetaMaskWallet.ts b/tests/support/metaMask/setupMetaMaskWallet.ts index 7e2e8ef..4eb5922 100644 --- a/tests/support/metaMask/setupMetaMaskWallet.ts +++ b/tests/support/metaMask/setupMetaMaskWallet.ts @@ -111,6 +111,6 @@ async function fillFirstSecretRecoveryPhraseWord(page: Page, mnemonic: string) { await srpInput.click(); const [firstWord] = mnemonic.split(' '); - await srpInput.type(firstWord); + await srpInput.fill(firstWord); await srpInput.press('Enter'); } diff --git a/tests/support/template/testdata.ts b/tests/support/template/testdata.ts index 70b6098..4451829 100644 --- a/tests/support/template/testdata.ts +++ b/tests/support/template/testdata.ts @@ -12,13 +12,13 @@ export const NA = 'N/A'; export enum OriginPageEnum { multiversxWallet = 'devnet-wallet.multiversx.com', - templateHome = 'localhost:3000/home', - templateDashboard = 'localhost:3000/dashboard', - templateUnlock = 'localhost:3000/unlock' + templateHome = 'https://localhost:3002/home', + templateDashboard = 'https://localhost:3002/dashboard', + templateUnlock = 'https://localhost:3002/unlock' } export const UrlRegex = { - templateDashboard: /localhost:3000\/dashboard/, + templateDashboard: /https:\/\/localhost:3002\/dashboard/, multiversxWallet: /devnet-wallet\.multiversx\.com/ } as const; diff --git a/tests/templateActions/nativeAuth.spec.ts b/tests/templateActions/nativeAuth.spec.ts index 5854344..a56e6a8 100644 --- a/tests/templateActions/nativeAuth.spec.ts +++ b/tests/templateActions/nativeAuth.spec.ts @@ -9,9 +9,7 @@ const keystoreConfig = { address: TestDataEnums.keystoreWalletAddress1 }; -// TODO: Unable to load profile error appears -> check if this is a known issue -// and then adjust the test accordingly (if necessary) -test.describe.skip('Native auth', () => { +test.describe('Native auth', () => { test.beforeEach(async ({ page }) => { await TestActions.navigateToConnectWallet(page); await TestActions.connectWebWallet({ page, loginMethod: keystoreConfig }); @@ -38,11 +36,10 @@ test.describe.skip('Native auth', () => { await expect(container).toBeInViewport(); // Check that the address is displayed and matches the account address - const nativeAuthAddress = page - .locator(SelectorsEnum.nativeAuthContainer) - .getByTestId(SelectorsEnum.trimFullAddress); - - await expect(nativeAuthAddress).toHaveText(keystoreConfig.address); + const addressRow = page.locator(`${SelectorsEnum.nativeAuthContainer} p`, { + hasText: 'Address:' + }); + await expect(addressRow).toContainText(keystoreConfig.address); // Check that the balance is displayed and matches the account balance const nativeAuthBalance = await extractBalanceFromContainer({