Skip to content

Instantly share code, notes, and snippets.

@OrKoN
Created April 12, 2023 15:37
Show Gist options
  • Save OrKoN/0c198de4089e8668a48746b223a37d8d to your computer and use it in GitHub Desktop.
Save OrKoN/0c198de4089e8668a48746b223a37d8d to your computer and use it in GitHub Desktop.
Accessibility
✔ should work (338ms)
✔ should report uninteresting nodes (522ms)
✔ get snapshots while the tree is re-calculated (208ms)
✔ roledescription
✔ orientation
✔ autocomplete
✔ multiselectable
✔ keyshortcuts
filtering children of leaf nodes
✔ should not report text nodes inside controls
✔ rich text editable fields should have children
✔ rich text editable fields with role should have children
✔ non editable textbox with role and tabIndex and label should not have children
✔ checkbox with and tabIndex and label should not have children
✔ checkbox without label should not have children
plaintext contenteditable
✔ plain text field with role should not have children
root option
✔ should work a button (38ms)
✔ should work an input
✔ should work a menu
✔ should return null when the element is no longer in DOM
✔ should support the interestingOnly option (38ms)
AriaQueryHandler
parseAriaSelector
✔ should find button (211ms)
queryOne
✔ should find button by role (39ms)
✔ should find button by name and role
✔ should find first matching element
✔ should find by name
✔ should find by name
queryAll
✔ should find menu by name
queryAllArray
✔ $$eval should handle many elements (17750ms)
waitForSelector (aria)
✔ should immediately resolve promise if node exists (79ms)
✔ should work for ElementHandle.waitForSelector (78ms)
✔ should persist query handler bindings across reloads (104ms)
✔ should persist query handler bindings across navigations (349ms)
✔ should work independently of `exposeFunction` (74ms)
✔ should work with removed MutationObserver (53ms)
✔ should resolve promise when node is added (68ms)
✔ should work when node is added through innerHTML (54ms)
✔ Page.waitForSelector is shortcut for main frame (95ms)
✔ should run in specified frame (97ms)
✔ should throw when frame is detached (41ms)
✔ should survive cross-process navigation (364ms)
✔ should wait for visible (42ms)
✔ should wait for visible recursively (44ms)
✔ hidden should wait for visibility: hidden (71ms)
✔ hidden should wait for display: none (72ms)
✔ hidden should wait for removal (61ms)
✔ should return null if waiting to hide non-existing element
✔ should respect timeout
✔ should have an error message specifically for awaiting an element to be hidden
✔ should respond to node attribute mutation
✔ should return the element handle (40ms)
✔ should have correct stack trace for timeout
queryOne (Chromium web test)
✔ should find by name "foo"
✔ should find by name "bar"
✔ should find treeitem by name
✔ should find by role "button"
✔ should find by role "heading"
✔ should find both ignored and unignored
WebDriver BiDi
Connection
✔ should work
Browser specs
Browser.version
✔ should return whether we are in headless
Browser.userAgent
✔ should include WebKit
Browser.target
✔ should return browser target
Browser.process
✔ should return child_process instance
✔ should not return child_process for remote browser
Browser.isConnected
✔ should set the browser connected state
BrowserContext
✔ should have default context
✔ should create new incognito context
✔ should close all belonging targets once closing context (274ms)
✔ window.open should use parent tab context (253ms)
✔ should fire target events (160ms)
✔ should wait for a target (164ms)
✔ should timeout waiting for a non-existent target
✔ should isolate localStorage and cookies (357ms)
✔ should work across sessions
✔ should provide a context id
Target.createCDPSession
✔ should work
✔ should not report created targets for custom CDP sessions (129ms)
✔ should send events
✔ should enable and disable domains independently
✔ should be able to detach session
✔ should throw nice errors
✔ should expose the underlying connection
Chromium-Specific Launcher tests
Puppeteer.launch |browserURL| option
✔ should be able to connect using browserUrl, with and without trailing slash (765ms)
✔ should throw when using both browserWSEndpoint and browserURL (353ms)
✔ should throw when trying to connect to non-existing browser (324ms)
Puppeteer.launch |pipe| option
✔ should support the pipe option (692ms)
✔ should support the pipe argument (690ms)
✔ should fire "disconnected" when closing with pipe (210ms)
Chromium-Specific Page Tests
✔ Page.setRequestInterception should work with intervention headers (43ms)
Page.click
✔ should click the button (82ms)
✔ should click svg (43ms)
✔ should click the button if window.Node is removed (107ms)
✔ should click on a span with an inline element inside (73ms)
✔ should not throw UnhandledPromiseRejection when page closes (131ms)
✔ should click the button after navigation (180ms)
✔ should click with disabled javascript (80ms)
✔ should scroll and click with disabled javascript (103ms)
✔ should click when one of inline box children is outside of viewport (120ms)
✔ should select the text by triple clicking (426ms)
✔ should click offscreen buttons (414ms)
✔ should click wrapped links (77ms)
✔ should click on checkbox input and toggle (96ms)
✔ should click on checkbox label and toggle (104ms)
✔ should fail to click a missing button (49ms)
✔ should not hang with touch-enabled viewports
✔ should scroll and click the button (137ms)
✔ should double click the button (73ms)
✔ should click a partially obscured button (78ms)
✔ should click a rotated button (71ms)
✔ should fire contextmenu event on right click (98ms)
✔ should fire aux event on middle click (101ms)
✔ should fire back click (122ms)
✔ should fire forward click (84ms)
✔ should click links which cause navigation (69ms)
✔ should click the button inside an iframe (105ms)
- should click the button with fixed position inside an iframe
✔ should click the button with deviceScaleFactor set (97ms)
Cookie specs
Page.cookies
✔ should return no cookies in pristine browser context
✔ should get a cookie
✔ should properly report httpOnly cookie
✔ should properly report "Strict" sameSite cookie
✔ should properly report "Lax" sameSite cookie
✔ should get multiple cookies
✔ should get cookies from multiple urls
Page.setCookie
✔ should work
✔ should isolate cookies in browser contexts (185ms)
✔ should set multiple cookies
✔ should have |expires| set to |-1| for session cookies
✔ should set cookie with reasonable defaults
✔ should set a cookie with a path (262ms)
✔ should not set a cookie on a blank page
✔ should not set a cookie with blank page URL
✔ should not set a cookie on a data URL page
✔ should default to setting secure cookie for HTTPS websites
✔ should be able to set insecure cookie for HTTP website
✔ should set a cookie on a different domain
✔ should set cookies from a frame (183ms)
✔ should set secure same-site cookies from a frame (844ms)
Page.deleteCookie
✔ should work
Coverage specs
JSCoverage
✔ should work (1977ms)
✔ should report sourceURLs
✔ should ignore eval() scripts by default
✔ shouldn't ignore eval() scripts if reportAnonymousScripts is true
✔ should ignore pptr internal scripts if reportAnonymousScripts is true
✔ should report multiple scripts (46ms)
✔ should report right ranges
✔ should report right ranges for "per function" scope
✔ should report scripts that have no coverage
✔ should work with conditionals
- should not hang when there is a debugger statement
- should not hang when there is a debugger statement
resetOnNavigation
✔ should report scripts across navigations when disabled (58ms)
✔ should NOT report scripts across navigations when enabled (49ms)
includeRawScriptCoverage
✔ should not include rawScriptCoverage field when disabled (1971ms)
✔ should include rawScriptCoverage field when enabled (1974ms)
CSSCoverage
✔ should work (46ms)
✔ should report sourceURLs
✔ should report multiple stylesheets
✔ should report stylesheets that have no coverage
✔ should work with media queries
✔ should work with complicated usecases (57ms)
✔ should work with empty stylesheets (41ms)
✔ should ignore injected stylesheets
✔ should work with a recently loaded stylesheet
resetOnNavigation
✔ should report stylesheets across navigations (47ms)
✔ should NOT report scripts across navigations (49ms)
DefaultBrowserContext
✔ page.cookies() should work
✔ page.setCookie() should work
✔ page.deleteCookie() should work
DeviceRequestPrompt
waitForDevicePrompt
✔ should return prompt
✔ should respect timeout
✔ should respect default timeout when there is no custom timeout
✔ should prioritize exact timeout over default timeout
✔ should work with no timeout (51ms)
✔ should return the same prompt when there are many watchdogs simultaneously
✔ should listen and shortcut when there are no watchdogs
DeviceRequestPrompt.devices
✔ lists devices as they arrive
✔ does not list devices from events of another prompt
DeviceRequestPrompt.waitForDevice
✔ should return first matching device
✔ should return first matching device from already known devices
✔ should return device in the devices list
✔ should respect timeout
✔ should respect default timeout when there is no custom timeout
✔ should prioritize exact timeout over default timeout
✔ should work with no timeout
✔ should return same device from multiple watchdogs
DeviceRequestPrompt.select
✔ should succeed with listed device
✔ should error for device not listed in devices
✔ should fail when selecting prompt twice
DeviceRequestPrompt.cancel
✔ should succeed on first call
✔ should fail when canceling prompt twice
Page.Events.Dialog
✔ should fire
✔ should allow accepting prompts
✔ should dismiss the prompt
Input.drag
✔ should throw an exception if not enabled before usage (64ms)
✔ should emit a dragIntercepted event when dragged (80ms)
✔ should emit a dragEnter (101ms)
✔ should emit a dragOver event (132ms)
✔ can be dropped (146ms)
✔ can be dragged and dropped with a single function (99ms)
✔ can be disabled (76ms)
ElementHandle specs
ElementHandle.boundingBox
✔ should work (170ms)
✔ should handle nested frames (142ms)
✔ should return null for invisible elements
✔ should force a layout
✔ should work with SVG nodes
ElementHandle.boxModel
✔ should work (57ms)
✔ should return null for invisible elements
ElementHandle.contentFrame
✔ should work (63ms)
ElementHandle.isVisible and ElementHandle.isHidden
✔ should work (51ms)
ElementHandle.click
✔ should work (75ms)
✔ should return Point data (70ms)
✔ should work for Shadow DOM v1 (82ms)
✔ should not work for TextNodes (43ms)
✔ should throw for detached nodes (65ms)
✔ should throw for hidden nodes (68ms)
✔ should throw for recursively hidden nodes (72ms)
✔ should throw for <br> elements (39ms)
ElementHandle.clickablePoint
✔ should work
✔ should work for iframes (367ms)
Element.waitForSelector
✔ should wait correctly with waitForSelector on an element (54ms)
Element.waitForXPath
✔ should wait correctly with waitForXPath on an element (56ms)
ElementHandle.hover
✔ should work (101ms)
ElementHandle.isIntersectingViewport
✔ should work (214ms)
✔ should work with threshold (54ms)
✔ should work with threshold of 1 (61ms)
✔ should work with svg elements (158ms)
Custom queries
✔ should register and unregister
✔ should throw with invalid query names
✔ should work for multiple elements (48ms)
✔ should eval correctly (40ms)
✔ should wait correctly with waitForSelector
✔ should wait correctly with waitForSelector on an element (46ms)
✔ should wait correctly with waitFor
✔ should work when both queryOne and queryAll are registered (41ms)
✔ should eval when both queryOne and queryAll are registered (44ms)
✔ should work with function shorthands
Element.toElement
✔ should work
Emulation
Page.viewport
✔ should get the proper viewport size
✔ should support mobile emulation (82ms)
✔ should support touch emulation (69ms)
✔ should be detectable by Modernizr (109ms)
✔ should detect touch when applying viewport with touches (41ms)
✔ should support landscape emulation (64ms)
Page.emulate
✔ should work (43ms)
✔ should support clicking (105ms)
Page.emulateMediaType
✔ should work
✔ should throw in case of bad argument
Page.emulateMediaFeatures
✔ should work (48ms)
✔ should throw in case of bad argument
Page.emulateTimezone
✔ should work
✔ should throw for invalid timezone IDs
Page.emulateVisionDeficiency
✔ should work (1706ms)
✔ should throw for invalid vision deficiencies
Page.emulateNetworkConditions
✔ should change navigator.connection.effectiveType
Page.emulateCPUThrottling
✔ should change the CPU throttling rate successfully
Evaluation specs
Page.evaluate
✔ should work
✔ should transfer BigInt
✔ should transfer NaN
✔ should transfer -0
✔ should transfer Infinity
✔ should transfer -Infinity
✔ should transfer arrays
✔ should transfer arrays as arrays, not objects
✔ should modify global environment
✔ should evaluate in the page context
✔ should return undefined for objects with symbols
✔ should work with function shorthands
✔ should work with unicode chars
✔ should throw when evaluation triggers reload
✔ should await promise
✔ should work right after framenavigated
✔ should work from-inside an exposed function
✔ should reject promise with exception
✔ should support thrown strings as error messages
✔ should support thrown numbers as error messages
✔ should return complex objects
✔ should return BigInt
✔ should return NaN
✔ should return -0
✔ should return Infinity
✔ should return -Infinity
✔ should accept "null" as one of multiple parameters
✔ should properly serialize null fields
✔ should return undefined for non-serializable objects (51ms)
✔ should return promise as empty object
✔ should fail for circular object
✔ should be able to throw a tricky error (57ms)
✔ should accept a string
✔ should accept a string with semi colons
✔ should accept a string with comments
✔ should accept element handle as an argument
✔ should throw if underlying element was disposed
✔ should throw if elementHandles are from other frames (40ms)
✔ should simulate a user gesture
✔ should throw a nice error after a navigation
✔ should not throw an error when evaluation does a navigation
✔ should transfer 100Mb of data from page to node.js (5599ms)
✔ should throw error with detailed information on exception inside promise
Page.evaluateOnNewDocument
✔ should evaluate before anything else on the page
✔ should work with CSP (45ms)
Frame.evaluate
✔ should have different execution contexts (50ms)
✔ should have correct execution contexts (64ms)
✔ should execute after cross-site navigation (155ms)
EventEmitter
on
✔ on: adds an event listener that is fired when the event is emitted
✔ on sends the event data to the handler
✔ on: supports chaining
✔ addListener: adds an event listener that is fired when the event is emitted
✔ addListener sends the event data to the handler
✔ addListener: supports chaining
off
✔ off: removes the listener so it is no longer called
✔ off: supports chaining
✔ removeListener: removes the listener so it is no longer called
✔ removeListener: supports chaining
once
✔ only calls the listener once and then removes it
✔ supports chaining
emit
✔ calls all the listeners for an event
✔ passes data through to the listener
✔ returns true if the event has listeners
✔ returns false if the event has listeners
listenerCount
✔ returns the number of listeners for the given event
removeAllListeners
✔ removes every listener from all events by default
✔ returns the emitter for chaining
✔ can filter to remove only listeners for a given event name
Fixtures
✔ dumpio option should work with pipe option (1324ms)
✔ should dump browser process stderr (1155ms)
✔ should close the browser when the node process closes (1043ms)
Frame specs
Frame.executionContext
✔ should work (61ms)
Frame.evaluateHandle
✔ should work
Frame.evaluate
✔ should throw for detached frames
✔ allows readonly array to be an argument
Frame.page
✔ should retrieve the page from a frame
Frame Management
✔ should handle nested frames (132ms)
✔ should send events when frames are manipulated dynamically (86ms)
✔ should send "framenavigated" when navigating on anchor URLs
✔ should persist mainFrame on cross-process navigation (173ms)
✔ should not send attach/detach events for main frame
✔ should detach child frames on navigation (161ms)
✔ should support framesets (103ms)
✔ should report frame from-inside shadow DOM (62ms)
✔ should report frame.name() (55ms)
✔ should report frame.parent() (43ms)
✔ should report different frame instance when frame re-attaches (40ms)
✔ should support url fragment (50ms)
✔ should support lazy frames
Frame.client
✔ should return the client instance
headful tests
HEADFUL
✔ background_page target type should be available (2901ms)
✔ service_worker target type should be available (1697ms)
✔ target.page() should return a background_page (1877ms)
✔ target.page() should return a DevTools page if custom isPageTarget is provided (1046ms)
✔ should have default url when launching browser (1424ms)
✔ headless should be able to read cookies written by headful (2191ms)
- OOPIF: should report google.com frame
✔ OOPIF: should expose events within OOPIFs (2929ms)
✔ should close browser with beforeunload page (1485ms)
✔ should open devtools when "devtools: true" option is given (1749ms)
Page.bringToFront
✔ should work (1500ms)
Page.screenshot
✔ should run in parallel in multiple pages (2200ms)
Emulate idle state
✔ changing idle state emulation causes change of the IdleDetector state (93ms)
ignoreHTTPSErrors
✔ should work (44ms)
✔ should work with request interception
✔ should work with mixed content (51ms)
Response.securityDetails
✔ should work
✔ should be |null| for non-secure requests
✔ Network redirects should report SecurityDetails
PuppeteerUtil tests
✔ should work
createFunction tests
✔ should work
input tests
input
✔ should upload the file (69ms)
Page.waitForFileChooser
✔ should work when file input is attached to DOM (60ms)
✔ should work when file input is not attached to DOM
✔ should respect timeout
✔ should respect default timeout when there is no custom timeout
✔ should prioritize exact timeout over default timeout
✔ should work with no timeout (60ms)
✔ should return the same file chooser when there are many watchdogs simultaneously
FileChooser.accept
✔ should accept single file (72ms)
✔ should be able to read selected file (41ms)
✔ should be able to reset selected files with empty file list (50ms)
✔ should not accept multiple files for single-file input (52ms)
✔ should succeed even for non-existent files (61ms)
✔ should error on read of non-existent files (43ms)
✔ should fail when accepting file chooser twice (42ms)
FileChooser.cancel
✔ should cancel dialog
✔ should fail when canceling file chooser twice
FileChooser.isMultiple
✔ should work for single file pick (47ms)
✔ should work for "multiple" (53ms)
✔ should work for "webkitdirectory" (55ms)
JSHandle
Page.evaluateHandle
✔ should work
✔ should return the RemoteObject
✔ should accept object handle as an argument
✔ should accept object handle to primitive types
✔ should warn about recursive objects
✔ should accept object handle to unserializable value
✔ should use the same JS wrappers
JSHandle.getProperty
✔ should work
JSHandle.jsonValue
✔ should work
✔ works with jsonValues that are not objects
✔ works with jsonValues that are primitives
✔ should not work with dates
✔ should throw for circular objects
JSHandle.getProperties
✔ should work
✔ should return even non-own properties
JSHandle.asElement
✔ should work
✔ should return null for non-elements
✔ should return ElementHandle for TextNodes
JSHandle.toString
✔ should work for primitives
✔ should work for complicated objects
✔ should work with different subtypes
Keyboard
✔ should type into a textarea (160ms)
✔ should press the metaKey
✔ should move with the arrow keys (161ms)
✔ should trigger commands of keyboard shortcuts (105ms)
✔ should send a character with ElementHandle.press (72ms)
✔ ElementHandle.press should support |text| option (147ms)
✔ should send a character with sendCharacter (1824ms)
✔ should report shiftKey (73ms)
✔ should report multiple modifiers (53ms)
✔ should send proper codes while typing (50ms)
✔ should send proper codes while typing with shift (50ms)
✔ should not type canceled events (107ms)
✔ should specify repeat property (101ms)
✔ should type all kinds of characters (246ms)
✔ should specify location (85ms)
✔ should throw on unknown keys
✔ should type emoji (274ms)
✔ should type emoji into an iframe (171ms)
✔ should press the meta key
Launcher specs
Puppeteer
BrowserFetcher
✔ should download and extract chrome linux binary (67ms)
✔ should download and extract firefox linux binary (119ms)
Browser.disconnect
✔ should reject navigation when browser closes (655ms)
✔ should reject waitForSelector when browser closes (576ms)
Browser.close
✔ should terminate network waiters (539ms)
Puppeteer.launch
✔ can launch and close the browser (258ms)
✔ should reject all promises when browser is closed (521ms)
✔ should reject if executable path is invalid
✔ userDataDir option (537ms)
✔ tmp profile should be cleaned up (503ms)
✔ userDataDir option restores preferences (526ms)
✔ userDataDir argument (426ms)
✔ userDataDir argument with non-existent dir (283ms)
✔ userDataDir option should restore state (1211ms)
✔ userDataDir option should restore cookies (1234ms)
✔ should return the default arguments
✔ should report the correct product
✔ should work with no default arguments (1377ms)
✔ should filter out ignored default arguments in Chrome (390ms)
✔ should filter out ignored default argument in Firefox (401ms)
✔ should have default URL when launching browser (426ms)
✔ should have custom URL when launching browser (453ms)
✔ should pass the timeout parameter to browser.waitForTarget
ERROR: The process with PID 6096 (child process of PID 1836) could not be terminated.
Reason: There is no running instance of the task.
✔ should work with timeout = 0 (369ms)
✔ should set the default viewport (547ms)
✔ should disable the default viewport (519ms)
✔ should take fullPage screenshots when defaultViewport is null (913ms)
✔ should set the debugging port (273ms)
✔ should not allow setting debuggingPort and pipe
✔ should launch Chrome properly with --no-startup-window and waitForInitialPage=false (1148ms)
Puppeteer.launch
✔ should be able to launch Chrome (340ms)
1) should be able to launch Firefox
Puppeteer.connect
✔ should be able to connect multiple times to the same browser (695ms)
✔ should be able to close remote browser (299ms)
✔ should be able to connect to a browser with no page targets (378ms)
✔ should support ignoreHTTPSErrors option (627ms)
✔ should support targetFilter option in puppeteer.launch (314ms)
✔ should support targetFilter option (881ms)
✔ should be able to reconnect to a disconnected browser (804ms)
✔ should be able to connect to the same page simultaneously (577ms)
✔ should be able to reconnect (730ms)
Puppeteer.executablePath
✔ should work
✔ returns executablePath for channel
when executable path is configured
✔ its value is used
when the product is chrome, platform is not darwin, and arch is arm64
and the executable exists
✔ returns /usr/bin/chromium-browser
and the executable path is configured
✔ its value is used
and the executable does not exist
✔ does not return /usr/bin/chromium-browser
Browser target events
✔ should work (709ms)
Browser.Events.disconnected
✔ should be emitted when: browser gets closed, disconnected or underlying websocket gets closed (449ms)
Mouse
✔ should click the document
✔ should resize the textarea (88ms)
✔ should select the text with mouse (382ms)
✔ should trigger hover state (167ms)
✔ should trigger hover state with removed window.Node (98ms)
✔ should set modifier keys on click (274ms)
✔ should send mouse wheel events (92ms)
✔ should tween mouse movement (74ms)
✔ should work with mobile viewports and cross process navigations (198ms)
navigation
Page.goto
✔ should work
✔ should work with anchor navigation
✔ should work with redirects
✔ should navigate to about:blank
✔ should return response when page changes its URL after load
✔ should work with subframes return 204
✔ should fail when server returns 204
✔ should navigate to empty page with domcontentloaded
✔ should work when page calls history API in beforeunload (131ms)
✔ should navigate to empty page with networkidle0 (1967ms)
✔ should navigate to empty page with networkidle2 (1974ms)
✔ should fail when navigating to bad url
✔ should fail when navigating to bad SSL
✔ should fail when navigating to bad SSL after redirects
✔ should fail when main resources failed to load (2354ms)
✔ should fail when exceeding maximum navigation timeout
✔ should fail when exceeding default maximum navigation timeout
✔ should fail when exceeding default maximum timeout
✔ should prioritize default navigation timeout over default timeout
✔ should disable timeout when its set to 0 (141ms)
✔ should work when navigating to valid url
✔ should work when navigating to data url
✔ should work when navigating to 404
✔ should not throw an error for a 404 response with an empty body
✔ should not throw an error for a 500 response with an empty body
✔ should return last response in redirect chain
✔ should wait for network idle to succeed navigation (1988ms)
✔ should not leak listeners during navigation (323ms)
✔ should not leak listeners during bad navigation
✔ should not leak listeners during navigation of 11 pages (2478ms)
✔ should navigate to dataURL and fire dataURL requests
✔ should navigate to URL with hash and fire requests without hash
✔ should work with self requesting page
✔ should fail when navigating and show the url at the error message
✔ should send referer (158ms)
✔ should send referer policy (171ms)
Page.waitForNavigation
✔ should work (170ms)
✔ should work with both domcontentloaded and load
✔ should work with clicking on anchor links (66ms)
✔ should work with history.pushState() (67ms)
✔ should work with history.replaceState() (72ms)
✔ should work with DOM history.back()/history.forward() (110ms)
✔ should work when subframe issues window.stop() (53ms)
Page.goBack
✔ should work (274ms)
✔ should work with HistoryAPI (41ms)
Frame.goto
✔ should navigate subframes (78ms)
✔ should reject when frame detaches (88ms)
✔ should return matching responses (174ms)
Frame.waitForNavigation
✔ should work (218ms)
✔ should fail when frame detaches (83ms)
Page.reload
✔ should work (40ms)
network
Page.Events.Request
✔ should fire for navigation requests
✔ should fire for iframes (51ms)
✔ should fire for fetches
Request.frame
✔ should work for main frame navigation request
✔ should work for subframe navigation request (42ms)
✔ should work for fetch requests
Request.headers
✔ should define Chrome as user agent header
- should define Firefox as user agent header
Response.headers
✔ should work
Request.initiator
✔ should return the initiator (81ms)
Response.fromCache
✔ should return |false| for non-cached content
✔ should work (48ms)
Response.fromServiceWorker
✔ should return |false| for non-service-worker content
✔ Response.fromServiceWorker (2010ms)
Request.postData
✔ should work
✔ should be |undefined| when there is no post data
Response.text
✔ should work
✔ should return uncompressed text
✔ should throw when requesting body of redirected response
✔ should wait until response completes (85ms)
Response.json
✔ should work
Response.buffer
✔ should work
✔ should work with compression
✔ should throw if the response does not have a body (48ms)
Response.statusText
✔ should work
✔ handles missing status text
Response.timing
✔ returns timing information
Network Events
✔ Page.Events.Request
✔ Page.Events.RequestServedFromCache (46ms)
✔ Page.Events.Response
✔ Page.Events.RequestFailed
✔ Page.Events.RequestFinished
✔ should fire events in proper order
✔ should support redirects
Request.isNavigationRequest
✔ should work (77ms)
✔ should work with request interception (70ms)
✔ should work when navigating to image
Page.setExtraHTTPHeaders
✔ should work
✔ should throw for non-string header values
Page.authenticate
✔ should work (64ms)
✔ should fail if wrong credentials
✔ should allow disable authentication (159ms)
✔ should not disable caching (64ms)
raw network headers
✔ Same-origin set-cookie navigation
✔ Same-origin set-cookie subresource
✔ Cross-origin set-cookie (723ms)
NetworkManager
✔ should process extra info on multiple redirects
✔ should handle "double pause" (crbug.com/1196004) Fetch.requestPaused events for the same Network.requestWillBeSent event
✔ should handle Network.responseReceivedExtraInfo event after Network.responseReceived event (github.com/puppeteer/puppeteer/issues/8234)
✔ should resolve the response once the late responseReceivedExtraInfo event arrives
✔ should send responses for iframe that don't receive loadingFinished event
✔ should send responses for iframe that don't receive loadingFinished event
✔ should handle cached redirects
OOPIF-debug
OOPIF
✔ should treat OOP iframes and normal iframes the same (151ms)
✔ should track navigations within OOP iframes (153ms)
✔ should support OOP iframes becoming normal iframes again (166ms)
✔ should support frames within OOP frames (160ms)
✔ should support OOP iframes getting detached (117ms)
✔ should support wait for navigation for transitions from local to OOPIF (104ms)
✔ should keep track of a frames OOP state (147ms)
✔ should support evaluating in oop iframes (169ms)
✔ should provide access to elements (204ms)
✔ should report oopif frames (116ms)
✔ should wait for inner OOPIFs (244ms)
✔ should load oopif iframes with subresources and request interception (129ms)
✔ should support frames within OOP iframes (209ms)
✔ clickablePoint, boundingBox, boxModel should work for elements inside OOPIFs (189ms)
✔ should detect existing OOPIFs when Puppeteer connects to an existing page (182ms)
✔ should support lazy OOP frames (68ms)
waitForFrame
✔ should resolve immediately if the frame already exists (119ms)
Page
Page.close
✔ should reject all promises when page is closed (145ms)
✔ should not be visible in browser.pages (151ms)
✔ should run beforeunload if asked for (221ms)
✔ should *not* run beforeunload by default (273ms)
✔ should set the page close state (129ms)
✔ should terminate network waiters (138ms)
Page.Events.Load
✔ should fire when expected
removing and adding event handlers
✔ should correctly fire event handlers as they are added and then removed (55ms)
✔ should correctly added and removed request events (68ms)
Page.Events.error
✔ should throw when page crashes (310ms)
Page.Events.Popup
✔ should work (85ms)
✔ should work with noopener (147ms)
✔ should work with clicking target=_blank and without rel=opener (214ms)
✔ should work with clicking target=_blank and with rel=opener (113ms)
✔ should work with fake-clicking target=_blank and rel=noopener (190ms)
✔ should work with clicking target=_blank and rel=noopener (217ms)
BrowserContext.overridePermissions
✔ should be prompt by default
✔ should deny permission when not listed (43ms)
✔ should fail when bad permission is given
✔ should grant permission when listed
✔ should reset permissions
✔ should trigger permission onchange
✔ should isolate permissions between browser contexts (202ms)
✔ should grant persistent-storage
Page.setGeolocation
✔ should work
✔ should throw when invalid longitude
Page.setOfflineMode
✔ should work (281ms)
✔ should emulate navigator.onLine
ExecutionContext.queryObjects
✔ should work (46ms)
✔ should work for non-trivial page (84ms)
✔ should fail for disposed handles
✔ should fail primitive values as prototypes
Page.Events.Console
✔ should work
✔ should work for different console API calls with logging functions
✔ should work for different console API calls with timing functions
✔ should not fail for window object
✔ should trigger correct Log
✔ should have location when fetch fails (4696ms)
✔ should have location and stack trace for console API calls (47ms)
✔ should not throw when there are console messages in detached iframes (78ms)
Page.Events.DOMContentLoaded
✔ should fire when expected
Page.metrics
✔ should get metrics from a page (91ms)
✔ metrics event fired on console.timeStamp
Page.waitForRequest
✔ should work
✔ should work with predicate
✔ should work with async predicate
✔ should respect timeout
✔ should respect default timeout
✔ should work with no timeout (78ms)
Page.waitForResponse
✔ should work
✔ should respect timeout
✔ should respect default timeout
✔ should work with predicate
✔ should work with async predicate
✔ should work with no timeout (84ms)
Page.waitForNetworkIdle
✔ should work (973ms)
✔ should respect timeout
✔ should respect idleTime (287ms)
✔ should work with no timeout (594ms)
✔ should work with aborted requests (578ms)
Page.exposeFunction
✔ should work
✔ should throw exception in page context (113ms)
✔ should support throwing "null"
✔ should be callable from-inside evaluateOnNewDocument (77ms)
✔ should survive navigation
✔ should await returned promise
✔ should work on frames (123ms)
✔ should work on frames before navigation (131ms)
✔ should not throw when frames detach (52ms)
✔ should work with complex objects
✔ should fallback to default export when passed a module object
Page.Events.PageError
✔ should fire
Page.setUserAgent
✔ should work
✔ should work for subframes (39ms)
✔ should emulate device user-agent
✔ should work with additional userAgentMetdata
Page.setContent
✔ should work
✔ should work with doctype
✔ should work with HTML 4 doctype
✔ should respect timeout
✔ should respect default navigation timeout
✔ should await resources to load
✔ should work fast enough (64ms)
✔ should work with tricky content (1706ms)
✔ should work with accents
✔ should work with emojis (38ms)
✔ should work with newline (38ms)
Page.setBypassCSP
✔ should bypass CSP meta tag (80ms)
✔ should bypass CSP header (76ms)
✔ should bypass after cross-process navigation (200ms)
✔ should bypass CSP in iframes as well (201ms)
Page.addScriptTag
✔ should throw an error if no options are provided
✔ should work with a url (42ms)
✔ should work with a url and type=module (53ms)
✔ should work with a path and type=module (55ms)
✔ should work with a content and type=module (56ms)
✔ should throw an error if loading from url fail
✔ should work with a path (38ms)
✔ should include sourcemap when path is provided
✔ should work with content (39ms)
✔ should add id when provided (65ms)
- should throw when added with content to the CSP page
✔ should throw when added with URL to the CSP page (51ms)
Page.addStyleTag
✔ should throw an error if no options are provided
✔ should work with a url (51ms)
✔ should throw an error if loading from url fail (39ms)
✔ should work with a path (43ms)
✔ should include sourcemap when path is provided (49ms)
✔ should work with content (48ms)
✔ should throw when added with content to the CSP page
✔ should throw when added with URL to the CSP page
Page.url
✔ should work
Page.setJavaScriptEnabled
✔ should work (38ms)
Page.setCacheEnabled
✔ should enable or disable the cache based on the state passed (69ms)
✔ should stay disabled when toggling request interception on/off (53ms)
Page.pdf
✔ can print to PDF and save to file (55ms)
✔ can print to PDF and stream the result
✔ should respect timeout
Page.title
✔ should return the page title
Page.select
✔ should select single option (63ms)
✔ should select only first option (65ms)
✔ should not throw when select causes navigation (86ms)
✔ should select multiple options (67ms)
✔ should respect event bubbling (68ms)
✔ should throw when element is not a <select> (60ms)
✔ should return [] on no matched values (62ms)
✔ should return an array of matched values (68ms)
✔ should return an array of one element when multiple is not set (63ms)
✔ should return [] on no values (64ms)
✔ should deselect all options when passed no values for a multiple select (82ms)
✔ should deselect all options when passed no values for a select without multiple (74ms)
✔ should throw if passed in non-strings
✔ should work when re-defining top-level Event class (63ms)
Page.Events.Close
✔ should work with window.close (93ms)
✔ should work with page.close (136ms)
Page.browser
✔ should return the correct browser instance
Page.browserContext
✔ should return the correct browser context instance
Page.client
✔ should return the client instance
request proxy
✔ should proxy requests when configured (603ms)
✔ should respect proxy bypass list (643ms)
in incognito browser context
✔ should proxy requests when configured at browser level (559ms)
✔ should respect proxy bypass list when configured at browser level (530ms)
- should proxy requests when configured at context level
✔ should respect proxy bypass list when configured at context level (522ms)
Query handler tests
Pierce selectors
✔ should find first element in shadow
✔ should find all elements in shadow
✔ should find first child element
✔ should find all child elements
Text selectors
in Page
✔ should query existing element
✔ should return empty array for non-existing element
✔ should return first element
✔ should return multiple elements
✔ should pierce shadow DOM
✔ should query deeply nested text
✔ should query inputs
✔ should not query radio
✔ should query text spanning multiple elements
✔ should clear caches (155ms)
in ElementHandles
✔ should query existing element (41ms)
✔ should return null for non-existing element
XPath selectors
in Page
✔ should query existing element
✔ should return empty array for non-existing element
✔ should return first element
✔ should return multiple elements
in ElementHandles
✔ should query existing element
✔ should return null for non-existing element (45ms)
P selectors
✔ should work with CSS selectors (60ms)
✔ should work with deep combinators (71ms)
✔ should work with text selectors
✔ should work ARIA selectors (51ms)
✔ should work XPath selectors
✔ should work with custom selectors
✔ should work with custom selectors with args (44ms)
✔ should work with :hover (55ms)
✔ should work with selector lists (42ms)
✔ should match querySelector* ordering (126ms)
✔ should not have duplicate elements from selector lists (43ms)
querySelector
Page.$eval
✔ should work
✔ should accept arguments
✔ should accept ElementHandles as arguments (38ms)
✔ should throw error if no element is found
Page.$$eval
✔ should work (42ms)
✔ should accept extra arguments (44ms)
✔ should accept ElementHandles as arguments (47ms)
✔ should handle many elements (550ms)
Page.$
✔ should query existing element
✔ should return null for non-existing element
Page.$$
✔ should query existing elements
✔ should return empty array if nothing is found (49ms)
Page.$x
✔ should query existing element
✔ should return empty array for non-existing element
✔ should return multiple elements
ElementHandle.$
✔ should query existing element (67ms)
✔ should return null for non-existing element
ElementHandle.$eval
✔ should work
✔ should retrieve content from subtree
✔ should throw in case of missing selector
ElementHandle.$$eval
✔ should work (44ms)
✔ should retrieve content from subtree (44ms)
✔ should not throw in case of missing selector
ElementHandle.$$
✔ should query existing elements (42ms)
✔ should return empty array for non-existing elements
ElementHandle.$x
✔ should query existing element (82ms)
✔ should return null for non-existing element
QueryAll
✔ should have registered handler
✔ $$ should query existing elements (39ms)
✔ $$ should return empty array for non-existing elements
✔ $$eval should work (43ms)
✔ $$eval should accept extra arguments (40ms)
✔ $$eval should accept ElementHandles as arguments (41ms)
✔ $$eval should handle many elements (564ms)
request interception
Page.setRequestInterception
✔ should cooperatively respond by priority (45ms)
✔ should cooperatively continue by priority
✔ should cooperatively abort by priority
✔ should intercept
✔ should work when POST is redirected with 302 (64ms)
✔ should work when header manipulation headers with redirect
✔ should be able to remove headers
✔ should contain referer header
✔ should properly return navigation response when URL has cookies (42ms)
✔ should stop intercepting (40ms)
✔ should show custom HTTP headers
✔ should work with redirect inside sync XHR
✔ should work with custom referer headers
✔ should be abortable
✔ should be able to access the error reason
✔ should be abortable with custom error codes
✔ should send referer (157ms)
✔ should fail navigation when aborting main resource
✔ should work with redirects
✔ should work with redirects for subresources (41ms)
✔ should be able to abort redirects
✔ should work with equal requests (44ms)
✔ should navigate to dataURL and fire dataURL requests
✔ should be able to fetch dataURL and fire dataURL requests
✔ should navigate to URL with hash and fire requests without hash
✔ should work with encoded server
✔ should work with badly encoded server
✔ should work with encoded server - 2
✔ should not throw "Invalid Interception Id" if the request was cancelled (49ms)
✔ should throw if interception is not enabled
✔ should work with file URLs
✔ should not cache if cache disabled (55ms)
✔ should cache if cache enabled (48ms)
✔ should load fonts if cache enabled (110ms)
Request.continue
✔ should work
✔ should amend HTTP headers
✔ should redirect in a way non-observable to page
✔ should amend method
✔ should amend post data
✔ should amend both post data and method on navigation
Request.respond
✔ should work (41ms)
✔ should be able to access the response
✔ should work with status code 422
✔ should redirect
✔ should allow mocking binary responses (79ms)
✔ should stringify intercepted request response headers (39ms)
✔ should indicate already-handled if an intercept has been handled
request interception
Page.setRequestInterception
✔ should intercept
✔ should work when POST is redirected with 302 (79ms)
✔ should work when header manipulation headers with redirect
✔ should be able to remove headers
✔ should contain referer header
✔ should properly return navigation response when URL has cookies (47ms)
✔ should stop intercepting (40ms)
✔ should show custom HTTP headers
✔ should work with redirect inside sync XHR
✔ should work with custom referer headers
✔ should be abortable
✔ should be abortable with custom error codes
✔ should send referer (155ms)
✔ should fail navigation when aborting main resource
✔ should work with redirects (47ms)
✔ should work with redirects for subresources (38ms)
✔ should be able to abort redirects
✔ should work with equal requests (44ms)
✔ should navigate to dataURL and fire dataURL requests
✔ should be able to fetch dataURL and fire dataURL requests
✔ should navigate to URL with hash and fire requests without hash
✔ should work with encoded server
✔ should work with badly encoded server
✔ should work with encoded server - 2
✔ should not throw "Invalid Interception Id" if the request was cancelled (46ms)
✔ should throw if interception is not enabled
✔ should work with file URLs
✔ should not cache if cache disabled (60ms)
✔ should cache if cache enabled (59ms)
✔ should load fonts if cache enabled (42ms)
Request.continue
✔ should work
✔ should amend HTTP headers
✔ should redirect in a way non-observable to page
✔ should amend method (38ms)
✔ should amend post data
✔ should amend both post data and method on navigation
✔ should fail if the header value is invalid
Request.respond
✔ should work
✔ should work with status code 422 (38ms)
✔ should redirect
✔ should allow mocking multiple headers with same key (44ms)
✔ should allow mocking binary responses (82ms)
✔ should stringify intercepted request response headers (40ms)
✔ should fail if the header value is invalid
Screenshots
Page.screenshot
✔ should work (294ms)
✔ should clip rect (203ms)
✔ should use scale for clip (195ms)
✔ should get screenshot bigger than the viewport (170ms)
✔ should run in parallel (254ms)
✔ should take fullPage screenshots (417ms)
✔ should run in parallel in multiple pages (555ms)
✔ should allow transparency (62ms)
✔ should render white background on jpeg file (79ms)
✔ should work with webp (136ms)
✔ should work with odd clip size on Retina displays
✔ should return base64 (281ms)
- should work in "fromSurface: false" mode
ElementHandle.screenshot
✔ should work (197ms)
✔ should work with a null viewport (791ms)
✔ should take into account padding and border (75ms)
✔ should capture full element when larger than viewport (288ms)
✔ should scroll element into view (88ms)
✔ should work with a rotated element (99ms)
✔ should fail to screenshot a detached element
✔ should not hang with zero width/height element
✔ should work for an element with fractional dimensions (52ms)
✔ should work for an element with an offset (56ms)
Target
✔ Browser.targets should return all of the targets
✔ Browser.pages should return all of the pages
✔ should contain browser target
✔ should be able to use the default page in the browser
✔ should be able to use async waitForTarget (90ms)
✔ should report when a new page is created and closed (108ms)
✔ should report when a service worker is created and destroyed (79ms)
✔ should create a worker from a service worker (47ms)
✔ should create a worker from a shared worker
✔ should report when a target url changes (282ms)
✔ should not report uninitialized pages (207ms)
✔ should not crash while redirecting if original request was missed (101ms)
✔ should have an opener (70ms)
Browser.waitForTarget
✔ should wait for a target (268ms)
✔ should timeout waiting for a non-existent target
TargetManager
✔ should handle targets (548ms)
Touchscreen
✔ should tap the button (115ms)
✔ should report touches (108ms)
✔ should report touchMove (122ms)
Tracing
✔ should output a trace (1249ms)
✔ should run with custom categories if provided (111ms)
✔ should run with default categories (116ms)
✔ should throw if tracing on two pages (325ms)
✔ should return a buffer (908ms)
✔ should work without options (1093ms)
✔ should return undefined in case of Buffer error (1527ms)
✔ should support a buffer without a path (1105ms)
✔ should properly fail if readProtocolStream errors out (109ms)
waittask specs
Frame.waitForFunction
✔ should accept a string
✔ should work when resolved right before execution context disposal (42ms)
✔ should poll on interval (121ms)
✔ should poll on mutation
✔ should poll on mutation async
✔ should poll on raf
✔ should poll on raf async
✔ should work with strict CSP policy (41ms)
✔ should throw negative polling interval
✔ should return the success value as a JSHandle
✔ should return the window as a success value
✔ should accept ElementHandle arguments
✔ should respect timeout
✔ should respect default timeout
✔ should disable timeout when its set to 0 (129ms)
✔ should survive cross-process navigation (297ms)
✔ should survive navigations (71ms)
Page.waitForTimeout
✔ waits for the given timeout before resolving (1022ms)
Frame.waitForTimeout
✔ waits for the given timeout before resolving (1022ms)
Frame.waitForSelector
✔ should immediately resolve promise if node exists (47ms)
✔ should work with removed MutationObserver
✔ should resolve promise when node is added (46ms)
✔ should work when node is added through innerHTML (47ms)
✔ Page.waitForSelector is shortcut for main frame (67ms)
✔ should run in specified frame (76ms)
✔ should throw when frame is detached
✔ should survive cross-process navigation (284ms)
✔ should wait for element to be visible (display) (75ms)
✔ should wait for element to be visible (visibility) (119ms)
✔ should wait for element to be visible (bounding box) (113ms)
✔ should wait for element to be visible recursively (116ms)
✔ should wait for element to be hidden (visibility) (74ms)
✔ should wait for element to be hidden (display) (67ms)
✔ should wait for element to be hidden (bounding box) (76ms)
✔ should wait for element to be hidden (removal) (78ms)
✔ should return null if waiting to hide non-existing element
✔ should respect timeout
✔ should have an error message specifically for awaiting an element to be hidden
✔ should respond to node attribute mutation
✔ should return the element handle (39ms)
✔ should have correct stack trace for timeout
Frame.waitForXPath
✔ should support some fancy xpath
✔ should respect timeout
✔ should run in specified frame (66ms)
✔ should throw when frame is detached
✔ hidden should wait for display: none (48ms)
✔ hidden should return null if the element is not found (83ms)
✔ hidden should return an empty element handle if the element is found
✔ should return the element handle
✔ should allow you to select a text node
✔ should allow you to select an element with single slash (38ms)
Workers
✔ Page.workers (69ms)
✔ should emit created and destroyed events
✔ should report console logs
✔ should have JSHandles for console logs
✔ should have an execution context
✔ should report errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment