Synthetics Playwright version

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!

It looks like Synthetics has shipped with Playwright 1.27.1 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.

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...

@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"]')

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.

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.

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.

1 Like

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

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?

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

1 Like

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!

@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

1 Like

Thanks!

I have commented the issue.

1 Like

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