Skip to content

Commit

Permalink
[synthetics] Add info on timezones (#3079)
Browse files Browse the repository at this point in the history
* add info on timezones

* address feedback

* address feedback from @paulb-elastic

(cherry picked from commit 5586a93)
  • Loading branch information
colleenmcginnis authored and mergify[bot] committed Jul 19, 2023
1 parent 92aedff commit aef5d78
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/en/observability/synthetics-command-reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
<<synthetics-configuration-playwright-options,the configuration docs>>.

*`--screenshots <on|off|only-on-failure>`*::
Captures screenshots for every step in the journey.
Expand Down
47 changes: 43 additions & 4 deletions docs/en/observability/synthetics-configuration.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,56 @@ 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 and locales

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 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]
----
playwrightOptions: {
locale: 'en-AU',
timezoneId: 'Australia/Brisbane',
}
----

To use a timezone and/or locale for a _specific_ monitor, add these options to a
journey using <<synthetics-monitor-use,`monitor.use`>>.

// 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]]
Expand Down

0 comments on commit aef5d78

Please sign in to comment.