Issue 1:
System info

Playwright Version: 1.27.1

Operating System: Windows

Browser: MS Edge

Other info: CI/CD on the GitLab platform using windows image containers

Source code

Config file

// playwright.config.ts
import { PlaywrightTestConfig } from "@playwright/test";

const config: PlaywrightTestConfig = {
timeout: 240000,
globalTimeout: 18000000,
projects: [
{
name: "Esro",
testDir: "./Tests/Esro",
timeout: 300001,
use:{
viewport: {width: 1870, height: 1030},
video: {
mode: "retain-on-failure",
size: {
width: 1870,
height: 1030,
},
},
}
},
{
name: "Tsro",
testDir: "./Tests/Tsro",
timeout: 180000,
},
{
name: 'Unify',
testDir: "./Tests/Unify",
},

{
name: "IntegrationsUI",
testDir: "./Tests/IntegrationsUI",
},

{
name: "Validation",
testMatch: 'Tests/Unify/Validation/test.list.ts',
timeout: 360000,
use: {
actionTimeout: 320000,
}
},
{
name: "Production",
testMatch: 'Tests/Unify/production.test.list.ts',
timeout: 360000,
use: {
actionTimeout: 320000,
}
},

],
reporter: [
["./my-reporter.ts"],
["list"],
["junit", { outputFile: "reports/test-results.xml" }],
["allure-playwright"],
["json", { outputFile: "reports/test-results.json" }],
["html", { open: "never" }],
],
use: {
baseURL: process.env.BASE_URL ? process.env.BASE_URL : process.env.LOCAL_HOST,
browserName: "chromium",
actionTimeout: 30000,
trace: "off",
screenshot: "on",
viewport: { width: 1400, height: 900 }, //UNIFY Recommended Resolution
video: {
mode: "retain-on-failure",
size: {
width: 1400,
height: 900,
},
},
contextOptions: {
ignoreHTTPSErrors: true,
},
// Browser options
launchOptions: {
channel: "msedge",
// headless: process.env.CI ? true : false,
slowMo: 200,
args: [
"--no-sandbox",
"--ignore-certificate-errors",
"--ignore-certificate-errors-skip-list",
],
},
},
};

export default config;

Test file (self-contained)

import test from "@playwright/test";

test.describe("Login Test Feature", () => {
let basePage: BasePage;
let unifyLoginPage: UnifyLoginPage;
let mainPage: UnifyBasePage;

test.beforeEach(async ({page}) => {
basePage = new BasePage(page);
unifyLoginPage = new UnifyLoginPage(page);
mainPage = new UnifyBasePage(page);

await basePage.loadApplication(ApplicationUrl.UNIFY);

});

test.afterEach(async ({context}) => {
await context.clearCookies();
});

test("Login with wrong credentials", async () => {
await unifyLoginPage.loginToUnify("x", "x", Credentials.INCORRECT);
});

test("Login with correct credentials @warmup", async () => {
await unifyLoginPage.loginToUnify();
});
});

Steps

Changing the channel to the msedge

Adding the step of install msedge

Attempting to run the tests

Expected

MSEdge browser should be installed and work

The tests should work as well using the MSEdge browser

Actual

The issue presented like the following:

// The issue as it presented inside the pipeline:

npx playwright install --force msedge

