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] Add 'playwright_options' browser option #31737

Merged
merged 2 commits into from
May 24, 2022

Conversation

andrewvc
Copy link
Contributor

@andrewvc andrewvc commented May 24, 2022

Fixes #28197

Adds the new playwright_options browser option.

Tested with the following config manually:

- type: browser
  enabled: true
  id: browser-inline
  name: browser-inline
  playwright_options:
    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"

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

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 andrewvc added enhancement Heartbeat Team:obs-ds-hosted-services Label for the Observability Hosted Services team v8.3.0 labels May 24, 2022
@andrewvc andrewvc requested a review from a team as a code owner May 24, 2022 20:58
@andrewvc andrewvc self-assigned this May 24, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/uptime (Team:Uptime)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels May 24, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented May 24, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-05-24T20:59:40.619+0000

  • Duration: 50 min 24 sec

Test stats 🧪

Test Results
Failed 0
Passed 1582
Skipped 22
Total 1604

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Member

@vigneshshanmugam vigneshshanmugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested E2E

@@ -32,6 +32,7 @@ type Config struct {
Throttling interface{} `config:"throttling"`
Screenshots string `config:"screenshots"`
SyntheticsArgs []string `config:"synthetics_args"`
PlaywrightOpts map[string]interface{} `config:"playwright_options"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: mapstr.M

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, I kinda prefer ignoring our weird types unless we actual have a need for them. It doesn't make a difference here since we never traverse it, just serialize it, so I like to keep it plain.

@andrewvc andrewvc merged commit 4efe1c2 into elastic:main May 24, 2022
@andrewvc andrewvc deleted the playwright-options branch May 24, 2022 22:28
@emilioalvap
Copy link
Collaborator

PostFF LGTM, playwrightOptions contract is observed.

Related to E2E testing this, it has surfaced elastic/synthetics#516.

chrisberkhout pushed a commit that referenced this pull request 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 v8.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Heartbeat] Support PlaywrightOptions
4 participants