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