<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: v1.34.1</li>
<li>Operating System: macOS 13.2.1</li>
<li>Browser: N/A</li>
<li>Other info: Terminal, CLI, Node 18.16.0 LTS</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.js
const { defineConfig } = require('@playwright/test');

module.exports = defineConfig({
    preserveOutput: 'failures-only',
    snapshotPathTemplate: '{testDir}/__snapshots__/{testFilePath}/{arg}{ext}',
    testDir: './assets',
    use: {
        viewport: {
            width: 1440,
            height: 900,
        },
    },
});"><pre class="notranslate"><span class="pl-c">// playwright.config.js</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> defineConfig <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@playwright/test'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-en">defineConfig</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">preserveOutput</span>: <span class="pl-s">'failures-only'</span><span class="pl-kos">,</span>
    <span class="pl-c1">snapshotPathTemplate</span>: <span class="pl-s">'{testDir}/__snapshots__/{testFilePath}/{arg}{ext}'</span><span class="pl-kos">,</span>
    <span class="pl-c1">testDir</span>: <span class="pl-s">'./assets'</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">1440</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-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Test file (self-contained)</strong></p>
<p dir="auto">Simple tests like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="test('builds CSS correctly', () =&gt; {
    expect(fs.readFileSync(`${PUBLIC_PATH}${MANIFEST['build/app/app.css']}`, 'utf-8')).toMatchSnapshot();
});

test('renders homepage correctly', async ({ page }) =&gt; {
    await page.goto('&lt;REMOVED_URL&gt;');
    await expect(page).toHaveScreenshot({ fullPage: true });
});

// Etc..."><pre class="notranslate"><span class="pl-en">test</span><span class="pl-kos">(</span><span class="pl-s">'builds CSS correctly'</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-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">fs</span><span class="pl-kos">.</span><span class="pl-en">readFileSync</span><span class="pl-kos">(</span><span class="pl-s">`<span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">PUBLIC_PATH</span><span class="pl-kos">}</span></span><span class="pl-s1"><span class="pl-kos">${</span><span class="pl-c1">MANIFEST</span><span class="pl-kos">[</span><span class="pl-s">'build/app/app.css'</span><span class="pl-kos">]</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">,</span> <span class="pl-s">'utf-8'</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toMatchSnapshot</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">'renders homepage correctly'</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">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">'&lt;REMOVED_URL&gt;'</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">page</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveScreenshot</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">fullPage</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-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Etc...</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run <code class="notranslate">npx playwright test</code> (executed by <code class="notranslate">yarn test</code>)</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">To start running tests by executing <code class="notranslate">npx playwright test</code>, like it did in previous versions (<code class="notranslate">1.34.0</code> and down).</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Getting the following message:</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="➜ yarn test
Please install @playwright/test package to use Playwright Test.
  npm install -D @playwright/test"><pre class="notranslate">➜ yarn <span class="pl-c1">test</span>
Please install @playwright/test package to use Playwright Test.
  npm install -D @playwright/test</pre></div>
<p dir="auto"><strong>Already rules out a few things</strong></p>
<ol dir="auto">
<li>Reinstalling <code class="notranslate">@playwright/test</code></li>
<li>Completely removing <code class="notranslate">node_modules</code> and reinstalling with <code class="notranslate">yarn</code></li>
<li>Works with <code class="notranslate">yarn add @playwright/test@1.34.0 -D</code></li>
<li>Package <code class="notranslate">playwright</code> is not installed</li>
</ol>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.34.3]</li>
<li>Operating System: [Ubuntu 22.04]</li>
<li>Browser: Chromium</li>
<li>Other info:</li>
</ul>
<p dir="auto">So I'm write a function to copy and paste a string for me from one block to another. It worked find in my local machine using Windows, worked on the old playwright docker image too. But After upgraded to the latest (jammy 22.04) the test failed and trace shows that the copy and paste step not work as expected.</p>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Highlight and Copy text by key.press("Control+C")</li>
<li>Paste text to other field by key.press("Control+V")</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">Pasted successfully</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">There's nothing new pasted on the field</p>