�[36mcore-ui-playwright-server_1 |�[0m Downloading Microsoft Edge

�[36mcore-ui-playwright-server_1 |�[0m Installing Microsoft Edge

�[36mcore-ui-playwright-server_1 |�[0m ERROR: failed to install Microsoft Edge

�[36mcore-ui-playwright-server_1 |�[0m Failed to install browsers

�[36mcore-ui-playwright-server_1 |�[0m Error: Failed to install msedge

// The issue as it presented inside the pipeline, during an attempt to execute tests:

�[36mcore-ui-playwright-server_1 |�[0m �[31m 1) [Esro] ??? Tests\Esro\EsroLoginTest.spec.ts:28:5 ??? Esro Login Tests ??? Login to eSRO with correct credentials @tSRO_AND_eSRO_APPLICATION @warmup �[39m

�[36mcore-ui-playwright-server_1 |�[0m

�[36mcore-ui-playwright-server_1 |�[0m browserType.launch: Chromium distribution 'msedge' is not found at C:\Users\ContainerAdministrator\AppData\Local\Microsoft\Edge\Application\msedge.exe

�[36mcore-ui-playwright-server_1 |�[0m Run "npx playwright install msedge"

�[36mcore-ui-playwright-server_1 |�[0m

�[36mcore-ui-playwright-server_1 |�[0m �[90m at �[39mnode_modules\@playwright\test\lib\index.js:198

�[36mcore-ui-playwright-server_1 |�[0m

�[36mcore-ui-playwright-server_1 |�[0m 196 | }, use) => {

�[36mcore-ui-playwright-server_1 |�[0m 197 | if (!['chromium', 'firefox', 'webkit'].includes(browserName)) throw new Error(`Unexpected browserName "${browserName}", must be one of "chromium", "firefox" or "webkit"`);

�[36mcore-ui-playwright-server_1 |�[0m > 198 | const browser = await playwright[browserName].launch();

�[36mcore-ui-playwright-server_1 |�[0m | ^

�[36mcore-ui-playwright-server_1 |�[0m 199 | await use(browser);

�[36mcore-ui-playwright-server_1 |�[0m 200 | await browser.close();

�[36mcore-ui-playwright-server_1 |�[0m 201 | }, {

});

Looks like we download the browser itself, but there is an issue with the installation,

In the case of using the Chrome channel - it downloaded and executed as well.

Also, the local installation works as well.

Issue 2:
System info

Playwright Version: v1.34.3

Operating System: macOS 11.6.1

Browser: All

Source code

I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.ts
import { defineConfig, devices } from "@playwright/test";
import "dotenv/config";
import { Environment, Modes } from "../common/src/env/env";

const env = new Environment((process.env.ENVIRONMENT as Modes) ?? "development");

export default defineConfig({
testDir: "./tests",
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
reporter: "html",
use: {
baseURL: env.getEnvironmentVariables().WEB_HOST,
trace: "on-first-retry",
},

projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
},
],

});

Test file (self-contained)

import { expect, test } from "@playwright/test";
import config from "../playwright.config";

test("Validate Google Login", async ({ page }) => {
try {
await page.goto("/");
await page.getByRole("button", { name: "LOGIN" }).click();

// login with Google
const userLogin = process.env.GOOGLE_USER;
const userPassword = process.env.GOOGLE_PASSWORD;
if (!userLogin || !userPassword) throw new Error("Test Credentials not set.");

const popupPromise = page.waitForEvent("popup");
await page.getByText("Log in with Google").click();
const popup = await popupPromise;

await popup.fill('input[type="email"]', userLogin);
await popup.getByRole("button", { name: "Next" }).click();
await popup.fill('#password >> input[type="password"]', userPassword);
await popup.locator("#passwordNext").getByRole("button", { name: "Next" }).click();

// wait for Google popup to close, confirming authentication
await expect(page.getByRole("img", { name: "Avatar" })).toBeVisible();

// verify Login;
const baseURL = config.use?.baseURL;
if (!baseURL) throw new Error("Base URL not set.");
await page.goto(`${baseURL}/profile`);
const locator = page.getByRole("heading", { name: "Profile" });
await expect(locator).toBeVisible();
} catch (error) {
console.error("error: ", error);
}
});

Error logs

error: Ze [Error]: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
- expect.toBeVisible with timeout 5000ms
- waiting for getByRole('img', { name: 'Avatar' })

Steps

I have a script that tests a Login with Google functionality. It seemed to work quite well as I was test-running it through the Playwright VS Code extension but when I run the test through the command line, it fails while waiting for a UI element to show after the login popup from Google closes. The error indicates that the page closes as soon as the Google login popup does, which causes the first assertion to timeout.

Expected

For the page to not close prematurely before reaching the end of the test script.

Actual

The page closes even before the script finishes, causing assertions to fail.