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

[Heartbeat] Support PlaywrightOptions #28197

Closed
andrewvc opened this issue Sep 29, 2021 · 4 comments · Fixed by #31737
Closed

[Heartbeat] Support PlaywrightOptions #28197

andrewvc opened this issue Sep 29, 2021 · 4 comments · Fixed by #31737
Assignees
Labels
enhancement Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team

Comments

@andrewvc
Copy link
Contributor

andrewvc commented Sep 29, 2021

Heartbeat counterpart to elastic/synthetics#388, proposes support for a new option for browser monitors

ACs:

- name: my-monitor
  # ...
  playwright_options:
    an_option
  source: #...
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Sep 29, 2021
@vigneshshanmugam vigneshshanmugam added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Sep 29, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Sep 29, 2021
@paulb-elastic
Copy link
Contributor

Discussed in refinement (elastic/synthetics#388 (comment)) and the initial focus will be on Playwright options (which themselves can be used for defining proxy settings). Future enhancements can be made to specifically call out configurations like proxy settings.

Description/ACs updated accordingly.

@vigneshshanmugam
Copy link
Member

This has to go in 8.3 because we are doing PUSH command and it would be weird not to have on the HB side since Synthetics and Kibana already support this option.

andrewvc added a commit to andrewvc/beats that referenced this issue May 24, 2022
Fixes elastic#28197

Adds the new `playwright_options` browser option.

Test with the following config manually:

```yaml
- type: browser
  enabled: true
  id: browser-inline
  name: browser-inline
    ignoreHTTPSErrors: true
  throttling:
    download: 1.6
    upload: 0.75
    latency: 150
  source:
    inline:
      script:
        step("load homepage", async () => {
            await page.goto('https://www.elastic.co');
        });
        step("hover over products menu", async () => {
            await page.hover('css=[data-nav-item=products]');
        });
        step("failme", async () => {
            await page.hhover('css=[data-nav-item=products]');
        });
  schedule: "@every 1m"
```
andrewvc added a commit that referenced this issue May 24, 2022
Fixes #28197

Adds the new `playwright_options` browser option.

Test with the following config manually:

```yaml
- type: browser
  enabled: true
  id: browser-inline
  name: browser-inline
    ignoreHTTPSErrors: true
  throttling:
    download: 1.6
    upload: 0.75
    latency: 150
  source:
    inline:
      script:
        step("load homepage", async () => {
            await page.goto('https://www.elastic.co');
        });
        step("hover over products menu", async () => {
            await page.hover('css=[data-nav-item=products]');
        });
        step("failme", async () => {
            await page.hhover('css=[data-nav-item=products]');
        });
  schedule: "@every 1m"
```
@andrewvc andrewvc self-assigned this May 24, 2022
@justinkambic justinkambic self-assigned this Jun 7, 2022
@justinkambic
Copy link
Contributor

Post-FF testing LGTM

I tested this by configuring an inline monitor like:

- type: browser
  enabled: true
  id: synthetic-inline-tests
  name: Elastic website
  schedule: '@every 10s'
  playwright_options:
    headless: false
  source:
    inline:
      script: |-
        step("load homepage", async () => {
          await page.goto('https://www.elastic.co');
        });

The test was to pass the headless: false flag to PW via the playwright_options field added here. When running Heartbeat locally I was able to observe the browser's headful state:

image

chrisberkhout pushed a commit that referenced this issue Jun 1, 2023
Fixes #28197

Adds the new `playwright_options` browser option.

Test with the following config manually:

```yaml
- type: browser
  enabled: true
  id: browser-inline
  name: browser-inline
    ignoreHTTPSErrors: true
  throttling:
    download: 1.6
    upload: 0.75
    latency: 150
  source:
    inline:
      script:
        step("load homepage", async () => {
            await page.goto('https://www.elastic.co');
        });
        step("hover over products menu", async () => {
            await page.hover('css=[data-nav-item=products]');
        });
        step("failme", async () => {
            await page.hhover('css=[data-nav-item=products]');
        });
  schedule: "@every 1m"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants