<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32]</li>
<li>Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]</li>
<li>Browser: [Chromium]</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@pytest.fixture(scope=&quot;session&quot;)
def browser_context_args(browser_context_args):
    current_test = os.environ.get(&quot;PYTEST_CURRENT_TEST&quot;).split(&quot;:&quot;)[-1].split(&quot; &quot;)[0]
    tc_id = current_test.split(&quot;_&quot;)[1]
    path = f&quot;results/{tc_id}.har&quot;
    return {
        **browser_context_args,
        &quot;viewport&quot;: {
            &quot;width&quot;: 1920,
            &quot;height&quot;: 1080,
        },
        &quot;record_har_path&quot;: path,
        &quot;record_har_omit_content&quot;: False,
    }"><pre class="notranslate"><code class="notranslate">@pytest.fixture(scope="session")
def browser_context_args(browser_context_args):
    current_test = os.environ.get("PYTEST_CURRENT_TEST").split(":")[-1].split(" ")[0]
    tc_id = current_test.split("_")[1]
    path = f"results/{tc_id}.har"
    return {
        **browser_context_args,
        "viewport": {
            "width": 1920,
            "height": 1080,
        },
        "record_har_path": path,
        "record_har_omit_content": False,
    }
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I provided the exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>I'm using the attached fixture within the tests</li>
<li>At the end the HAR is created with all the requests done in Browser, except the <code class="notranslate">OPTIONS</code> method requests</li>
<li>I also tried creating the HAR file 'manually' by using <code class="notranslate">page.on("requestfinished")</code> but it looks like <code class="notranslate">OPTIONS</code> requests are not intercepted <g-emoji class="g-emoji" alias="thinking" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f914.png">🤔</g-emoji></li>
</ul>
<p dir="auto">Is there some extra configuration I'm missing to 'force' the <code class="notranslate">OPTIONS</code> request to be present?</p>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto"><code class="notranslate">OPTIONS</code> requests to be present</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto"><code class="notranslate">OPTIONS</code> requests are missing</p>
<p dir="auto">Playwright currently offers the <code class="notranslate">LocatorAssertions.toHaveCount</code> function, that allows to expect -with wait- for a locator to have an exact count.</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="await expect(someLocator).toHaveCount(1);"><pre class="notranslate"><span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">someLocator</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveCount</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">However, it doesn't provide an out of the box way for asserting on non-exact counts.</p>
<p dir="auto">The proposal here is to add the following additional functions:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="await expect(todoLocator).toHaveCountGreaterThan(2);
await expect(recentTodoLocator).toHaveCountLessThan(4);"><pre class="notranslate"><span class="pl-k">await</span> <span class="pl-en">expect</span><span class="pl-kos">(</span><span class="pl-s1">todoLocator</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveCountGreaterThan</span><span class="pl-kos">(</span><span class="pl-c1">2</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">recentTodoLocator</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">toHaveCountLessThan</span><span class="pl-kos">(</span><span class="pl-c1">4</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">See related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1241826240" data-permission-text="Title is private" data-url="https://github.com/microsoft/playwright/issues/14278" data-hovercard-type="issue" data-hovercard-url="/microsoft/playwright/issues/14278/hovercard?comment_id=1343970254&amp;comment_type=issue_comment" href="https://github.com/microsoft/playwright/issues/14278#issuecomment-1343970254">#14278 (comment)</a></p>