<p dir="auto">I am reporting as a bug, although it might be my bad code, but could not figure it out... Might be useful for future searches.</p>
<p dir="auto">I am trying to split my fixtures into multiple files.<br>
I get an error pointing to the base.extend<br>
Error: test.extend() accepts fixtures object, not a test object.<br>
Did you mean to call test._extendTest()?</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.33]</li>
<li>Operating System: [ macOS 13.3]</li>
<li>Browser: [ Chromium]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//fake-time.fixtures.ts
import { test as base } from '@playwright/test';

export type FakeTimeFixtures = {
  useFakeTime: (dateTime: string) =&gt; Promise&lt;void&gt;
};

export const fakeTimeFixtures = base.extend&lt;FakeTimeFixtures&gt;({
  useFakeTime: async ({ page }, use) =&gt; {
    const addFakeTimeScript = async (dateTime: string): Promise&lt;void&gt; =&gt; {
      const fakeNow = new Date(dateTime).valueOf();
//implementation code
      }`);  
    };
    await use(addFakeTimeScript);
  }
});

//fixtures.ts

import { test as base } from '@playwright/test';
import { fakeTimeFixtures, FakeTimeFixtures } from './fake-time.fixtures.ts';

type MyFixtures = {
  someFixture: (component: Locator) =&gt; Promise&lt;string&gt;;
};

export const test = base.extend&lt;FakeTimeFixtures &amp; MyFixtures&gt; ({
...fakeTimeFixtures
someFixture: // implementation of the fixture
});

export { expect } from '@playwright/test';"><pre class="notranslate"><code class="notranslate">//fake-time.fixtures.ts
import { test as base } from '@playwright/test';

export type FakeTimeFixtures = {
  useFakeTime: (dateTime: string) =&gt; Promise&lt;void&gt;
};

export const fakeTimeFixtures = base.extend&lt;FakeTimeFixtures&gt;({
  useFakeTime: async ({ page }, use) =&gt; {
    const addFakeTimeScript = async (dateTime: string): Promise&lt;void&gt; =&gt; {
      const fakeNow = new Date(dateTime).valueOf();
//implementation code
      }`);  
    };
    await use(addFakeTimeScript);
  }
});

//fixtures.ts

import { test as base } from '@playwright/test';
import { fakeTimeFixtures, FakeTimeFixtures } from './fake-time.fixtures.ts';

type MyFixtures = {
  someFixture: (component: Locator) =&gt; Promise&lt;string&gt;;
};

export const test = base.extend&lt;FakeTimeFixtures &amp; MyFixtures&gt; ({
...fakeTimeFixtures
someFixture: // implementation of the fixture
});

export { expect } from '@playwright/test';
</code></pre></div>
<p dir="auto">I am not even sure if it is a TS or a PW error. Any idea?</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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">[https://github.com/Tallyb/pw-fixtures-error ]</p>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>npx playwright test</li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
Tests should run</p>
<p dir="auto"><strong>Actual</strong><br>
error message as above</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.33.0]</li>
<li>Operating System: [MACOS 13.1]</li>
<li>Browser: [Firefox]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto">I'm unable to provide source code or a cloned repo publicly so I'd like to explain an issue that is only happening in Firefox and see if I can get any guidance/answers. I have a test that goes to a page and ends up checking 2 checkboxes:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="      await verifyDevicePage.marketingCheckbox.check();
      await verifyDevicePage.transactionalCheckbox.check();"><pre class="notranslate">      <span class="pl-k">await</span> <span class="pl-s1">verifyDevicePage</span><span class="pl-kos">.</span><span class="pl-c1">marketingCheckbox</span><span class="pl-kos">.</span><span class="pl-en">check</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">verifyDevicePage</span><span class="pl-kos">.</span><span class="pl-c1">transactionalCheckbox</span><span class="pl-kos">.</span><span class="pl-en">check</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">In Chrome and Safari, the whole test passes. In Firefox, it fails at these checkboxes and it's always the same error. I have tried changing the .check() over to .click(). I've tried chaining locators. I've tried refreshing the page. I've tried waiting for element to be visible. I've tried using the force option. I've tried using a timeout. I've tried using double clicks.  I've tried scrolling element into view before check or click. I've tried changing the locators to locators that Playwright suggests when using --ui. Nothing is seeming to work.</p>
<p dir="auto">We use POM and custom automation locators in question and they currently look like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="this.marketingCheckbox = page.locator('[data-automation=&quot;transactional&quot;]');
this.transactionalCheckbox = page.locator('[data-automation=&quot;marketing&quot;]')"><pre class="notranslate"><code class="notranslate">this.marketingCheckbox = page.locator('[data-automation="transactional"]');
this.transactionalCheckbox = page.locator('[data-automation="marketing"]')
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Error: locator.check: Target closed
=========================== logs ===========================
waiting for locator('[data-automation=&quot;marketing&quot;]')
  locator resolved to &lt;input name=&quot;&quot; id=&quot;marketing&quot; type=&quot;checkbox&quot; _ngconten…/&gt;
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting..."><pre class="notranslate"><code class="notranslate">Error: locator.check: Target closed
=========================== logs ===========================
waiting for locator('[data-automation="marketing"]')
  locator resolved to &lt;input name="" id="marketing" type="checkbox" _ngconten…/&gt;
attempting click action
  waiting for element to be visible, enabled and stable
    element is not visible - waiting...
</code></pre></div>