Usage of PlayWright devices configuration in sythetics monitor

Hello All,
We started to use monitors with the PlayWright scripts for testing our cloud instances.
For some of the scenarios we need to test with different browsers (web browse, mobile app, different browsers, etc.)

The PlayWright uses devices configuration for it which is apparently is also available as options you can pass to monitor in Synthetics.

However, when testing it we noticed that only Chrome browser works and as soon as we switch to something else (e.g. Mozilla) tests start to fail .

Perhaps we use it wrong? Or is it supported at all?
I found an older post from Dec 2023 mentioning that only Chrome was supported -- is it still true?

Can we run with more devices if we use Private Locations?

For the reference, here is what changes we added to project to run the monitors with Mozilla browser:

  • synthetics.config.ts
import type { SyntheticsConfig } from '@elastic/synthetics';
import { devices } from '@playwright/test'

export default env => {
  const config: SyntheticsConfig = {
    params: {
      url: 'https://our.web.address'
    },
    playwrightOptions: {
      ignoreHTTPSErrors: false,
	  ...devices['Desktop Firefox']
    },
    .....


This configuration works locally in PlayWright and when locally tested with elastic/synthetics but not when deployed to cloud monitor.

Best regards, Artem

Hi @Artem_Ruzak,

Chrome continues to be the only supported browser on our Synthetics solutions, for a few reasons.
It might be possible to get it to work with other browsers locally, where all dependencies can be installed separately and Synthetics cli simply relays the device configuration to PW's runtime. But is is definitely not going to work on Elastic public locations, where only Chromium dependencies are installed.

As for private locations, since it's possible to extend a container image to install additional packages, it might work. You'll need to customize the images to match PW required dependencies and there might be some issues with additional browsers we are not aware of and technically don't support.

1 Like

Thanks for explanation.
We will try to run it from Private Locations. Will take couple of days to test and share our experience

Hello,

Thanks for opening this topic.
I'm in the same situation - working with a private location - where I need to either :

  • launch the Chromium browser with specific args (flags) to allow embedded application execution (--use-angle=swiftshader --use-gl=angle --in-process-gpu)
  • use Firefox to be able to execute the embedded application.

I tried with following args in config file but it's not being considered when running it with my private location.

playwrightOptions: {
  ignoreHTTPSErrors: false,  
  ...devices['Desktop Firefox'],
  args: ['--use-angle=swiftshader','--use-gl=angle','--in-process-gpu'],
},

@Artem_Ruzak / @emilioalvap if you have some ideas on how to proceed, I will be glad to hear about it :slight_smile:

Thanks