Skip to content

Commit 5dd79bb

Browse files
committed
fix: extract platform drivers and management to commandbox-cbplaywright
This package now depends on commandbox-cbplaywright. commandbox-cbplaywright handles downloading and maintaining the Playwright driver as well as providing access to the CLI.
1 parent ded7e73 commit 5dd79bb

File tree

1,121 files changed

+48
-387501
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,121 files changed

+48
-387501
lines changed

.github/workflows/cron.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
4242
- name: Install Playwright dependencies
4343
run: |
44-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install-deps
45-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install --with-deps chromium
44+
box playwright-cli install-deps
45+
box playwright-cli install chromium
4646
4747
- name: Run TestBox Tests
4848
run: box testbox run

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ jobs:
4848
4949
- name: Install Playwright dependencies
5050
run: |
51-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install-deps
52-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install --with-deps chromium
51+
box playwright-cli install-deps
52+
box playwright-cli install chromium
5353
5454
- name: Run TestBox Tests
5555
run: box testbox run

.github/workflows/prerelease.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ jobs:
4242
4343
- name: Install Playwright dependencies
4444
run: |
45-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install-deps
46-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install --with-deps chromium
45+
box playwright-cli install-deps
46+
box playwright-cli install chromium
4747
4848
- name: Run TestBox Tests
4949
run: box testbox run

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ jobs:
4343
4444
- name: Install Playwright dependencies
4545
run: |
46-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install-deps
47-
java -cp "lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install --with-deps chromium
46+
box playwright-cli install-deps
47+
box playwright-cli install chromium
4848
4949
- name: Run TestBox Tests
5050
run: box testbox run

README.md

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,18 @@ this.mappings[ "/cbPlaywright" ] = rootPath & "/modules/cbPlaywright";
3333

3434
> Note: You can't use the mapping in the `javaSettings` since they are both in the psuedo-constructor.
3535
36-
3. Add a `PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1` environment variable.
37-
38-
**Playwright won't start in a CFML server without this. (If someone finds a workaround for this, please open a PR.)**
36+
3. (OPTIONAL) If you have installed CommandBox or commandbox-cbplaywright in a non-standard location, set the `CBPLAYWRIGHT_DRIVER_DIR`
37+
environment variable to the correct location of the Playwright driver.
3938

4039
### Playwright CLI
4140

42-
To interact with the Playwright CLI, use the following snippet:
41+
To interact with the Playwright CLI, use `commandbox-cbplaywright:
4342

43+
```sh
44+
playwright-cli
45+
# or
46+
playwright
4447
```
45-
java -cp "modules/cbPlaywright/lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI
46-
```
47-
48-
> Replace `linux` with the correct architecture for your OS.
49-
> Valid values are `linux`, `linux-arm64`, `mac`, or `win32_x64`
50-
> (In the future, we'll have a cbPlaywright CommandBox module that will make this easier.)
5148

5249
You can see the documentation for the [Playwright Java CLI here](https://playwright.dev/java/docs/cli).
5350

@@ -59,16 +56,12 @@ for more information.
5956

6057
Examples:
6158

59+
```sh
60+
box playwright install chromium
61+
box playwright install firefox
62+
box playwright install webkit
63+
box playwright install msedge
6264
```
63-
java -cp "modules/cbPlaywright/lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install chromium
64-
java -cp "modules/cbPlaywright/lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install firefox
65-
java -cp "modules/cbPlaywright/lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install webkit
66-
java -cp "modules/cbPlaywright/lib/*" -Dplaywright.cli.dir="lib/driver/linux/" com.microsoft.playwright.CLI install msedge
67-
```
68-
69-
> Replace `linux` with the correct architecture for your OS.
70-
> Valid values are `linux`, `linux-arm64`, `mac`, or `win32_x64`
71-
> (In the future, we'll have a cbPlaywright CommandBox module that will make this easier.)
7265

7366
### Usage
7467

box.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"shortDescription":"CFML integration with TestBox and Playwright",
2121
"description":"CFML integration with TestBox and Playwright to run tests in actual browsers",
2222
"type":"modules",
23-
"dependencies":{},
23+
"dependencies":{
24+
"commandbox-cbplaywright": "^1.0.0"
25+
},
2426
"devDependencies":{
2527
"testbox":"stable"
2628
},

build/downloadAndExtractJars.cfc renamed to build/downloadJars.cfc

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,9 @@ component {
1919
}
2020
bundleFile = bundleFile[ 1 ];
2121

22-
print.line( "Unzipping the drivers..." ).toConsole();
23-
cfzip( action = "unzip", file = bundleFile, destination = "../lib/driver-bundle" );
24-
directoryCopy( "../lib/driver-bundle/driver", "../lib/driver", true );
25-
directoryDelete( "../lib/driver-bundle", true );
22+
print.line( "Removing the drivers. These are provided by commandbox-cbplaywright..." ).toConsole();
2623
fileDelete( bundleFile );
2724

28-
print.line( "Setting the correct permissions for the driver files..." ).toConsole();
29-
var files = directoryList( "../lib/driver", true );
30-
var fileCount = files.len();
31-
progressBarGeneric.update( percent = 0 );
32-
files.each( ( fileName, i ) => {
33-
fileSetAccessMode( fileName, "777" );
34-
progressBarGeneric.update( percent = ( i / fileCount ) * 100 );
35-
} );
36-
37-
3825
print.greenLine( 'Download and extraction complete!' ).toConsole();
3926
}
4027

lib/driver-1.24.0.jar

-6.18 KB
Binary file not shown.

lib/driver-1.25.0.jar

6.39 KB
Binary file not shown.

0 commit comments

Comments
 (0)