<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.34.4</li>
<li>Operating System: macOS 13.4</li>
<li>Browser: N/A</li>
<li>Other info:</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>Link to the GitHub repository with the repro</strong></p>
<p dir="auto"><a href="https://github.com/OliverJAsh/playwright-vs-code-extension-list-files-issue">https://github.com/OliverJAsh/playwright-vs-code-extension-list-files-issue</a></p>
<p dir="auto">This is a brand new Playwright project created using <code class="notranslate">yarn create playwright</code>. The only changes on top of this are:</p>
<ul dir="auto">
<li><a href="https://github.com/OliverJAsh/playwright-vs-code-extension-list-files-issue/commit/d884ab90be92199401cf173c278d098cd1a26711">Use <code class="notranslate">dotenv</code></a></li>
<li><a href="https://github.com/OliverJAsh/playwright-vs-code-extension-list-files-issue/commit/43d5c5ee6c7c5749d4565e9af4e7bfe030d0d8ff">Add <code class="notranslate">tsconfig.json</code></a></li>
</ul>
<p dir="auto"><strong>Steps</strong></p>
<ol dir="auto">
<li>Clone the project</li>
<li>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ yarn
$ tsc"><pre class="notranslate">$ <span class="pl-s1">yarn</span>
$ <span class="pl-s1">tsc</span></pre></div>
</li>
<li>Open VS Code</li>
</ol>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">The tests load, or if the tests fail to load, an error message should appear.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">The tests never load, nor is there an error message to indicate an error occurred.</p>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/921609/243645005-d8286032-32d3-402a-90fa-06c381e62694.png"><img width="444" alt="image" src="https://user-images.githubusercontent.com/921609/243645005-d8286032-32d3-402a-90fa-06c381e62694.png" style="max-width: 100%;"></a>
<p dir="auto"><strong>Notes</strong></p>
<p dir="auto">This issue started when I upgraded from 1.33.0 to 1.34.4.</p>
<p dir="auto">I spent some time trying to debug this. In developer tools we can see this error message: <code class="notranslate">e.projects is not iterable</code>.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/921609/243646815-b1a6c814-b3ee-44ef-acfb-e45d5a4ded45.png"><img src="https://user-images.githubusercontent.com/921609/243646815-b1a6c814-b3ee-44ef-acfb-e45d5a4ded45.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">I modified the extension to log the value of <code class="notranslate">e</code>:</p>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/921609/243647276-5522ac2f-c1dc-451a-9b00-f35cc562b8eb.png"><img width="788" alt="image" src="https://user-images.githubusercontent.com/921609/243647276-5522ac2f-c1dc-451a-9b00-f35cc562b8eb.png" style="max-width: 100%;"></a>
<p dir="auto">It appears that when the config file is loaded via <code class="notranslate">listFiles</code> (<a href="https://github.com/microsoft/playwright-vscode/blob/be9ad1e93fff6b7bba9ab44d42c648b91b85608f/src/playwrightTest.ts#L97">code</a>), the <code class="notranslate">FOO</code> environment variable does not exist. This suggests that <code class="notranslate">dotenv</code> is not working.</p>
<p dir="auto">To debug this further I added a console log inside <code class="notranslate">listFiles</code> to see the value of the <code class="notranslate">configFolder</code> argument we pass to <code class="notranslate">runNode</code>:</p>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/921609/243647870-e35f8900-8751-4f63-b0bd-bba48f5a4d3d.png"><img width="786" alt="image" src="https://user-images.githubusercontent.com/921609/243647870-e35f8900-8751-4f63-b0bd-bba48f5a4d3d.png" style="max-width: 100%;"></a>
<p dir="auto">As you can see, the extension is trying to load <code class="notranslate">.cache/typescript/playwright.config.js</code> (generated by <code class="notranslate">tsc</code>) instead of <code class="notranslate">playwright.config.ts</code> in the project root.</p>
<p dir="auto">This means that <code class="notranslate">dotenv</code> isn't able to find <code class="notranslate">.env</code> (which also lives in the project root).</p>
<p dir="auto">A few thoughts:</p>
<ul dir="auto">
<li>Could we improve error handling inside the extension? If there is an error, this should be displayed to the user (as opposed to the infinite loading state that's currently shown).</li>
<li>How can I instruct the extension to ignore <code class="notranslate">.cache/typescript/playwright.config.js</code>? We only want it to use <code class="notranslate">playwright.config.ts</code> in the project root.</li>
</ul>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32.1]</li>
<li>Operating System: [Windows 11]</li>
<li>Browser: [Chromium]</li>
<li>Other info:</li>
</ul>
<p dir="auto">When I run the test case using the uiMode<br>
Then The test is executed and passed but I can not see anything in the uiMode browser.</p>
<p dir="auto">Screenshot<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/117135138/228670834-17efe7be-01d3-4e2f-82c0-a1aea28bbd3e.png"><img src="https://user-images.githubusercontent.com/117135138/228670834-17efe7be-01d3-4e2f-82c0-a1aea28bbd3e.png" alt="image" style="max-width: 100%;"></a></p>