playwright
Advanced tools
Comparing version 0.9.9 to 0.9.10
@@ -20,5 +20,2 @@ /** | ||
const descriptors = DeviceDescriptors.slice(); | ||
module.exports = descriptors; | ||
for (const device of descriptors) | ||
module.exports[device.name] = device; | ||
module.exports = DeviceDescriptors; |
@@ -1,7 +0,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export * from './lib/api'; | ||
export function playwright(browser: 'chromium'): import('./lib/api').Chromium; | ||
export function playwright(browser: 'firefox'): import('./lib/api').Firefox; | ||
export function playwright(browser: 'webkit'): import('./lib/api').WebKit; | ||
export function playwright(browser: 'chromium'): import('./lib/api').ChromiumPlaywright; | ||
export function playwright(browser: 'firefox'): import('./lib/api').FirefoxPlaywright; | ||
export function playwright(browser: 'webkit'): import('./lib/api').WebKitPlaywright; | ||
export function connect(browser: 'chromium'): import('./lib/api').ChromiumBrowser.connect; | ||
export function connect(browser: 'firefox'): import('./lib/api').FirefoxBrowser.connect; | ||
export function connect(browser: 'webkit'): import('./lib/api').WebKitBrowser.connect; |
27
index.js
@@ -1,3 +0,16 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
/** | ||
* Copyright (c) Microsoft Corporation. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
@@ -23,1 +36,11 @@ const {helper} = require('./lib/helper'); | ||
}; | ||
module.exports.connect = browser => { | ||
if (browser === 'chromium') | ||
return api.ChromiumBrowser.connect; | ||
if (browser === 'firefox') | ||
return api.FirefoxBrowser.connect; | ||
if (browser === 'webkit') | ||
return api.WebKitBrowser.connect; | ||
throw new Error(`Unsupported browser "${browser}"`); | ||
}; |
{ | ||
"name": "playwright", | ||
"version": "0.9.9", | ||
"description": "A high-level API to control web browsers", | ||
"version": "0.9.10", | ||
"description": "A high-level API to automate web browsers", | ||
"repository": "github:Microsoft/playwright", | ||
@@ -13,3 +13,3 @@ "engines": { | ||
"firefox_revision": "1009", | ||
"webkit_revision": "1055" | ||
"webkit_revision": "1068" | ||
}, | ||
@@ -37,3 +37,3 @@ "scripts": { | ||
}, | ||
"license": "MIT", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
@@ -40,0 +40,0 @@ "debug": "^4.1.0", |
@@ -0,4 +1,40 @@ | ||
# Playwright | ||
# Contributing | ||
[![npm version](https://badge.fury.io/js/playwright.svg)](https://badge.fury.io/js/playwright) | ||
Playwright is a Node library to automate web browsers (Chromium, Webkit and Firefox). | ||
## Getting started | ||
### Installation | ||
``` | ||
npm i playwright | ||
``` | ||
### Usage | ||
Playwright can be used to create a browser instance, open pages, and then manipulate them. See [API docs](https://github.com/microsoft/playwright/blob/master/docs/api.md) for a comprehensive list. | ||
#### Example | ||
This code snippet navigates to example.com in the Webkit browser, and saves a screenshot. | ||
```js | ||
const pw = require('playwright'); | ||
(async () => { | ||
const browser = await pw.playwright('webkit').launch(); // or 'chromium', 'firefox' | ||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
await page.goto('https://www.example.com/'); | ||
await page.screenshot({ path: 'example.png' }); | ||
await browser.close(); | ||
})(); | ||
``` | ||
## Contributing | ||
This project welcomes contributions and suggestions. Most contributions require you to agree to a | ||
@@ -5,0 +41,0 @@ Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
2130094
1
50564
51