<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.33.0</li>
<li>Operating System: Windows</li>
<li>Browser: Firefox</li>
<li>Other info: Node: 18.16.0</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="async runVisualChecksAfterProjectSave(headless) {
    if (headless) {
      // Start comparing snapshots on Custom tab
      await this.customTabBtn.click();
      await this.page.waitForLoadState(&quot;load&quot;, { timeout: 10 * 1000 });
      await expect(async () =&gt; {
        await expect(this.projectCard).toHaveScreenshot({
          mask: [this.projectNameInput, this.footerRegisterLabel],
        });
      }).toPass({ timeout: 10000, intervals: [1000, 2000, 3000] });"><pre class="notranslate"><code class="notranslate">async runVisualChecksAfterProjectSave(headless) {
    if (headless) {
      // Start comparing snapshots on Custom tab
      await this.customTabBtn.click();
      await this.page.waitForLoadState("load", { timeout: 10 * 1000 });
      await expect(async () =&gt; {
        await expect(this.projectCard).toHaveScreenshot({
          mask: [this.projectNameInput, this.footerRegisterLabel],
        });
      }).toPass({ timeout: 10000, intervals: [1000, 2000, 3000] });
</code></pre></div>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">As described on this feature wish: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1589510284" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/20987" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/20987/hovercard" href="https://github.com/microsoft/playwright/issues/20987">#20987</a></p>
<p dir="auto"><code class="notranslate">expect.toPass()</code> should be walk around for image testing for pages that take bit more time to load content, goal is to reduce flaky tests. I would expect that toPass will retry toHaveScreenshot() for the timeout provided in <code class="notranslate">toPass()</code>. The default timeout for <code class="notranslate">expect()</code> is set for 5 sec.  But in our case, assertion fails after 403s</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/29520131/245068395-bef5531c-150c-4c24-96b1-ebd5c07b5712.png"><img src="https://user-images.githubusercontent.com/29520131/245068395-bef5531c-150c-4c24-96b1-ebd5c07b5712.png" alt="image" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer" href="https://user-images.githubusercontent.com/29520131/245069495-23049d31-870c-4da9-a9d4-f6bf527d477c.png"><img src="https://user-images.githubusercontent.com/29520131/245069495-23049d31-870c-4da9-a9d4-f6bf527d477c.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">Wrapping <code class="notranslate">toHaveScreenshot()</code> with <code class="notranslate">expect.toPass</code> should extend assertion timeout either for default timeout set for <code class="notranslate">expect()</code> or for timeout set inside <code class="notranslate">toPass()</code> and give us flexibility for visual testing.</p>
<ul dir="auto">
<li>Playwright Version: 1.0.2</li>
<li>Operating System: Windows</li>
<li>Browser: Chromium</li>
</ul>
<p dir="auto">I use playwright for integration tests in my project and I have a page with many iframes that are loaded dynamically. When i receive a request, one of the iframes should be open, but chromium immediately disconnects after opening the iframe with the error:<br>
messageWithStack.split is not a function<br>
in this line<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/53441891/84261380-56b38780-ab24-11ea-8d8d-de32c7d9f9d7.png"><img src="https://user-images.githubusercontent.com/53441891/84261380-56b38780-ab24-11ea-8d8d-de32c7d9f9d7.png" alt="image" style="max-width: 100%;"></a><br>
This is because the messageWithStack variable is false (boolean) and not a string type.<br>
In browser firefox and webkit it works fine, without any disconnects.</p>