<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.27.1</li>
<li>Operating System: Windows</li>
<li>Browser:  MS Edge</li>
<li>Other info: CI/CD on the GitLab platform using windows image containers</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { PlaywrightTestConfig } from &quot;@playwright/test&quot;;

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

        {
            name: &quot;IntegrationsUI&quot;,
            testDir: &quot;./Tests/IntegrationsUI&quot;,
        },

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

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

export default config;
"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-v">PlaywrightTestConfig</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">config</span>: <span class="pl-v">PlaywrightTestConfig</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    <span class="pl-c1">timeout</span>: <span class="pl-c1">240000</span><span class="pl-kos">,</span>
    <span class="pl-c1">globalTimeout</span>: <span class="pl-c1">18000000</span><span class="pl-kos">,</span>
    <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">"Esro"</span><span class="pl-kos">,</span>
            <span class="pl-c1">testDir</span>: <span class="pl-s">"./Tests/Esro"</span><span class="pl-kos">,</span>
            <span class="pl-c1">timeout</span>: <span class="pl-c1">300001</span><span class="pl-kos">,</span>
            <span class="pl-c1">use</span>:<span class="pl-kos">{</span>
                <span class="pl-c1">viewport</span>: <span class="pl-kos">{</span><span class="pl-c1">width</span>: <span class="pl-c1">1870</span><span class="pl-kos">,</span> <span class="pl-c1">height</span>: <span class="pl-c1">1030</span><span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-c1">video</span>: <span class="pl-kos">{</span>
                    <span class="pl-c1">mode</span>: <span class="pl-s">"retain-on-failure"</span><span class="pl-kos">,</span>
                    <span class="pl-c1">size</span>: <span class="pl-kos">{</span>
                        <span class="pl-c1">width</span>: <span class="pl-c1">1870</span><span class="pl-kos">,</span>
                        <span class="pl-c1">height</span>: <span class="pl-c1">1030</span><span class="pl-kos">,</span>
                    <span class="pl-kos">}</span><span class="pl-kos">,</span>
                <span class="pl-kos">}</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">"Tsro"</span><span class="pl-kos">,</span>
            <span class="pl-c1">testDir</span>: <span class="pl-s">"./Tests/Tsro"</span><span class="pl-kos">,</span>
            <span class="pl-c1">timeout</span>: <span class="pl-c1">180000</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">'Unify'</span><span class="pl-kos">,</span>
            <span class="pl-c1">testDir</span>: <span class="pl-s">"./Tests/Unify"</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">"IntegrationsUI"</span><span class="pl-kos">,</span>
            <span class="pl-c1">testDir</span>: <span class="pl-s">"./Tests/IntegrationsUI"</span><span class="pl-kos">,</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">"Validation"</span><span class="pl-kos">,</span>
            <span class="pl-c1">testMatch</span>: <span class="pl-s">'Tests/Unify/Validation/test.list.ts'</span><span class="pl-kos">,</span>
            <span class="pl-c1">timeout</span>: <span class="pl-c1">360000</span><span class="pl-kos">,</span>
            <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
                <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">320000</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>
        <span class="pl-kos">{</span>
            <span class="pl-c1">name</span>: <span class="pl-s">"Production"</span><span class="pl-kos">,</span>
            <span class="pl-c1">testMatch</span>: <span class="pl-s">'Tests/Unify/production.test.list.ts'</span><span class="pl-kos">,</span>
            <span class="pl-c1">timeout</span>: <span class="pl-c1">360000</span><span class="pl-kos">,</span>
            <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
                <span class="pl-c1">actionTimeout</span>: <span class="pl-c1">320000</span><span class="pl-kos">,</span>
            <span class="pl-kos">}</span>
        <span class="pl-kos">}</span><span class="pl-kos">,</span>

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

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-s1">config</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import test from &quot;@playwright/test&quot;;

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

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

        await basePage.loadApplication(ApplicationUrl.UNIFY);
        
    });

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

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

    test(&quot;Login with correct credentials @warmup&quot;, async () =&gt; {
        await unifyLoginPage.loginToUnify();
    });
});
"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">test</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>

