diff --git a/playwright.config-local.ts b/playwright.config-local.ts index 4ca4ec9..92b2413 100644 --- a/playwright.config-local.ts +++ b/playwright.config-local.ts @@ -25,7 +25,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:8080", + baseURL: "http://localhost:8081", /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ trace: "on-first-retry", @@ -91,8 +91,8 @@ export default defineConfig({ */ webServer: { command: - "VITE_APP_SERVER=http://localhost:8080 VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 VITE_PASSKEYS_ENABLED=true npm run dev", - url: "http://localhost:8080", + "VITE_APP_SERVER=http://localhost:8081 VITE_DEFAULT_ENDORSER_API_SERVER=http://localhost:3000 VITE_PASSKEYS_ENABLED=true npm run dev -- --port=8081", + url: "http://localhost:8081", reuseExistingServer: !process.env.CI, }, }); diff --git a/test-playwright/40-add-contact.spec.ts b/test-playwright/40-add-contact.spec.ts index 211bb88..77eeeaa 100644 --- a/test-playwright/40-add-contact.spec.ts +++ b/test-playwright/40-add-contact.spec.ts @@ -200,7 +200,7 @@ test('Add contact, copy details, delete, and import from paste & from file', asy }); -test('Copy contact to clipboard, then import ', async ({ page, context }) => { +test('Copy contact to clipboard, then import ', async ({ page, context }, testInfo) => { await importUser(page, '00'); await page.goto('./account'); @@ -244,7 +244,12 @@ test('Copy contact to clipboard, then import ', async ({ page, context }) => { const clipboardText = await page.evaluate(async () => { return navigator.clipboard.readText(); }); - const PATH_PART = "http://localhost:8080/contact-import/"; + + // look into the playwright.config file for the server URL + const webServer = testInfo.config.webServer; + const clientServerUrl = webServer?.url; + + const PATH_PART = clientServerUrl + "/contact-import/"; expect(clipboardText).toContain(PATH_PART); await page.locator('div[role="alert"] button > svg.fa-xmark').click(); // dismiss alert