Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[synthetics] Add info on timezones #3079

Merged
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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