Browse Source

Update for new playwright

George S. Baugh 4 years ago
parent
commit
c3260c6a8b
9 changed files with 28 additions and 7 deletions
  1. 1 0
      .gitignore
  2. 4 0
      Changes
  3. 2 0
      MANIFEST.SKIP
  4. 9 1
      README.md
  5. 4 4
      bin/playwright_server
  6. 1 1
      dist.ini
  7. 2 1
      example.pl
  8. 4 0
      generate_api_json.sh
  9. 1 0
      lib/Playwright.pm

+ 1 - 0
.gitignore

@@ -51,3 +51,4 @@ package-lock.json
 test.jpg
 test.jpg
 test2.jpg
 test2.jpg
 video/*
 video/*
+api.json

+ 4 - 0
Changes

@@ -1,5 +1,9 @@
 Revision history for Playwright
 Revision history for Playwright
 
 
+0.007 2021-06-17 TEODESIAN
+    - Adjust module for changing Download returns, and api.json no longer being shipped with Playwright
+    - Fix some warnings when installing for the first time.
+
 0.006 2021-04-12 TEODESIAN
 0.006 2021-04-12 TEODESIAN
     - Prevent $? from bubbling up in our destructor and invalidating program exit code by localizing $? in quit()
     - Prevent $? from bubbling up in our destructor and invalidating program exit code by localizing $? in quit()
     - Add a link to the Playwright slack in the documentation.
     - Add a link to the Playwright slack in the documentation.

+ 2 - 0
MANIFEST.SKIP

@@ -11,3 +11,5 @@ package-lock.json
 node_modules/*
 node_modules/*
 example.pl
 example.pl
 tidyall.ini
 tidyall.ini
+generate_api_json.sh
+api.json

+ 9 - 1
README.md

@@ -30,7 +30,7 @@ Tests might fail due to Temp file weirdness with Test::MockFile.
 
 
 Everything seems to work fine on OSX and Linux.
 Everything seems to work fine on OSX and Linux.
 
 
-On Windows, you will have to approve a UAC prompt to exempt playwright_server from being firewalled off.
+On Windows, you will have to approve a UAC prompt to exempt `playwright_server` from being firewalled off.
 
 
 
 
 ## How2develop
 ## How2develop
@@ -50,6 +50,14 @@ Actually running stuff:
 
 
 `perl -Ilib example.pl`
 `perl -Ilib example.pl`
 
 
+## Dealing with api.json
+
+Playwright doesn't ship their api.json with the distribution on NPM.
+You have to generate it from their repo.
+
+clone it in a directory that is the same as the one containing this repository.
+then run `generate_api_json.sh` to get things working such that the build scripts know what to do.
+
 ## Questions?
 ## Questions?
 Hop into the playwright slack, and check out the #playwright-perl channel therein.
 Hop into the playwright slack, and check out the #playwright-perl channel therein.
 I'm watching that space and should be able to answer your questions.
 I'm watching that space and should be able to answer your questions.

File diff suppressed because it is too large
+ 4 - 4
bin/playwright_server


+ 1 - 1
dist.ini

@@ -1,5 +1,5 @@
 name = Playwright
 name = Playwright
-version = 0.006
+version = 0.007
 author = George S. Baugh <george@troglodyne.net>
 author = George S. Baugh <george@troglodyne.net>
 license = MIT
 license = MIT
 copyright_holder = Troglodyne LLC
 copyright_holder = Troglodyne LLC

+ 2 - 1
example.pl

@@ -90,7 +90,7 @@ use Cwd qw{abs_path};
 my $pg = abs_path("$FindBin::Bin/at/test.html");
 my $pg = abs_path("$FindBin::Bin/at/test.html");
 
 
 # Handle dialogs on page start, and dialog after dialog
 # Handle dialogs on page start, and dialog after dialog
-# NOTE -- the 'load' event won't fire until the dialog is dismissed in some browsers 
+# NOTE -- the 'load' event won't fire until the dialog is dismissed in some browsers
 $promise = $page->waitForEvent('dialog');
 $promise = $page->waitForEvent('dialog');
 $page->goto("file://$pg", { waitUntil => 'networkidle' });
 $page->goto("file://$pg", { waitUntil => 'networkidle' });
 
 
@@ -107,6 +107,7 @@ $promise = $page->waitForEvent('download');
 $page->select('#d-lo')->click();
 $page->select('#d-lo')->click();
 
 
 my $download = $handle->await( $promise );
 my $download = $handle->await( $promise );
+
 $download->saveAs('test2.jpg');
 $download->saveAs('test2.jpg');
 
 
 # Fiddle with file inputs
 # Fiddle with file inputs

+ 4 - 0
generate_api_json.sh

@@ -0,0 +1,4 @@
+#!/bin/bash
+pushd ../playwright
+node utils/doclint/generateApiJson.js > ../playwright-perl/api.json
+popd

+ 1 - 0
lib/Playwright.pm

@@ -402,6 +402,7 @@ Waits for an asynchronous operation returned by the waitFor* methods to complete
 sub await ( $self, $promise ) {
 sub await ( $self, $promise ) {
     confess("Input must be an AsyncData") unless $promise->isa('AsyncData');
     confess("Input must be an AsyncData") unless $promise->isa('AsyncData');
     my $obj = $promise->result(1);
     my $obj = $promise->result(1);
+
     return $obj unless $obj->{_type};
     return $obj unless $obj->{_type};
     my $class = "Playwright::$obj->{_type}";
     my $class = "Playwright::$obj->{_type}";
     return $class->new(
     return $class->new(

Some files were not shown because too many files changed in this diff