<p dir="auto">Hi,</p>
<p dir="auto">How do I intercept API calls of a service worker? I assumed <code class="notranslate">context.route</code> covered everything contained in context, service workers included.<br>
Was I wrong? If so, how do I intercept their apis as well?</p>
<p dir="auto">Thanks!</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.32]</li>
<li>Operating System: [macOS 13.2.1]</li>
<li>Browser: [Chromium]</li>
<li>Other info: [N/A]</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"> I provided exact source code that allows reproducing the issue locally.</li>
</ul>




<p dir="auto"><strong>configTypes.ts</strong> : This file is inside folder in which pages, test and configTypes.ts are in same level.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
import fs from &quot;fs&quot;;
import toml from &quot;toml&quot;;


const config = toml.parse(fs.readFileSync(&quot;./config.toml&quot;, &quot;utf-8&quot;));

export default {
  ADMIN_URL: process.env.ADMIN_STAG_URL ?? config.admin_url,
  ADMIN_MOBILE_NUMBER: process.env.ADMIN_PHONE ?? config.admin_mobile_number,
 ADMIN_PASSCODE: process.env.ADMIN_PASSCODE ?? config.admin_passcode,
};
"><pre class="notranslate"><code class="notranslate">
import fs from "fs";
import toml from "toml";


const config = toml.parse(fs.readFileSync("./config.toml", "utf-8"));

export default {
  ADMIN_URL: process.env.ADMIN_STAG_URL ?? config.admin_url,
  ADMIN_MOBILE_NUMBER: process.env.ADMIN_PHONE ?? config.admin_mobile_number,
 ADMIN_PASSCODE: process.env.ADMIN_PASSCODE ?? config.admin_passcode,
};

</code></pre></div>
<p dir="auto"><strong>config.toml</strong> : This file is in the main root level.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="admin_url=&quot;https://hello.com/&quot;
admin_mobile_number=&quot;9999999999&quot;
admin_passcode = &quot;1234&quot;"><pre class="notranslate"><code class="notranslate">admin_url="https://hello.com/"
admin_mobile_number="9999999999"
admin_passcode = "1234"
</code></pre></div>
<p dir="auto">**Git Hub Repository &gt; &gt; Settings &gt;&gt; Secrets and Variables &gt;&gt; Actions &gt;&gt; Variables &gt;&gt; Repository Variables ** : At this location, I have added URL and Credentials which should be used.</p>
<p dir="auto"><code class="notranslate">SANITY=1 CICD=1 ADMIN_STAG_URL="https://test-hello.com/" ADMIN_PHONE=9090909090 ADMIN_PASSCODE=1234</code></p>
<p dir="auto"><strong>GitHub Action Workflow</strong> :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="name: Automated Tests
on:
  pull_request:
    branches: [master]
    types: ['opened']
jobs:
  test:
    timeout-minutes: 30
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          path: admin
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Check out automationtest repo
        uses: actions/checkout@v3
      - name: Install dependencies
        run: npm install
        working-directory: ./automationtest
      - name: Run tests
        run: SANITY=1 CICD=1 npx playwright test --project=admin-sanity
        working-directory: ./automationtest
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        if: always()
        with:
          name: playwright-report
          path: ./automationtest/playwright-report/
          retention-days: 8"><pre class="notranslate"><code class="notranslate">name: Automated Tests
on:
  pull_request:
    branches: [master]
    types: ['opened']
jobs:
  test:
    timeout-minutes: 30
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          path: admin
      - uses: actions/setup-node@v3
        with:
          node-version: 14
      - name: Check out automationtest repo
        uses: actions/checkout@v3
      - name: Install dependencies
        run: npm install
        working-directory: ./automationtest
      - name: Run tests
        run: SANITY=1 CICD=1 npx playwright test --project=admin-sanity
        working-directory: ./automationtest
      - name: Upload artifacts
        uses: actions/upload-artifact@v3
        if: always()
        with:
          name: playwright-report
          path: ./automationtest/playwright-report/
          retention-days: 8
</code></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>[Run the test]</li>
</ul>
<p dir="auto"><strong>Expected</strong></p>
<p dir="auto">I am expecting when the script is running through cicd pipeline, it will use the URL and login credentials mentioned in the 'GitHub Actions &gt;&gt; Variables &gt;&gt; Repository Variables'.</p>
<p dir="auto"><strong>Actual</strong></p>
<p dir="auto">It is using the URL and Credentials mentioned in 'Config.toml' file when running tests through cicd pipelines.</p>
<p dir="auto">Please help here.</p>
<p dir="auto">Thanks.</p>