<span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">describe</span><span class="pl-kos">(</span><span class="pl-s">"Login Test Feature"</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">let</span> <span class="pl-s1">basePage</span>: <span class="pl-v">BasePage</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-s1">unifyLoginPage</span>: <span class="pl-v">UnifyLoginPage</span><span class="pl-kos">;</span>
    <span class="pl-k">let</span> <span class="pl-s1">mainPage</span>: <span class="pl-v">UnifyBasePage</span><span class="pl-kos">;</span>

    <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">beforeEach</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>page<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-s1">basePage</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">BasePage</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-s1">unifyLoginPage</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">UnifyLoginPage</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-s1">mainPage</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">UnifyBasePage</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

        <span class="pl-k">await</span> <span class="pl-s1">basePage</span><span class="pl-kos">.</span><span class="pl-en">loadApplication</span><span class="pl-kos">(</span><span class="pl-v">ApplicationUrl</span><span class="pl-kos">.</span><span class="pl-c1">UNIFY</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-en">afterEach</span><span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span>context<span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">clearCookies</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"Login with wrong credentials"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-k">await</span> <span class="pl-s1">unifyLoginPage</span><span class="pl-kos">.</span><span class="pl-en">loginToUnify</span><span class="pl-kos">(</span><span class="pl-s">"x"</span><span class="pl-kos">,</span> <span class="pl-s">"x"</span><span class="pl-kos">,</span> <span class="pl-v">Credentials</span><span class="pl-kos">.</span><span class="pl-c1">INCORRECT</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"Login with correct credentials @warmup"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
        <span class="pl-k">await</span> <span class="pl-s1">unifyLoginPage</span><span class="pl-kos">.</span><span class="pl-en">loginToUnify</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Changing the channel to the <code class="notranslate">msedge</code></li>
<li>Adding the step of <code class="notranslate">install msedge</code></li>
<li>Attempting to run the tests</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<ul dir="auto">
<li>MSEdge browser should be installed and work</li>
<li>The tests should work as well using the MSEdge browser</li>
<li></li>
</ul>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">The issue presented like the following:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// 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 &quot;npx playwright install msedge&quot;

�[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) =&gt; {

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

�[36mcore-ui-playwright-server_1  |�[0m       &gt; 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 |   }, {


});"><pre class="notranslate"><span class="pl-c">// The issue as it presented inside the pipeline:</span>

<span class="pl-s1">npx</span> <span class="pl-s1">playwright</span> <span class="pl-s1">install</span> <span class="pl-c1">--</span><span class="pl-s1">force</span> <span class="pl-s1">msedge</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-v">Downloading</span> <span class="pl-v">Microsoft</span> <span class="pl-v">Edge</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-v">Installing</span> <span class="pl-v">Microsoft</span> <span class="pl-v">Edge</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-c1">ERROR</span>: <span class="pl-s1">failed</span> <span class="pl-s1">to</span> <span class="pl-s1">install</span> <span class="pl-v">Microsoft</span> <span class="pl-v">Edge</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-v">Failed</span> <span class="pl-s1">to</span> <span class="pl-s1">install</span> <span class="pl-s1">browsers</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-v">Error</span>: <span class="pl-v">Failed</span> <span class="pl-s1">to</span> <span class="pl-s1">install</span> <span class="pl-s1">msedge</span>


<span class="pl-c">// The issue as it presented inside the pipeline, during an attempt to execute tests:</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   <span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">31</span><span class="pl-s1">m</span>  <span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-kos">[</span><span class="pl-v">Esro</span><span class="pl-kos">]</span> <span class="pl-c1">??</span>? <span class="pl-v">Tests</span>\E<span class="pl-s1">sro</span>\E<span class="pl-s1">sroLoginTest</span><span class="pl-kos">.</span><span class="pl-c1">spec</span><span class="pl-kos">.</span><span class="pl-c1">ts</span>:<span class="pl-c1">28</span>:<span class="pl-c1">5</span> <span class="pl-c1">??</span>? <span class="pl-v">Esro</span> <span class="pl-v">Login</span> <span class="pl-v">Tests</span> <span class="pl-c1">??</span>? <span class="pl-v">Login</span> <span class="pl-s1">to</span> <span class="pl-s1">eSRO</span> <span class="pl-s1">with</span> <span class="pl-s1">correct</span> <span class="pl-s1">credentials</span> @<span class="pl-s1">tSRO_AND_eSRO_APPLICATION</span> @<span class="pl-s1">warmup</span> <span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">39</span><span class="pl-s1">m</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>       <span class="pl-s1">browserType</span><span class="pl-kos">.</span><span class="pl-c1">launch</span>: <span class="pl-v">Chromium</span> <span class="pl-s1">distribution</span> <span class="pl-s">'msedge'</span> <span class="pl-s1">is</span> <span class="pl-s1">not</span> <span class="pl-s1">found</span> <span class="pl-s1">at</span> <span class="pl-v">C</span>:\U<span class="pl-s1">sers</span>\C<span class="pl-s1">ontainerAdministrator</span>\A<span class="pl-s1">ppData</span>\L<span class="pl-s1">ocal</span>\M<span class="pl-s1">icrosoft</span>\E<span class="pl-s1">dge</span>\A<span class="pl-s1">pplication</span>\m<span class="pl-s1">sedge</span><span class="pl-kos">.</span><span class="pl-c1">exe</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>       <span class="pl-v">Run</span> <span class="pl-s">"npx playwright install msedge"</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>       <span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">90</span><span class="pl-s1">m</span>   <span class="pl-s1">at</span> <span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">39</span><span class="pl-s1">mnode_modules</span>\@<span class="pl-s1">playwright</span>\t<span class="pl-s1">est</span>\l<span class="pl-s1">ib</span>\i<span class="pl-s1">ndex</span><span class="pl-kos">.</span><span class="pl-c1">js</span>:<span class="pl-c1">198</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>   

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>         <span class="pl-c1">196</span> <span class="pl-c1">|</span>   <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">use</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>         <span class="pl-c1">197</span> <span class="pl-c1">|</span>     <span class="pl-en">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-kos">[</span><span class="pl-s">'chromium'</span><span class="pl-kos">,</span> <span class="pl-s">'firefox'</span><span class="pl-kos">,</span> <span class="pl-s">'webkit'</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">includes</span><span class="pl-kos">(</span><span class="pl-s1">browserName</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-s1">throw</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-s">`Unexpected browserName "<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">browserName</span><span class="pl-kos">}</span></span>", must be one of "chromium", "firefox" or "webkit"`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>       <span class="pl-c1">&gt;</span> <span class="pl-c1">198</span> <span class="pl-c1">|</span>     <span class="pl-s1">const</span> <span class="pl-s1">browser</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">playwright</span><span class="pl-kos">[</span><span class="pl-s1">browserName</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">launch</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>             <span class="pl-c1">|</span>                                                   <span class="pl-c1">^</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>         <span class="pl-c1">199</span> <span class="pl-c1">|</span>     <span class="pl-k">await</span> <span class="pl-en">use</span><span class="pl-kos">(</span><span class="pl-s1">browser</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>         <span class="pl-c1">200</span> <span class="pl-c1">|</span>     <span class="pl-k">await</span> <span class="pl-s1">browser</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">36</span><span class="pl-s1">mcore</span><span class="pl-c1">-</span><span class="pl-s1">ui</span><span class="pl-c1">-</span><span class="pl-s1">playwright</span><span class="pl-c1">-</span><span class="pl-s1">server_1</span>  <span class="pl-c1">|</span><span class="pl-s1">�</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-s1">m</span>         <span class="pl-c1">201</span> <span class="pl-c1">|</span>   <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>


<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Looks like we download the browser itself, but there is an issue with the installation,<br>
In the case of using the Chrome channel - it downloaded and executed as well.</p>
<p dir="auto">Also, the local installation works as well.</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.34.3</li>
<li>Operating System: macOS 11.6.1</li>
<li>Browser: All</li>
</ul>
<h3 dir="auto">Source code</h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Config file</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// playwright.config.ts
import { defineConfig, devices } from &quot;@playwright/test&quot;;
import &quot;dotenv/config&quot;;
import { Environment, Modes } from &quot;../common/src/env/env&quot;;


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

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

  projects: [
    {
      name: &quot;chromium&quot;,
      use: { ...devices[&quot;Desktop Chrome&quot;] },
    },

    {
      name: &quot;firefox&quot;,
      use: { ...devices[&quot;Desktop Firefox&quot;] },
    },

    {
      name: &quot;webkit&quot;,
      use: { ...devices[&quot;Desktop Safari&quot;] },
    },
  ],

});
"><pre class="notranslate"><span class="pl-c">// playwright.config.ts</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">defineConfig</span><span class="pl-kos">,</span> <span class="pl-s1">devices</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s">"dotenv/config"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">Environment</span><span class="pl-kos">,</span> <span class="pl-smi">Modes</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"../common/src/env/env"</span><span class="pl-kos">;</span>


<span class="pl-k">const</span> <span class="pl-s1">env</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Environment</span><span class="pl-kos">(</span><span class="pl-kos">(</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">ENVIRONMENT</span> <span class="pl-k">as</span> <span class="pl-smi">Modes</span><span class="pl-kos">)</span> <span class="pl-c1">??</span> <span class="pl-s">"development"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
  <span class="pl-c1">testDir</span>: <span class="pl-s">"./tests"</span><span class="pl-kos">,</span>
  <span class="pl-c1">fullyParallel</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
  <span class="pl-c1">forbidOnly</span>: <span class="pl-c1">!</span><span class="pl-c1">!</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span><span class="pl-kos">,</span>
  <span class="pl-c1">retries</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">2</span> : <span class="pl-c1">0</span><span class="pl-kos">,</span>
  <span class="pl-c1">workers</span>: <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">CI</span> ? <span class="pl-c1">1</span> : <span class="pl-c1">undefined</span><span class="pl-kos">,</span>
  <span class="pl-c1">reporter</span>: <span class="pl-s">"html"</span><span class="pl-kos">,</span>
  <span class="pl-c1">use</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">baseURL</span>: <span class="pl-s1">env</span><span class="pl-kos">.</span><span class="pl-en">getEnvironmentVariables</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">WEB_HOST</span><span class="pl-kos">,</span>
    <span class="pl-c1">trace</span>: <span class="pl-s">"on-first-retry"</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-c1">projects</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">"chromium"</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">"Desktop Chrome"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">"firefox"</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">"Desktop Firefox"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>

    <span class="pl-kos">{</span>
      <span class="pl-c1">name</span>: <span class="pl-s">"webkit"</span><span class="pl-kos">,</span>
      <span class="pl-c1">use</span>: <span class="pl-kos">{</span> ...<span class="pl-s1">devices</span><span class="pl-kos">[</span><span class="pl-s">"Desktop Safari"</span><span class="pl-kos">]</span> <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>

<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { expect, test } from &quot;@playwright/test&quot;;
import config from &quot;../playwright.config&quot;;

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

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

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

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

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

    // verify Login;
    const baseURL = config.use?.baseURL;
    if (!baseURL) throw new Error(&quot;Base URL not set.&quot;);
    await page.goto(`${baseURL}/profile`);
    const locator = page.getByRole(&quot;heading&quot;, { name: &quot;Profile&quot; });
    await expect(locator).toBeVisible();
  } catch (error) {
    console.error(&quot;error: &quot;, error);
  }
});"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-s1">expect</span><span class="pl-kos">,</span> <span class="pl-s1">test</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">"@playwright/test"</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s1">config</span> <span class="pl-k">from</span> <span class="pl-s">"../playwright.config"</span><span class="pl-kos">;</span>

<span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">"Validate Google Login"</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">{</span> page <span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">try</span> <span class="pl-kos">{</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">"/"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">"button"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"LOGIN"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-c">// login with Google</span>
    <span class="pl-k">const</span> <span class="pl-s1">userLogin</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">GOOGLE_USER</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">userPassword</span> <span class="pl-c1">=</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">env</span><span class="pl-kos">.</span><span class="pl-c1">GOOGLE_PASSWORD</span><span class="pl-kos">;</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">userLogin</span> <span class="pl-c1">||</span> <span class="pl-c1">!</span><span class="pl-s1">userPassword</span><span class="pl-kos">)</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">Error</span><span class="pl-kos">(</span><span class="pl-s">"Test Credentials not set."</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">const</span> <span class="pl-s1">popupPromise</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">waitForEvent</span><span class="pl-kos">(</span><span class="pl-s">"popup"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByText</span><span class="pl-kos">(</span><span class="pl-s">"Log in with Google"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">popup</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">popupPromise</span><span class="pl-kos">;</span>

    <span class="pl-k">await</span> <span class="pl-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">fill</span><span class="pl-kos">(</span><span class="pl-s">'input[type="email"]'</span><span class="pl-kos">,</span> <span class="pl-s1">userLogin</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">"button"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"Next"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">fill</span><span class="pl-kos">(</span><span class="pl-s">'#password &gt;&gt; input[type="password"]'</span><span class="pl-kos">,</span> <span class="pl-s1">userPassword</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">popup</span><span class="pl-kos">.</span><span class="pl-en">locator</span><span class="pl-kos">(</span><span class="pl-s">"#passwordNext"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">"button"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"Next"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">click</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-c">// wait for Google popup to close, confirming authentication</span>
    <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">"img"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"Avatar"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBeVisible</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-c">// verify Login;</span>
    <span class="pl-k">const</span> <span class="pl-s1">baseURL</span> <span class="pl-c1">=</span> <span class="pl-s1">config</span><span class="pl-kos">.</span><span class="pl-c1">use</span><span class="pl-kos">?.</span><span class="pl-c1">baseURL</span><span class="pl-kos">;</span>
    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-c1">!</span><span class="pl-s1">baseURL</span><span class="pl-kos">)</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-smi">Error</span><span class="pl-kos">(</span><span class="pl-s">"Base URL not set."</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">baseURL</span><span class="pl-kos">}</span></span>/profile`</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">locator</span> <span class="pl-c1">=</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">getByRole</span><span class="pl-kos">(</span><span class="pl-s">"heading"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">name</span>: <span class="pl-s">"Profile"</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">locator</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toBeVisible</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">error</span><span class="pl-kos">(</span><span class="pl-s">"error: "</span><span class="pl-kos">,</span> <span class="pl-s1">error</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Error logs</strong></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error:  Ze [Error]: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
  - expect.toBeVisible with timeout 5000ms
  - waiting for getByRole('img', { name: 'Avatar' })"><pre class="notranslate"><code class="notranslate">error:  Ze [Error]: Timed out 5000ms waiting for expect(received).toBeVisible()
Call log:
  - expect.toBeVisible with timeout 5000ms
  - waiting for getByRole('img', { name: 'Avatar' })
</code></pre></div>
<p dir="auto"><strong>Steps</strong><br>
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.</p>
<p dir="auto"><strong>Expected</strong><br>
For the page to not close prematurely before reaching the end of the test script.</p>
<p dir="auto"><strong>Actual</strong><br>
The page closes even before the script finishes, causing assertions to fail.</p>