Playwright and shop listing

Hello,

We have a web ecommerce. We use woosmap and I try to make automatic test with playwright. But I have a problem.
On checkout, on development environment, when I select shop ==> there is no shop showing with playwright.
If select pickup, I have the list based on woosmap.
It I go ton the webiste without playwright I have the list of stores

So, do you know what it must block the store list with playwright ?

Hello @Aurelie_Pilette

I’m unsure about which API/SDK you are currently using in your checkout.
Assuming the checkout is performing a Woosmap Search API request and/or Woosmap Localities Geocode, my first thoughts would be to check that you have authorized your domain to run the API in your Dev environment.

A quick diagnosis could be to add the following to your test specs to see what’s happening with Woosmap API calls:

page.on('response', response => {
  if (response.url().includes('woosmap') || response.url().includes('stores')) {
    console.log(`${response.status()} - ${response.url()}`);
  }
});

page.on('requestfailed', request => {
  if (request.url().includes('woosmap')) {
    console.log(`FAILED: ${request.url()} - ${request.failure().errorText}`);
  }
});

You probably have referrer restrictions on your API Key. If you see 403 errors, add your dev domain to Woosmap Console or override headers in Playwright using:

await page.setExtraHTTPHeaders({
  'Referer': 'https://your-allowed-domain.com'
});

Also, since stores show up in normal browsing but not in Playwright, this could be a timing issue. Try waiting for the API calls to complete:

// Wait for API response
await page.waitForResponse(response =>
   response.url().includes('stores') && response.status() === 200
);

// Or wait for store elements to appear in DOM
await page.waitForSelector('[data-store-list-selector]', { timeout: 10000 });

Don’t hesitate to provide more info on your current environment (which Woosmap products you’re using, any console errors, etc.) so we can help further.