> ## Documentation Index
> Fetch the complete documentation index at: https://checkly-422f444a-mintlify-5577f365.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Terraform scripts locally

> Run Playwright Test scripts locally for faster development and debugging of browser checks

Having the possibility to run Playwright Test scripts for your browser checks locally will allow you to develop them faster and with more confidence.

## Enabling local script execution

You can easily enable local execution by storing your browser check scripts in local folders and passing the path to the right script:

```terraform theme={null}
resource "checkly_check" "e2e-checkout" {
  name                      = "Checkout Flow"
  type                      = "BROWSER"
  activated                 = true
  should_fail               = false
  frequency                 = 1
  use_global_alert_settings = true
  locations = [
    "us-west-1",
    "eu-central-1"
  ]
  retry_strategy = {
    type = "LINEAR"
  }

  script = file("${path.module}/scripts/checkout.spec.ts") // Or .js - our script is contained in this file
}
```

Basic checks written with `@playwright/test` will run locally with `npx playwright test` and remotely on Checkly without any modifications:

<CodeGroup dropdown>
  ```ts basic.spec.ts theme={null}
  import { test, expect } from '@playwright/test'

  test('Should load the web store', async ({ page }) => {
    await page.goto('https://danube-web.shop')

    await expect(page).toHaveTitle('danube-store')
  })
  ```

  ```js basic.spec.js theme={null}
  const { test, expect } = require('@playwright/test')

  test('Should load the web store', async ({ page }) => {
    await page.goto('https://danube-web.shop')

    await expect(page).toHaveTitle('danube-store')
  })
  ```
</CodeGroup>
