Synthetics Agent Options - Playwright Configuration

Hello Elastic,

I would like to set the timeout to 2 minutes = 120000 ms and do the word checking for Synthetic.

This is for a Single Page Browser Test, I would like to do checking if there is a word 'DOWN' appeared in the page, I would like to create an alert for that.

How do I configure this?

Basically there is 2 things I would like to make adjustment on which is to set the Timeout to 120000 ms and also check if there is a 'DOWN' word on the page, it will alert me.

How do I do this in Single Page Browser Test?

Thank you!

Hi there @aisyaharifin - since you are wanting some custom logic here, a "multistep" monitor is actually the appropriate choice. I'll include some example screenshots.

I am assuming you want the timeout to apply to the text assertion. You can do this like I have shown below, but there are many similar ways to achieve that. If you do want a custom timeout for the page nav, you can also specify a timeout for page.goto, examples are in the Playwright docs.

  // change `goto` arg to match your website
  step('navigate to page', async () => page.goto('https://www.elastic.co/'));
  // if there is 1 element with text `DOWN`, this test should pass
  step('assert text', async () => {
    expect(await page.getByText('DOWN').isVisible({ timeout: 120_000 })).toBe(true);
  });

You can put your script right into the UI and test your monitor out before creating it with the Run Test button at the bottom of the page.

One last thing I would note, the playwright options field you are filling in is not for scripting. It takes a JSON blob that contains any specific playwright options you want to pass through Synthetics to Playwright. You probably don't need it to achieve what you're looking for here.

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