# Synthetics Playwright version

**URL:** <https://discuss.elastic.co/t/synthetics-playwright-version/324987>\
**Category:** Synthetics\
**Created:** [February 8, 2023, 9:15am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987 "2023-02-08T09:15:35Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 8, 2023, 9:15am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/1 "2023-02-08T09:15:35Z")

</div>

Hi, I'm trying to migrate some playwright tests to elastic synthetics and getting issues running the newer playwright methods e.g. getByRole. These are recognised when I run locally but not when I push to the server. What version of playwright is supported by synthetics right now? Will the newer getBy\* methods be supported?

Thanks!

---

<div class="post-metadata">

**Author:** ![BenB196](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benb196/32/83401_2.png) [@BenB196](https://discuss.elastic.co/u/BenB196)\
**Post date:** [February 8, 2023, 12:22pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/2 "2023-02-08T12:22:23Z")

</div>

It looks like Synthetics has shipped with [Playwright 1.27.1](https://github.com/elastic/synthetics/blob/v1.0.0-beta.38/package.json#L55) since `v1.0.0-beta.38`, which should contain the getBy\* APIs. I'm unable to find however, which version of Synthetics is shipped with each version of Heartbeat/Elastic Agent, so I can't tell you which version of them you'd need to be on to leverage the features.

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 8, 2023, 12:27pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/3 "2023-02-08T12:27:50Z")

</div>

Thanks for the reply! That's promising - I'm testing using the managed monitor instances right now but I can try using a private location instead to see if that works...

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 8, 2023, 12:32pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/4 "2023-02-08T12:32:08Z")

</div>

@BenB196 is right that the @elastic/synthetics ships with `1.27.1` since `v1.0.0-beta.38`. But I see Kibana has a dependency on `v1.26.0`. Just checking internally if that's why you're seeing a discrepancy, and when support is planned.

@jasonwhetton, if you're looking for a workaround you can use `page.locator` with a role specified in the selector:

`await page.locator('[role="my-role"]')`

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 8, 2023, 12:36pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/5 "2023-02-08T12:36:57Z")

</div>

Hi Carly!

Thanks, that explains what I'm seeing. I'm trying to combine migrating our tests with updating them so it would be really useful to know a rough timeframe.

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 8, 2023, 1:04pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/6 "2023-02-08T13:04:32Z")

</div>

Will do. Just to check, when encountering these issues are you running them on public locations? Just checking since you mentioned you would try private locations instead.

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 8, 2023, 1:05pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/7 "2023-02-08T13:05:37Z")

</div>

I've only run on the managed instances so far. Am currently setting up a local agent to test. I will let you know how it goes.

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 8, 2023, 1:53pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/8 "2023-02-08T13:53:10Z")

</div>

Actually, I can't get the browser monitors to run on a local agent.

 ![Screenshot 2023-02-08 at 14.52.12](https://us1.discourse-cdn.com/elastic/original/3X/6/5/650064d167572af870ec5f10efa8cfcd62f8d69b.png)

---

<div class="post-metadata">

**Author:** ![carly.richmond](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carly.richmond/32/104935_2.png) [@carly.richmond](https://discuss.elastic.co/u/carly.richmond)\
**Post date:** [February 8, 2023, 4:50pm UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/9 "2023-02-08T16:50:08Z")

</div>

Hi @jasonwhetton , got an update from the team that the image being used was on the old version and a prod change was pushed. Can you try with the latest and let us know if you're still having issues?

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 9, 2023, 6:22am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/10 "2023-02-09T06:22:58Z")

</div>

It's working! That's great news. Thank you! Now I can demonstrate to the team:D

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [February 28, 2023, 10:29am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/11 "2023-02-28T10:29:09Z")

</div>

Hi @carly.richmond.

I am not able to use some of the assertions I would normally find in the playwright library. For example:

await expect(page).toHaveURL(/.\*checkout/);

Do you know if these are available in the synthetics library or if not whether they will be supported soon? Thanks!

---

<div class="post-metadata">

**Author:** ![shahzad31](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shahzad31/32/51637_2.png) [@shahzad31](https://discuss.elastic.co/u/shahzad31)\
**Post date:** [February 28, 2023, 10:47am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/12 "2023-02-28T10:47:59Z")

</div>

@jasonwhetton for now, all of them are not supported. but we have an issue to open to do that. Please leave a comment there if you have feedback. We will consider it and try to priorities it soon

> <https://github.com/elastic/synthetics/issues/700>
>
> + We rely on the default \`expect\` library assertions which does not have the com…plete list of assertions that are supported by the Playwright test library. This would be confusing for users who are trying to run these playwright tests in the elastic globally managed infrastructure. 
> 
> + Using the \`plawyright-test/expect\` assertions would require us to replace the current \[expect\](https://github.com/elastic/synthetics/blob/cbf4c4e388acb25c86a94e3c99ad516aee9f13e6/src/core/expect.ts) and keep the playwright version up to date #614

---

<div class="post-metadata">

**Author:** ![jasonwhetton](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonwhetton/32/73766_2.png) [@jasonwhetton](https://discuss.elastic.co/u/jasonwhetton)\
**Post date:** [March 1, 2023, 6:54am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/13 "2023-03-01T06:54:09Z")

</div>

Thanks!

I have commented the issue.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 25, 2023, 6:54am UTC](https://discuss.elastic.co/t/synthetics-playwright-version/324987/14 "2023-03-25T06:54:20Z")

</div>

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.
