From 5ef8a06875cea1e51f10fe10dd75c1beacab1736 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Fri, 14 Jul 2023 10:38:05 -0500 Subject: [PATCH 1/3] add info on timezones --- .../synthetics-command-reference.asciidoc | 3 ++ .../synthetics-configuration.asciidoc | 43 +++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/docs/en/observability/synthetics-command-reference.asciidoc b/docs/en/observability/synthetics-command-reference.asciidoc index 2b5baaa410..bf4e27c3c0 100644 --- a/docs/en/observability/synthetics-command-reference.asciidoc +++ b/docs/en/observability/synthetics-command-reference.asciidoc @@ -42,6 +42,9 @@ For example, `cat path/to/file.js | npx @elastic/synthetics --inline`. JSON object to pass in custom Playwright options for the agent. Options passed will be merged with Playwright options defined in your synthetics.config.js file. Options defined via `--playwright-options` take precedence. ++ +For more details on relevant Playwright options, refer to the +<>. *`--screenshots `*:: Captures screenshots for every step in the journey. diff --git a/docs/en/observability/synthetics-configuration.asciidoc b/docs/en/observability/synthetics-configuration.asciidoc index 6e3011991f..6e761b02ba 100644 --- a/docs/en/observability/synthetics-configuration.asciidoc +++ b/docs/en/observability/synthetics-configuration.asciidoc @@ -52,17 +52,52 @@ An object that defines any variables your tests require. [[synthetics-configuration-playwright-options]] = `playwrightOptions` -For available options, see the https://playwright.dev/docs/test-configuration[Playwright documentation]. +For all available options, refer to the https://playwright.dev/docs/test-configuration[Playwright documentation]. + +Below are details on a few Playwright options that are particularly relevant to Elastic Synthetics including timeouts, timezones, and device emulation. + +[discrete] +[[synthetics-configuration-playwright-options-timeouts]] +== Timeouts -[NOTE] -==== Playwright has two types of timeouts that are used in Elastic Synthetics: https://playwright.dev/docs/test-timeouts#action-and-navigation-timeouts[action and navigation timeouts]. Elastic Synthetics uses a default action and navigation timeout of 50 seconds. You can override this default using https://playwright.dev/docs/api/class-testoptions#test-options-action-timeout[`actionTimeout`] and https://playwright.dev/docs/api/class-testoptions#test-options-navigation-timeout[`navigationTimeout`] in `playwrightOptions`. -==== + +[discrete] +[[synthetics-configuration-playwright-options-timezones]] +== Timezones + +By default monitors will run in the ??? timezone, but you can specify a timezone in +`playwrightOptions` on a per monitor or global basis. + +To set the timezone for all monitors in the project, set https://playwright.dev/docs/emulation#locale--timezone[`locale` and `timezoneId`] +in the configuration file: + +[source,js] +---- +playwrightOptions: { + locale: 'en-AU', + timezoneId: 'Australia/Brisbane', +} +---- + +To set the timezone for a specific monitor, add these options to a journey using +<>. + +// Uncomment note when this is added to the Synthetics Service + +////// +[NOTE] +===== +The timezone can also be set using the {synthetics-app}. +If you specify a timezone in the configuration file or using `monitor.use` in the journey code, +that timezone with take precedence over the timezone set in the {synthetics-app}. +===== +////// [discrete] [[synthetics-config-device-emulation]] From ed37965682b760d0c5d75c7fd67fb1de0be12fc7 Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Fri, 14 Jul 2023 18:24:44 -0500 Subject: [PATCH 2/3] address feedback --- .../observability/synthetics-configuration.asciidoc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/en/observability/synthetics-configuration.asciidoc b/docs/en/observability/synthetics-configuration.asciidoc index 6e761b02ba..0c339f49fd 100644 --- a/docs/en/observability/synthetics-configuration.asciidoc +++ b/docs/en/observability/synthetics-configuration.asciidoc @@ -71,10 +71,13 @@ in `playwrightOptions`. [[synthetics-configuration-playwright-options-timezones]] == Timezones -By default monitors will run in the ??? timezone, but you can specify a timezone in -`playwrightOptions` on a per monitor or global basis. +By default, monitors use the timezone of the host machine. This is not always desirable +if you want to test how a web application behaves across different timezones. +To specify what timezone to use when the monitor runs, you can use `playwrightOptions` +on a per monitor or global basis. -To set the timezone for all monitors in the project, set https://playwright.dev/docs/emulation#locale--timezone[`locale` and `timezoneId`] +To use a timezone for all monitors in the project, set +https://playwright.dev/docs/emulation#locale%2D%2Dtimezone[`locale` and `timezoneId`] in the configuration file: [source,js] @@ -85,7 +88,7 @@ playwrightOptions: { } ---- -To set the timezone for a specific monitor, add these options to a journey using +To use a timezone for a specific monitor, add these options to a journey using <>. // Uncomment note when this is added to the Synthetics Service From 17362386cdc158e82a3a0af0cd4912cd16038c5c Mon Sep 17 00:00:00 2001 From: Colleen McGinnis Date: Tue, 18 Jul 2023 20:20:54 -0500 Subject: [PATCH 3/3] address feedback from @paulb-elastic --- .../synthetics-configuration.asciidoc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/en/observability/synthetics-configuration.asciidoc b/docs/en/observability/synthetics-configuration.asciidoc index 0c339f49fd..03332510f9 100644 --- a/docs/en/observability/synthetics-configuration.asciidoc +++ b/docs/en/observability/synthetics-configuration.asciidoc @@ -69,15 +69,16 @@ in `playwrightOptions`. [discrete] [[synthetics-configuration-playwright-options-timezones]] -== Timezones +== Timezones and locales -By default, monitors use the timezone of the host machine. This is not always desirable -if you want to test how a web application behaves across different timezones. -To specify what timezone to use when the monitor runs, you can use `playwrightOptions` -on a per monitor or global basis. +The Elastic global managed testing infrastructure does not currently set the timezone. +For {private-location}s, the monitors will use the timezone of the host machine running +the {agent}. This is not always desirable if you want to test how a web application +behaves across different timezones. To specify what timezone to use when the monitor runs, +you can use `playwrightOptions` on a per monitor or global basis. -To use a timezone for all monitors in the project, set -https://playwright.dev/docs/emulation#locale%2D%2Dtimezone[`locale` and `timezoneId`] +To use a timezone and/or locale for all monitors in the project, set +https://playwright.dev/docs/emulation#locale%2D%2Dtimezone[`locale` and/or `timezoneId`] in the configuration file: [source,js] @@ -88,8 +89,8 @@ playwrightOptions: { } ---- -To use a timezone for a specific monitor, add these options to a journey using -<>. +To use a timezone and/or locale for a _specific_ monitor, add these options to a +journey using <>. // Uncomment note when this is added to the Synthetics Service