checkly / checkly-cli

TS/JS native Monitoring as Code workflow
Apache License 2.0
64 stars 8 forks source link

Every browser check I make with `check add` breaks due to title #124

Closed tnolet closed 2 years ago

tnolet commented 2 years ago

Any browser check I create with the checkly add wizard, breaks.

 Creating new check file                                                                                                                                                                       18:08:59
? Your check name something
? What do you want to monitor? BROWSER
? Which URL you want to monitor https://analytics-cdn-proxy.checklyhq.com
? Select your target locations (we recommend to pick at least 2) us-east-1, us-west-2
? Pick your check frequency 5min
✔ Created new BROWSER check: something                                                                                                                                                          18:09:29
timnolet@Tims-MacBook-Pro-2 analytics-cdn-proxy % checkly deploy 
ℹ Deploying .checkly directory    

The resulting code will never work:

checkType: BROWSER
name: something
activated: true
frequency: 5
locations:
  - us-east-1
  - us-west-2
script: |-
  const { chromium } = require("playwright")
  const expect = require("expect")

  // Start a browser session
  const browser = await chromium.launch()
  const page = await browser.newPage()

  // Go to a page. This waits till the 'load' event by default
  await page.goto("https://analytics-cdn-proxy.checklyhq.com")

  // Assert a specific page item to be present
  const title = await page.title()
  expect(title).toBe("Delightful Active Monitoring for Developers")

  // Close the session
  await browser.close()
umutuzgur commented 2 years ago

I deleted the title and it should work as expected with a new release