Skip to content

Commit 3fbe5d4

Browse files
authored
[U-3684] Update playwright docs and add an example (#125)
1 parent d658bb4 commit 3fbe5d4

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

docs/data-sources/betteruptime_monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Monitor lookup.
8787
- **remember_cookies** (Boolean) Set to true to keep cookies when redirecting.
8888
- **request_body** (String) Request body for POST, PUT, PATCH requests. Required if monitor_type is set to dns (domain to query the DNS server with).
8989
- **request_headers** (List of Map of String) An array of request headers, consisting of name and value pairs
90-
- **request_timeout** (Number) How long to wait before timing out the request? In seconds.
90+
- **request_timeout** (Number) How long to wait before timing out the request? In seconds. When `monitor_type` is set to `playwright`, this determines the Playwright scenario timeout.
9191
- **required_keyword** (String) Required if monitor_type is set to keyword or udp. We will create a new incident if this keyword is missing on your page.
9292
- **scenario_name** (String) For Playwright monitors, the scenario name identifying the monitor in the UI.
9393
- **sms** (Boolean) Should we send an SMS to the on-call person?

docs/resources/betteruptime_monitor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ https://betterstack.com/docs/uptime/api/monitors/
8383
- **remember_cookies** (Boolean) Set to true to keep cookies when redirecting.
8484
- **request_body** (String) Request body for POST, PUT, PATCH requests. Required if monitor_type is set to dns (domain to query the DNS server with).
8585
- **request_headers** (List of Map of String) An array of request headers, consisting of name and value pairs
86-
- **request_timeout** (Number) How long to wait before timing out the request? In seconds.
86+
- **request_timeout** (Number) How long to wait before timing out the request? In seconds. When `monitor_type` is set to `playwright`, this determines the Playwright scenario timeout.
8787
- **required_keyword** (String) Required if monitor_type is set to keyword or udp. We will create a new incident if this keyword is missing on your page.
8888
- **scenario_name** (String) For Playwright monitors, the scenario name identifying the monitor in the UI.
8989
- **sms** (Boolean) Should we send an SMS to the on-call person?

examples/advanced/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,21 @@ resource "betteruptime_monitor" "dns" {
5252
monitor_group_id = betteruptime_monitor_group.this.id
5353
}
5454

55+
resource "betteruptime_monitor" "playwright" {
56+
url = "Better Stack Homepage"
57+
monitor_type = "playwright"
58+
monitor_group_id = betteruptime_monitor_group.this.id
59+
playwright_script = <<-EOT
60+
const { test, expect } = require('@playwright/test');
61+
62+
test('has title', async ({ page }) => {
63+
await page.goto('https://betterstack.com/')
64+
await expect(page).toHaveTitle(/Better Stack/)
65+
});
66+
EOT
67+
request_timeout = 60
68+
}
69+
5570
resource "betteruptime_status_page_resource" "monitor_status" {
5671
status_page_id = betteruptime_status_page.this.id
5772
status_page_section_id = betteruptime_status_page_section.monitors.id

internal/provider/resource_monitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ var monitorSchema = map[string]*schema.Schema{
239239
// TODO: ValidateDiagFunc: validation.StringInSlice
240240
},
241241
"request_timeout": {
242-
Description: "How long to wait before timing out the request? In seconds.",
242+
Description: "How long to wait before timing out the request? In seconds. When `monitor_type` is set to `playwright`, this determines the Playwright scenario timeout.",
243243
Type: schema.TypeInt,
244244
Optional: true,
245245
Computed: true,

0 commit comments

Comments
 (0)