Răsfoiți Sursa

Update for new playwright

George S. Baugh 4 ani în urmă
părinte
comite
c3260c6a8b
9 a modificat fișierele cu 28 adăugiri și 7 ștergeri
  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
 test2.jpg
 video/*
+api.json

+ 4 - 0
Changes

@@ -1,5 +1,9 @@
 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
     - 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.

+ 2 - 0
MANIFEST.SKIP

@@ -11,3 +11,5 @@ package-lock.json
 node_modules/*
 example.pl
 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.
 
-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
@@ -50,6 +50,14 @@ Actually running stuff:
 
 `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?
 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.

Fișier diff suprimat deoarece este prea mare
+ 4 - 4
bin/playwright_server


+ 1 - 1
dist.ini

@@ -1,5 +1,5 @@
 name = Playwright
-version = 0.006
+version = 0.007
 author = George S. Baugh <george@troglodyne.net>
 license = MIT
 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");
 
 # 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');
 $page->goto("file://$pg", { waitUntil => 'networkidle' });
 
@@ -107,6 +107,7 @@ $promise = $page->waitForEvent('download');
 $page->select('#d-lo')->click();
 
 my $download = $handle->await( $promise );
+
 $download->saveAs('test2.jpg');
 
 # 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 ) {
     confess("Input must be an AsyncData") unless $promise->isa('AsyncData');
     my $obj = $promise->result(1);
+
     return $obj unless $obj->{_type};
     my $class = "Playwright::$obj->{_type}";
     return $class->new(

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff