diff --git a/packages/playwright/README.md b/packages/playwright/README.md index e5d0b2f058..b662a736d4 100644 --- a/packages/playwright/README.md +++ b/packages/playwright/README.md @@ -1,2 +1,2 @@ # playwright -This is a placeholder package for [Playwright](http://github.com/microsoft/playwright). Install one of `playwright-chromium`, `playwright-webkit`, or `playwright-firefox` to use playwright. +This packagage contains the [Chromium](https://www.chromium.org/), [Firefox](https://www.mozilla.org/firefox/) and [WebKit](https://www.webkit.org/) flavors of [Playwright](http://github.com/microsoft/playwright). diff --git a/packages/playwright/index.js b/packages/playwright/index.js new file mode 100644 index 0000000000..a85e0cb7f7 --- /dev/null +++ b/packages/playwright/index.js @@ -0,0 +1,16 @@ +/** + * 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. + */ +module.exports = require('playwright-core'); diff --git a/packages/playwright/install.js b/packages/playwright/install.js index 08e34d9585..17e5976528 100644 --- a/packages/playwright/install.js +++ b/packages/playwright/install.js @@ -13,5 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -console.error('This package, "playwright", is a placeholder. Please install "playwright-chromium", "playwright-firefox", or "playwright-webkit" to use playwright.'); -process.exit(1); +const {downloadBrowser} = require('playwright-core/download-browser'); +(async function() { + await downloadBrowser('chromium'); + await downloadBrowser('firefox'); + await downloadBrowser('webkit'); +})(); diff --git a/packages/playwright/package.json b/packages/playwright/package.json index 237f2f5867..fca9b1695e 100644 --- a/packages/playwright/package.json +++ b/packages/playwright/package.json @@ -10,5 +10,8 @@ "author": { "name": "Microsoft Corporation" }, - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "=0.9.13-post" + } } diff --git a/utils/sync_package_versions.js b/utils/sync_package_versions.js index 4f60e48f90..54954b2d69 100644 --- a/utils/sync_package_versions.js +++ b/utils/sync_package_versions.js @@ -16,11 +16,8 @@ const fs = require('fs'); const path = require('path'); const {version} = require('../package.json'); -updatePackage('playwright', packageJSON => { - packageJSON.version = version; -}); -for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit']) { +for (const packageName of ['playwright-chromium', 'playwright-firefox', 'playwright-webkit', 'playwright']) { updatePackage(packageName, packageJSON => { packageJSON.version = version; packageJSON.dependencies['playwright-core'] = `=${version}`;