Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

feat: change vendor package exports (#818)

Andrey Lushnikovcea036ab7e39
diff --git a/packages/playwright-chromium/index.js b/packages/playwright-chromium/index.js
index bfdbac7fd0..a784afc3bd 100644
--- a/packages/playwright-chromium/index.js
+++ b/packages/playwright-chromium/index.js
@@ -13,4 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-module.exports = require('playwright-core').chromium;
+
+module.exports = {
+ ...require('playwright-core'),
+ // Keep exporting Chromium and nullify other browsers.
+ webkit: undefined,
+ firefox: undefined,
+}
diff --git a/packages/playwright-firefox/index.js b/packages/playwright-firefox/index.js
index 0cf5880f50..5eca62b209 100644
--- a/packages/playwright-firefox/index.js
+++ b/packages/playwright-firefox/index.js
@@ -13,4 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-module.exports = require('playwright-core').firefox;
+
+module.exports = {
+ ...require('playwright-core'),
+ // Keep exporting firefox and nullify other browsers.
+ chromium: undefined,
+ webkit: undefined,
+}
diff --git a/packages/playwright-webkit/index.js b/packages/playwright-webkit/index.js
index 03f81e63a6..530904cd89 100644
--- a/packages/playwright-webkit/index.js
+++ b/packages/playwright-webkit/index.js
@@ -13,4 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-module.exports = require('playwright-core').webkit;
+
+module.exports = {
+ ...require('playwright-core'),
+ // Keep exporting webkit and nullify other browsers.
+ chromium: undefined,
+ firefox: undefined,
+}