Browser enum | Puppeteer
-
+
diff --git a/browsers-api/browsers.browserplatform/index.html b/browsers-api/browsers.browserplatform/index.html
index 47b1c0f954d..b86ec1c1f67 100644
--- a/browsers-api/browsers.browserplatform/index.html
+++ b/browsers-api/browsers.browserplatform/index.html
@@ -6,7 +6,7 @@
BrowserPlatform enum | Puppeteer
-
+
diff --git a/browsers-api/browsers.candownload/index.html b/browsers-api/browsers.candownload/index.html
index 815ff2be088..cfadb444847 100644
--- a/browsers-api/browsers.candownload/index.html
+++ b/browsers-api/browsers.candownload/index.html
@@ -6,7 +6,7 @@
canDownload() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.cdp_websocket_endpoint_regex/index.html b/browsers-api/browsers.cdp_websocket_endpoint_regex/index.html
index d7e0870c88a..b7d84b6ee69 100644
--- a/browsers-api/browsers.cdp_websocket_endpoint_regex/index.html
+++ b/browsers-api/browsers.cdp_websocket_endpoint_regex/index.html
@@ -6,7 +6,7 @@
CDP_WEBSOCKET_ENDPOINT_REGEX variable | Puppeteer
-
+
diff --git a/browsers-api/browsers.chromereleasechannel/index.html b/browsers-api/browsers.chromereleasechannel/index.html
index 5aacb611aa3..47caab9366a 100644
--- a/browsers-api/browsers.chromereleasechannel/index.html
+++ b/browsers-api/browsers.chromereleasechannel/index.html
@@ -6,7 +6,7 @@
ChromeReleaseChannel enum | Puppeteer
-
+
diff --git a/browsers-api/browsers.cli._constructor_/index.html b/browsers-api/browsers.cli._constructor_/index.html
index 7f60aeedf18..2aacffdf68e 100644
--- a/browsers-api/browsers.cli._constructor_/index.html
+++ b/browsers-api/browsers.cli._constructor_/index.html
@@ -6,7 +6,7 @@
CLI.(constructor) | Puppeteer
-
+
diff --git a/browsers-api/browsers.cli.run/index.html b/browsers-api/browsers.cli.run/index.html
index 0cc045bf567..14f660fcff5 100644
--- a/browsers-api/browsers.cli.run/index.html
+++ b/browsers-api/browsers.cli.run/index.html
@@ -6,7 +6,7 @@
CLI.run() method | Puppeteer
-
+
diff --git a/browsers-api/browsers.cli/index.html b/browsers-api/browsers.cli/index.html
index 48a26ea9e6b..572a1c9df54 100644
--- a/browsers-api/browsers.cli/index.html
+++ b/browsers-api/browsers.cli/index.html
@@ -6,7 +6,7 @@
CLI class | Puppeteer
-
+
diff --git a/browsers-api/browsers.computeexecutablepath/index.html b/browsers-api/browsers.computeexecutablepath/index.html
index 50f23ea48aa..214d599e70d 100644
--- a/browsers-api/browsers.computeexecutablepath/index.html
+++ b/browsers-api/browsers.computeexecutablepath/index.html
@@ -6,7 +6,7 @@
computeExecutablePath() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.computesystemexecutablepath/index.html b/browsers-api/browsers.computesystemexecutablepath/index.html
index 0704ffa1ef1..957742d8803 100644
--- a/browsers-api/browsers.computesystemexecutablepath/index.html
+++ b/browsers-api/browsers.computesystemexecutablepath/index.html
@@ -6,7 +6,7 @@
computeSystemExecutablePath() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.createprofile/index.html b/browsers-api/browsers.createprofile/index.html
index 8854a5ab34f..d71a49f8954 100644
--- a/browsers-api/browsers.createprofile/index.html
+++ b/browsers-api/browsers.createprofile/index.html
@@ -6,7 +6,7 @@
createProfile() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.detectbrowserplatform/index.html b/browsers-api/browsers.detectbrowserplatform/index.html
index 2d9867d5211..d6accf412ec 100644
--- a/browsers-api/browsers.detectbrowserplatform/index.html
+++ b/browsers-api/browsers.detectbrowserplatform/index.html
@@ -6,7 +6,7 @@
detectBrowserPlatform() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.getinstalledbrowsers/index.html b/browsers-api/browsers.getinstalledbrowsers/index.html
index 8909ec7bdf5..33aa0141871 100644
--- a/browsers-api/browsers.getinstalledbrowsers/index.html
+++ b/browsers-api/browsers.getinstalledbrowsers/index.html
@@ -6,7 +6,7 @@
getInstalledBrowsers() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.getinstalledbrowsersoptions/index.html b/browsers-api/browsers.getinstalledbrowsersoptions/index.html
index 6b4d5738d61..ddab3cac44d 100644
--- a/browsers-api/browsers.getinstalledbrowsersoptions/index.html
+++ b/browsers-api/browsers.getinstalledbrowsersoptions/index.html
@@ -6,7 +6,7 @@
GetInstalledBrowsersOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.install/index.html b/browsers-api/browsers.install/index.html
index ad6a6c89df9..1e1b03a925f 100644
--- a/browsers-api/browsers.install/index.html
+++ b/browsers-api/browsers.install/index.html
@@ -6,7 +6,7 @@
install() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.install_1/index.html b/browsers-api/browsers.install_1/index.html
index 12cd1e0deb3..017f494fa83 100644
--- a/browsers-api/browsers.install_1/index.html
+++ b/browsers-api/browsers.install_1/index.html
@@ -6,7 +6,7 @@
install() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.installedbrowser/index.html b/browsers-api/browsers.installedbrowser/index.html
index d8eecdc32a7..1d3b7719d05 100644
--- a/browsers-api/browsers.installedbrowser/index.html
+++ b/browsers-api/browsers.installedbrowser/index.html
@@ -6,7 +6,7 @@
InstalledBrowser class | Puppeteer
-
+
diff --git a/browsers-api/browsers.installoptions/index.html b/browsers-api/browsers.installoptions/index.html
index d9bdd4c2625..06ae408b375 100644
--- a/browsers-api/browsers.installoptions/index.html
+++ b/browsers-api/browsers.installoptions/index.html
@@ -6,7 +6,7 @@
InstallOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.launch/index.html b/browsers-api/browsers.launch/index.html
index 2617a6a7919..f0b944d85b3 100644
--- a/browsers-api/browsers.launch/index.html
+++ b/browsers-api/browsers.launch/index.html
@@ -6,7 +6,7 @@
launch() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.launchoptions/index.html b/browsers-api/browsers.launchoptions/index.html
index 467def65791..88aba04823d 100644
--- a/browsers-api/browsers.launchoptions/index.html
+++ b/browsers-api/browsers.launchoptions/index.html
@@ -6,7 +6,7 @@
LaunchOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.makeprogresscallback/index.html b/browsers-api/browsers.makeprogresscallback/index.html
index d66cd3cef35..0af7c4617ec 100644
--- a/browsers-api/browsers.makeprogresscallback/index.html
+++ b/browsers-api/browsers.makeprogresscallback/index.html
@@ -6,7 +6,7 @@
makeProgressCallback() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.options/index.html b/browsers-api/browsers.options/index.html
index c17ce75da7b..f817e306b48 100644
--- a/browsers-api/browsers.options/index.html
+++ b/browsers-api/browsers.options/index.html
@@ -6,7 +6,7 @@
Options interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.process._constructor_/index.html b/browsers-api/browsers.process._constructor_/index.html
index 6221e523ee7..a998b4af4fe 100644
--- a/browsers-api/browsers.process._constructor_/index.html
+++ b/browsers-api/browsers.process._constructor_/index.html
@@ -6,7 +6,7 @@
Process.(constructor) | Puppeteer
-
+
diff --git a/browsers-api/browsers.process.close/index.html b/browsers-api/browsers.process.close/index.html
index 7531a1f24b0..7e47f93cf9d 100644
--- a/browsers-api/browsers.process.close/index.html
+++ b/browsers-api/browsers.process.close/index.html
@@ -6,7 +6,7 @@
Process.close() method | Puppeteer
-
+
diff --git a/browsers-api/browsers.process.hasclosed/index.html b/browsers-api/browsers.process.hasclosed/index.html
index 4cd129c2d3c..95c06fcb89b 100644
--- a/browsers-api/browsers.process.hasclosed/index.html
+++ b/browsers-api/browsers.process.hasclosed/index.html
@@ -6,7 +6,7 @@
Process.hasClosed() method | Puppeteer
-
+
diff --git a/browsers-api/browsers.process.kill/index.html b/browsers-api/browsers.process.kill/index.html
index bad74e7ee6b..e4d2512273b 100644
--- a/browsers-api/browsers.process.kill/index.html
+++ b/browsers-api/browsers.process.kill/index.html
@@ -6,7 +6,7 @@
Process.kill() method | Puppeteer
-
+
diff --git a/browsers-api/browsers.process.waitforlineoutput/index.html b/browsers-api/browsers.process.waitforlineoutput/index.html
index d438fc45d24..2af8fc87962 100644
--- a/browsers-api/browsers.process.waitforlineoutput/index.html
+++ b/browsers-api/browsers.process.waitforlineoutput/index.html
@@ -6,7 +6,7 @@
Process.waitForLineOutput() method | Puppeteer
-
+
diff --git a/browsers-api/browsers.process/index.html b/browsers-api/browsers.process/index.html
index 6af3295b63c..360cf893f3c 100644
--- a/browsers-api/browsers.process/index.html
+++ b/browsers-api/browsers.process/index.html
@@ -6,7 +6,7 @@
Process class | Puppeteer
-
+
diff --git a/browsers-api/browsers.profileoptions/index.html b/browsers-api/browsers.profileoptions/index.html
index f51b534560a..ca1fc70920e 100644
--- a/browsers-api/browsers.profileoptions/index.html
+++ b/browsers-api/browsers.profileoptions/index.html
@@ -6,7 +6,7 @@
ProfileOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.resolvebuildid/index.html b/browsers-api/browsers.resolvebuildid/index.html
index be2a48fbbae..369d7964c47 100644
--- a/browsers-api/browsers.resolvebuildid/index.html
+++ b/browsers-api/browsers.resolvebuildid/index.html
@@ -6,7 +6,7 @@
resolveBuildId() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.systemoptions/index.html b/browsers-api/browsers.systemoptions/index.html
index 61fee16ac7b..47e65955e9a 100644
--- a/browsers-api/browsers.systemoptions/index.html
+++ b/browsers-api/browsers.systemoptions/index.html
@@ -6,7 +6,7 @@
SystemOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.timeouterror/index.html b/browsers-api/browsers.timeouterror/index.html
index 5c43da31152..465ac2ea900 100644
--- a/browsers-api/browsers.timeouterror/index.html
+++ b/browsers-api/browsers.timeouterror/index.html
@@ -6,7 +6,7 @@
TimeoutError class | Puppeteer
-
+
diff --git a/browsers-api/browsers.uninstall/index.html b/browsers-api/browsers.uninstall/index.html
index 2cfe09ce5b3..53ae8cfad69 100644
--- a/browsers-api/browsers.uninstall/index.html
+++ b/browsers-api/browsers.uninstall/index.html
@@ -6,7 +6,7 @@
uninstall() function | Puppeteer
-
+
diff --git a/browsers-api/browsers.uninstalloptions/index.html b/browsers-api/browsers.uninstalloptions/index.html
index c65c84b76cb..0c345a5b993 100644
--- a/browsers-api/browsers.uninstalloptions/index.html
+++ b/browsers-api/browsers.uninstalloptions/index.html
@@ -6,7 +6,7 @@
UninstallOptions interface | Puppeteer
-
+
diff --git a/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex/index.html b/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex/index.html
index 15285d3c773..854e6eec4f2 100644
--- a/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex/index.html
+++ b/browsers-api/browsers.webdriver_bidi_websocket_endpoint_regex/index.html
@@ -6,7 +6,7 @@
WEBDRIVER_BIDI_WEBSOCKET_ENDPOINT_REGEX variable | Puppeteer
-
+
diff --git a/browsers-api/index.html b/browsers-api/index.html
index 7f983feec3e..d74e4165ac3 100644
--- a/browsers-api/index.html
+++ b/browsers-api/index.html
@@ -6,7 +6,7 @@
@puppeteer/browsers | Puppeteer
-
+
diff --git a/category/guides/index.html b/category/guides/index.html
index e16a9836486..981c85796b0 100644
--- a/category/guides/index.html
+++ b/category/guides/index.html
@@ -6,7 +6,7 @@
Puppeteer Guides | Puppeteer
-
+
diff --git a/category/integrations/index.html b/category/integrations/index.html
index 88e03918705..ebe9bc4bf05 100644
--- a/category/integrations/index.html
+++ b/category/integrations/index.html
@@ -6,7 +6,7 @@
Puppeteer Integrations | Puppeteer
-
+
diff --git a/chromium-support/index.html b/chromium-support/index.html
index c35e7b97fe2..2d44c1dd58b 100644
--- a/chromium-support/index.html
+++ b/chromium-support/index.html
@@ -6,7 +6,7 @@
Chromium Support | Puppeteer
-
+
diff --git a/contributing/index.html b/contributing/index.html
index 4ff5bffd595..648300cc148 100644
--- a/contributing/index.html
+++ b/contributing/index.html
@@ -6,7 +6,7 @@
Contributing | Puppeteer
-
+
diff --git a/faq/index.html b/faq/index.html
index 6533cda9b7f..b394fd98e02 100644
--- a/faq/index.html
+++ b/faq/index.html
@@ -6,7 +6,7 @@
FAQ | Puppeteer
-
+
diff --git a/guides/chrome-extensions/index.html b/guides/chrome-extensions/index.html
index d5cdce7d784..aed81be1d77 100644
--- a/guides/chrome-extensions/index.html
+++ b/guides/chrome-extensions/index.html
@@ -6,7 +6,7 @@
Chrome Extensions | Puppeteer
-
+
diff --git a/guides/configuration/index.html b/guides/configuration/index.html
index e7f444e9b66..f8d52097abb 100644
--- a/guides/configuration/index.html
+++ b/guides/configuration/index.html
@@ -6,7 +6,7 @@
Configuration | Puppeteer
-
+
diff --git a/guides/debugging/index.html b/guides/debugging/index.html
index e703a749e16..74f2f1e9cfd 100644
--- a/guides/debugging/index.html
+++ b/guides/debugging/index.html
@@ -6,7 +6,7 @@
Debugging | Puppeteer
-
+
diff --git a/guides/docker/index.html b/guides/docker/index.html
index de1b2379cc7..b7be75db9fa 100644
--- a/guides/docker/index.html
+++ b/guides/docker/index.html
@@ -6,7 +6,7 @@
Docker | Puppeteer
-
+
diff --git a/guides/evaluate-javascript/index.html b/guides/evaluate-javascript/index.html
index 26c25bac2b6..db50c30ff48 100644
--- a/guides/evaluate-javascript/index.html
+++ b/guides/evaluate-javascript/index.html
@@ -6,7 +6,7 @@
Evaluate JavaScript | Puppeteer
-
+
diff --git a/guides/locators/index.html b/guides/locators/index.html
index 1510b21a3e9..cfc6ef46c37 100644
--- a/guides/locators/index.html
+++ b/guides/locators/index.html
@@ -6,7 +6,7 @@
Locators | Puppeteer
-
+
diff --git a/guides/query-selectors-legacy/index.html b/guides/query-selectors-legacy/index.html
index 6dc502237b2..4ad7cb38d6c 100644
--- a/guides/query-selectors-legacy/index.html
+++ b/guides/query-selectors-legacy/index.html
@@ -6,7 +6,7 @@
Query Selectors (legacy) | Puppeteer
-
+
diff --git a/guides/query-selectors/index.html b/guides/query-selectors/index.html
index c239fe2cd26..621d80487e7 100644
--- a/guides/query-selectors/index.html
+++ b/guides/query-selectors/index.html
@@ -6,7 +6,7 @@
Query Selectors | Puppeteer
-
+
diff --git a/guides/request-interception/index.html b/guides/request-interception/index.html
index 5a3ddc747a4..e29994dba33 100644
--- a/guides/request-interception/index.html
+++ b/guides/request-interception/index.html
@@ -6,7 +6,7 @@
Request Interception | Puppeteer
-
+
diff --git a/index.html b/index.html
index 6bb66d0bf99..f27f28005b3 100644
--- a/index.html
+++ b/index.html
@@ -6,7 +6,7 @@
Puppeteer | Puppeteer
-
+
diff --git a/integrations/ng-schematics/index.html b/integrations/ng-schematics/index.html
index e0f03133635..23eef278a00 100644
--- a/integrations/ng-schematics/index.html
+++ b/integrations/ng-schematics/index.html
@@ -6,7 +6,7 @@
Puppeteer Angular Schematic | Puppeteer
-
+
@@ -33,7 +33,7 @@
Option Description Value Required --test-runner
The testing framework to install along side Puppeteer. "jasmine"
, "jest"
, "mocha"
, "node"
true
Creating a single test file
Puppeteer Angular Schematic exposes a method to create a single test file.
-ng generate @puppeteer/ng-schematics:test "<TestName>"
+ng generate @puppeteer/ng-schematics:e2e "<TestName>"
Running test server and dev server at the same time
By default the E2E test will run the app on the same port as ng start
.
To avoid this you can specify the port the an the angular.json
@@ -43,22 +43,20 @@ Update either e2e
or puppeteer
(depending on the initi
const baseUrl = 'http://localhost:8080' ;
Contributing
Check out our contributing guide to get an overview of what you need to develop in the Puppeteer repo.
-Sandbox
-For easier development we provide a script to auto-generate the Angular project to test against. Simply run:
-npm run sandbox -- --init
-After that to run @puppeteer/ng-schematics
against the Sandbox Angular project run:
-npm run sandbox npm run sandbox -- --build
-To run the creating of single test schematic:
-
-To create a multi project workspace use the following command
-npm run sandbox -- --init --multi
+Sandbox smoke tests
+To make integration easier smoke test can be run with a single command, that will create a fresh install of Angular (single application and a milti application projects). Then it will install the schematics inside them and run the initial e2e tests:
+
Unit Testing
The schematics utilize @angular-devkit/schematics/testing
for verifying correct file creation and package.json
updates. To execute the test suit:
Migrating from Protractor
-Browser
-Puppeteer has its own browser
that exposes different API compared to the one exposed by Protractor.
-import puppeteer from 'puppeteer' ; ( async ( ) => { const browser = await puppeteer . launch ( ) ; it ( 'should work' , ( ) => { const page = await browser . newPage ( ) ; const element = await page . $ ( 'my-component' ) ; await element . click ( ) ; } ) ; await browser . close ( ) ; } ) ( ) ;
+Entry point
+Puppeteer has its own browser
that exposes the browser process.
+A more closes comparison for Protractor's browser
would be Puppeteer's page
.
+import { setupBrowserHooks , getBrowserState } from './utils' ; describe ( '<Test Name>' , function ( ) { setupBrowserHooks ( ) ; it ( 'is running' , async function ( ) { const { page } = getBrowserState ( ) ; await page . locator ( 'my-component' ) . click ( ) ; } ) ; } ) ;
+Getting element properties
+You can easily get any property of the element.
+import { setupBrowserHooks , getBrowserState } from './utils' ; describe ( '<Test Name>' , function ( ) { setupBrowserHooks ( ) ; it ( 'is running' , async function ( ) { const { page } = getBrowserState ( ) ; const elementText = await page . locator ( '.my-component' ) . map ( button => button . innerText ) . wait ( ) ; } ) ; } ) ;
Query Selectors
Puppeteer supports multiple types of selectors, namely, the CSS, ARIA, text, XPath and pierce selectors.
The following table shows Puppeteer's equivalents to Protractor By .
@@ -69,6 +67,14 @@ The following table shows Puppeteer's equivalents to Custom selectors .
-
+
+Actions Selectors
+Puppeteer allows you to all necessary actions to allow test your application.
+element ( locator ) . click ( ) ; await page . locator ( locator ) . click ( ) ; element ( locator ) . sendKeys ( 'my text' ) ; await page . locator ( locator ) . fill ( 'my text' ) ; element ( locator ) . clear ( ) ; await page . locator ( locator ) . fill ( '' ) ; element ( locator ) . getAttribute ( 'value' ) ; const element = await page . locator ( locator ) . waitHandle ( ) ; const value = await element . getProperty ( 'value' ) ;
+Example
+Sample Protractor test:
+describe ( 'Protractor Demo' , function ( ) { it ( 'should add one and two' , function ( ) { browser . get ( 'http://juliemr.github.io/protractor-demo/' ) ; element ( by . model ( 'first' ) ) . sendKeys ( 1 ) ; element ( by . model ( 'second' ) ) . sendKeys ( 2 ) ; element ( by . id ( 'gobutton' ) ) . click ( ) ; expect ( element ( by . binding ( 'latest' ) ) . getText ( ) ) . toEqual ( '3' ) ; } ) ; } ) ;
+Sample Puppeteer migration:
+import { setupBrowserHooks , getBrowserState } from './utils' ; describe ( 'Puppeteer Demo' , function ( ) { setupBrowserHooks ( ) ; it ( 'should add one and two' , function ( ) { const { page } = getBrowserState ( ) ; await page . goto ( 'http://juliemr.github.io/protractor-demo/' ) ; await page . locator ( '.form-inline > input:nth-child(1)' ) . fill ( '1' ) ; await page . locator ( '.form-inline > input:nth-child(2)' ) . fill ( '2' ) ; await page . locator ( '#gobutton' ) . fill ( '2' ) ; const result = await page . locator ( '.table tbody td:last-of-type' ) . map ( header => header . innerText ) . wait ( ) ; expect ( result ) . toEqual ( '3' ) ; } ) ; } ) ;