From 360883339319376d1e27827286cd5fccc7c97fa1 Mon Sep 17 00:00:00 2001 From: Chris Amico Date: Tue, 14 Nov 2023 16:04:25 -0500 Subject: [PATCH] Try a netlify plugin --- .github/workflows/playwright.yml | 1 + netlify.toml | 2 ++ plugins/test/index.js | 6 ++++++ plugins/test/manifest.yml | 1 + 4 files changed, 10 insertions(+) create mode 100644 netlify.toml create mode 100644 plugins/test/index.js create mode 100644 plugins/test/manifest.yml diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index dfe0569f0..d2ab1cfb8 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -21,3 +21,4 @@ jobs: run: npx playwright test env: PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url }} + URL: ${{ github.event.deployment_status.target_url }} diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000..b9f256257 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,2 @@ +[[context.deploy-preview.plugins]] +package = "/plugins/test" \ No newline at end of file diff --git a/plugins/test/index.js b/plugins/test/index.js new file mode 100644 index 000000000..8aac8f94a --- /dev/null +++ b/plugins/test/index.js @@ -0,0 +1,6 @@ +// netlify plugin to run playwright on deploy previews + +export async function onSuccess({ utils }) { + await utils.run("playwright", ["install"]); + await utils.run("playwright", ["test"]); +} diff --git a/plugins/test/manifest.yml b/plugins/test/manifest.yml new file mode 100644 index 000000000..4fdd17086 --- /dev/null +++ b/plugins/test/manifest.yml @@ -0,0 +1 @@ +name: netlify-plugin-playwright