From 04419c7e5f7bc6e78c6403556f2c5a4958a33851 Mon Sep 17 00:00:00 2001 From: Max Rydahl Andersen Date: Tue, 27 Jul 2021 09:51:12 +0200 Subject: [PATCH] feat: provide jbang-catalog to run playwright cli (#519) Co-authored-by: Max Rydahl Andersen --- jbang-catalog.json | 10 ++++++++++ scripts/playwright.java | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 jbang-catalog.json create mode 100755 scripts/playwright.java diff --git a/jbang-catalog.json b/jbang-catalog.json new file mode 100644 index 00000000..a3e64e07 --- /dev/null +++ b/jbang-catalog.json @@ -0,0 +1,10 @@ +{ + "catalogs": {}, + "aliases": { + "playwright": { + "script-ref": "scripts/playwright.java", + "description": "Playwright lets you automate Chromium, Firefox and Webkit with a single API. \nWith this cli you can install, trace, generate pdf and screenshots and more.\nExample on how to record and run a script:\n```\n jbang playwright@microsoft/playwright-java codegen -o Example.java`\n jbang --deps com.microsoft.playwright:playwright:RELEASE Example.java\n```" + } + }, + "templates": {} +} \ No newline at end of file diff --git a/scripts/playwright.java b/scripts/playwright.java new file mode 100755 index 00000000..39c6372c --- /dev/null +++ b/scripts/playwright.java @@ -0,0 +1,17 @@ +///usr/bin/env jbang "$0" "$@" ; exit $? +//DEPS com.microsoft.playwright:playwright:RELEASE +//DESCRIPTION Playwright lets you automate Chromium, Firefox and Webkit with a single API. +//DESCRIPTION With this cli you can install, trace, generate pdf and screenshots and more. +//DESCRIPTION +//DESCRIPTION Example on how to record and run a script: +//DESCRIPTION ``` +//DESCRIPTION jbang playwright@microsoft/playwright-java codegen -o Example.java` +//DESCRIPTION jbang --deps com.microsoft.playwright:playwright:RELEASE Example.java +//DESCRIPTION ``` + +public class playwright { + + public static void main(String... args) throws Exception { + com.microsoft.playwright.CLI.main(args); + } +}