run the tests on a different port (so there's no conflict when running the development server)

This commit is contained in:
2025-01-09 08:51:09 -07:00
parent 27622ad9e5
commit 00fc80036a
2 changed files with 10 additions and 5 deletions

View File

@@ -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