Skip to content

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

feat(ct): initial solid (#16703)

sand4rtad46e980bc0d
diff --git a/package-lock.json b/package-lock.json
index 03a4be792e..12d77aad09 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -208,17 +208,17 @@
}
},
"node_modules/@babel/helper-create-class-features-plugin": {
- "version": "7.18.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.0.tgz",
- "integrity": "sha512-Kh8zTGR9de3J63e5nS0rQUdRs/kbtwoeQQ0sriS0lItjC96u8XXZN6lKpuyWd2coKSU13py/y+LTmThLuVX0Pg==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.9.tgz",
+ "integrity": "sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw==",
"dependencies": {
- "@babel/helper-annotate-as-pure": "^7.16.7",
- "@babel/helper-environment-visitor": "^7.16.7",
- "@babel/helper-function-name": "^7.17.9",
- "@babel/helper-member-expression-to-functions": "^7.17.7",
- "@babel/helper-optimise-call-expression": "^7.16.7",
- "@babel/helper-replace-supers": "^7.16.7",
- "@babel/helper-split-export-declaration": "^7.16.7"
+ "@babel/helper-annotate-as-pure": "^7.18.6",
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-function-name": "^7.18.9",
+ "@babel/helper-member-expression-to-functions": "^7.18.9",
+ "@babel/helper-optimise-call-expression": "^7.18.6",
+ "@babel/helper-replace-supers": "^7.18.9",
+ "@babel/helper-split-export-declaration": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
@@ -259,11 +259,11 @@
}
},
"node_modules/@babel/helper-member-expression-to-functions": {
- "version": "7.17.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz",
- "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz",
+ "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==",
"dependencies": {
- "@babel/types": "^7.17.0"
+ "@babel/types": "^7.18.9"
},
"engines": {
"node": ">=6.9.0"
@@ -299,11 +299,11 @@
}
},
"node_modules/@babel/helper-optimise-call-expression": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz",
- "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==",
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz",
+ "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==",
"dependencies": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
@@ -318,15 +318,15 @@
}
},
"node_modules/@babel/helper-replace-supers": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.2.tgz",
- "integrity": "sha512-XzAIyxx+vFnrOxiQrToSUOzUOn0e1J2Li40ntddek1Y69AXUTXoDJ40/D5RdjFu7s7qHiaeoTiempZcbuVXh2Q==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz",
+ "integrity": "sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ==",
"dependencies": {
- "@babel/helper-environment-visitor": "^7.18.2",
- "@babel/helper-member-expression-to-functions": "^7.17.7",
- "@babel/helper-optimise-call-expression": "^7.16.7",
- "@babel/traverse": "^7.18.2",
- "@babel/types": "^7.18.2"
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-member-expression-to-functions": "^7.18.9",
+ "@babel/helper-optimise-call-expression": "^7.18.6",
+ "@babel/traverse": "^7.18.9",
+ "@babel/types": "^7.18.9"
},
"engines": {
"node": ">=6.9.0"
@@ -659,11 +659,11 @@
}
},
"node_modules/@babel/plugin-syntax-typescript": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz",
- "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==",
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz",
+ "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==",
"dependencies": {
- "@babel/helper-plugin-utils": "^7.16.7"
+ "@babel/helper-plugin-utils": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
@@ -672,6 +672,14 @@
"@babel/core": "^7.0.0-0"
}
},
+ "node_modules/@babel/plugin-syntax-typescript/node_modules/@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/plugin-transform-arrow-functions": {
"version": "7.17.12",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.17.12.tgz",
@@ -939,13 +947,13 @@
}
},
"node_modules/@babel/plugin-transform-typescript": {
- "version": "7.16.8",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz",
- "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==",
+ "version": "7.18.12",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.12.tgz",
+ "integrity": "sha512-2vjjam0cum0miPkenUbQswKowuxs/NjMwIKEq0zwegRxXk12C9YOF9STXnaUptITOtOJHKHpzvvWYOjbm6tc0w==",
"dependencies": {
- "@babel/helper-create-class-features-plugin": "^7.16.7",
- "@babel/helper-plugin-utils": "^7.16.7",
- "@babel/plugin-syntax-typescript": "^7.16.7"
+ "@babel/helper-create-class-features-plugin": "^7.18.9",
+ "@babel/helper-plugin-utils": "^7.18.9",
+ "@babel/plugin-syntax-typescript": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
@@ -954,6 +962,14 @@
"@babel/core": "^7.0.0-0"
}
},
+ "node_modules/@babel/plugin-transform-typescript/node_modules/@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/preset-react": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.16.7.tgz",
@@ -974,6 +990,30 @@
"@babel/core": "^7.0.0-0"
}
},
+ "node_modules/@babel/preset-typescript": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz",
+ "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "^7.18.6",
+ "@babel/helper-validator-option": "^7.18.6",
+ "@babel/plugin-transform-typescript": "^7.18.6"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0-0"
+ }
+ },
+ "node_modules/@babel/preset-typescript/node_modules/@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w==",
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
"node_modules/@babel/template": {
"version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
@@ -1229,6 +1269,10 @@
"resolved": "packages/playwright-ct-react",
"link": true
},
+ "node_modules/@playwright/experimental-ct-solid": {
+ "resolved": "packages/playwright-ct-solid",
+ "link": true
+ },
"node_modules/@playwright/experimental-ct-svelte": {
"resolved": "packages/playwright-ct-svelte",
"link": true
@@ -2151,6 +2195,42 @@
"object.assign": "^4.1.0"
}
},
+ "node_modules/babel-plugin-jsx-dom-expressions": {
+ "version": "0.33.14",
+ "resolved": "https://registry.npmjs.org/babel-plugin-jsx-dom-expressions/-/babel-plugin-jsx-dom-expressions-0.33.14.tgz",
+ "integrity": "sha512-91T8uEz6Wb42bUm5vxRBawY05fBHiwUxah/xWBimuWpH3nf7E0KJ0Wm/s8R7lxRIZzwGCILv1IBlUCqA50WOVw==",
+ "dependencies": {
+ "@babel/helper-module-imports": "7.16.0",
+ "@babel/plugin-syntax-jsx": "^7.16.5",
+ "@babel/types": "^7.16.0",
+ "html-entities": "2.3.2"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
+ "node_modules/babel-plugin-jsx-dom-expressions/node_modules/@babel/helper-module-imports": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz",
+ "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==",
+ "dependencies": {
+ "@babel/types": "^7.16.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
+ }
+ },
+ "node_modules/babel-preset-solid": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/babel-preset-solid/-/babel-preset-solid-1.4.8.tgz",
+ "integrity": "sha512-Qv1yoE7yIux68egUsUUEV26t7B0KLNyXKz1MTk89GJDc6mt+2s7+lDVr4tXa29PTZ/hXDTu2uLbEN/1OtmFFBg==",
+ "dependencies": {
+ "babel-plugin-jsx-dom-expressions": "^0.33.14"
+ },
+ "peerDependencies": {
+ "@babel/core": "^7.0.0"
+ }
+ },
"node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -4164,6 +4244,11 @@
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true
},
+ "node_modules/html-entities": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
+ "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
+ },
"node_modules/html-reporter": {
"resolved": "packages/html-reporter",
"link": true
@@ -4295,6 +4380,17 @@
"node": ">=0.12.0"
}
},
+ "node_modules/is-what": {
+ "version": "4.1.7",
+ "resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.7.tgz",
+ "integrity": "sha512-DBVOQNiPKnGMxRMLIYSwERAS5MVY1B7xYiGnpgctsOFvVDz9f9PFXXxMcTOHuoqYp4NK9qFYQaIC1NRRxLMpBQ==",
+ "engines": {
+ "node": ">=12.13"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mesqueeb"
+ }
+ },
"node_modules/isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@@ -4591,6 +4687,21 @@
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
"dev": true
},
+ "node_modules/merge-anything": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/merge-anything/-/merge-anything-5.0.2.tgz",
+ "integrity": "sha512-POPQBWkBC0vxdgzRJ2Mkj4+2NTKbvkHo93ih+jGDhNMLzIw+rYKjO7949hOQM2X7DxMHH1uoUkwWFLIzImw7gA==",
+ "dependencies": {
+ "is-what": "^4.1.6",
+ "ts-toolbelt": "^9.6.0"
+ },
+ "engines": {
+ "node": ">=12.13"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mesqueeb"
+ }
+ },
"node_modules/merge-source-map": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz",
@@ -5627,6 +5738,24 @@
"node": ">=0.2.4"
}
},
+ "node_modules/solid-js": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.8.tgz",
+ "integrity": "sha512-XErZdnnYYXF7OwGSUAPcua2y5/ELB/c53zFCpWiEGqxTNoH1iQghzI8EsHJXk06sNn+Z/TGhb8bPDNNGSgimag=="
+ },
+ "node_modules/solid-refresh": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/solid-refresh/-/solid-refresh-0.4.1.tgz",
+ "integrity": "sha512-v3tD/OXQcUyXLrWjPW1dXZyeWwP7/+GQNs8YTL09GBq+5FguA6IejJWUvJDrLIA4M0ho9/5zK2e9n+uy+4488g==",
+ "dependencies": {
+ "@babel/generator": "^7.18.2",
+ "@babel/helper-module-imports": "^7.16.7",
+ "@babel/types": "^7.18.4"
+ },
+ "peerDependencies": {
+ "solid-js": "^1.3"
+ }
+ },
"node_modules/source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
@@ -5898,6 +6027,11 @@
"node": ">=0.6"
}
},
+ "node_modules/ts-toolbelt": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz",
+ "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w=="
+ },
"node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
@@ -6531,17 +6665,6 @@
"node": ">=14"
}
},
- "packages/playwright-ct-react/node_modules/@babel/code-frame": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
- "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
- "dependencies": {
- "@babel/highlight": "^7.18.6"
- },
- "engines": {
- "node": ">=6.9.0"
- }
- },
"packages/playwright-ct-react/node_modules/@babel/core": {
"version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz",
@@ -6639,6 +6762,78 @@
}
}
},
+ "packages/playwright-ct-solid": {
+ "name": "@playwright/experimental-ct-solid",
+ "version": "1.26.0-next",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@playwright/test": "1.26.0-next",
+ "vite": "^3.0.0",
+ "vite-plugin-solid": "^2.3.0"
+ },
+ "devDependencies": {
+ "solid-js": "^1.4.7"
+ },
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "packages/playwright-ct-solid/node_modules/vite": {
+ "version": "3.0.9",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.9.tgz",
+ "integrity": "sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==",
+ "dependencies": {
+ "esbuild": "^0.14.47",
+ "postcss": "^8.4.16",
+ "resolve": "^1.22.1",
+ "rollup": ">=2.75.6 <2.77.0 || ~2.77.0"
+ },
+ "bin": {
+ "vite": "bin/vite.js"
+ },
+ "engines": {
+ "node": "^14.18.0 || >=16.0.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ },
+ "peerDependencies": {
+ "less": "*",
+ "sass": "*",
+ "stylus": "*",
+ "terser": "^5.4.0"
+ },
+ "peerDependenciesMeta": {
+ "less": {
+ "optional": true
+ },
+ "sass": {
+ "optional": true
+ },
+ "stylus": {
+ "optional": true
+ },
+ "terser": {
+ "optional": true
+ }
+ }
+ },
+ "packages/playwright-ct-solid/node_modules/vite-plugin-solid": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/vite-plugin-solid/-/vite-plugin-solid-2.3.0.tgz",
+ "integrity": "sha512-N2sa54C3UZC2nN5vpj5o6YP+XdIAZW6n6xv8OasxNAcAJPFeZT7EOVvumL0V4c8hBz1yuYniMWdESY8807fVSg==",
+ "dependencies": {
+ "@babel/core": "^7.18.6",
+ "@babel/preset-typescript": "^7.18.6",
+ "babel-preset-solid": "^1.4.6",
+ "merge-anything": "^5.0.2",
+ "solid-refresh": "^0.4.1"
+ },
+ "peerDependencies": {
+ "solid-js": "^1.3.17",
+ "vite": "^3.0.0"
+ }
+ },
"packages/playwright-ct-svelte": {
"name": "@playwright/experimental-ct-svelte",
"version": "1.26.0-next",
@@ -6950,17 +7145,17 @@
}
},
"@babel/helper-create-class-features-plugin": {
- "version": "7.18.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.0.tgz",
- "integrity": "sha512-Kh8zTGR9de3J63e5nS0rQUdRs/kbtwoeQQ0sriS0lItjC96u8XXZN6lKpuyWd2coKSU13py/y+LTmThLuVX0Pg==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.9.tgz",
+ "integrity": "sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw==",
"requires": {
- "@babel/helper-annotate-as-pure": "^7.16.7",
- "@babel/helper-environment-visitor": "^7.16.7",
- "@babel/helper-function-name": "^7.17.9",
- "@babel/helper-member-expression-to-functions": "^7.17.7",
- "@babel/helper-optimise-call-expression": "^7.16.7",
- "@babel/helper-replace-supers": "^7.16.7",
- "@babel/helper-split-export-declaration": "^7.16.7"
+ "@babel/helper-annotate-as-pure": "^7.18.6",
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-function-name": "^7.18.9",
+ "@babel/helper-member-expression-to-functions": "^7.18.9",
+ "@babel/helper-optimise-call-expression": "^7.18.6",
+ "@babel/helper-replace-supers": "^7.18.9",
+ "@babel/helper-split-export-declaration": "^7.18.6"
}
},
"@babel/helper-environment-visitor": {
@@ -6986,11 +7181,11 @@
}
},
"@babel/helper-member-expression-to-functions": {
- "version": "7.17.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz",
- "integrity": "sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz",
+ "integrity": "sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg==",
"requires": {
- "@babel/types": "^7.17.0"
+ "@babel/types": "^7.18.9"
}
},
"@babel/helper-module-imports": {
@@ -7017,11 +7212,11 @@
}
},
"@babel/helper-optimise-call-expression": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz",
- "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==",
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz",
+ "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==",
"requires": {
- "@babel/types": "^7.16.7"
+ "@babel/types": "^7.18.6"
}
},
"@babel/helper-plugin-utils": {
@@ -7030,15 +7225,15 @@
"integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA=="
},
"@babel/helper-replace-supers": {
- "version": "7.18.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.2.tgz",
- "integrity": "sha512-XzAIyxx+vFnrOxiQrToSUOzUOn0e1J2Li40ntddek1Y69AXUTXoDJ40/D5RdjFu7s7qHiaeoTiempZcbuVXh2Q==",
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz",
+ "integrity": "sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ==",
"requires": {
- "@babel/helper-environment-visitor": "^7.18.2",
- "@babel/helper-member-expression-to-functions": "^7.17.7",
- "@babel/helper-optimise-call-expression": "^7.16.7",
- "@babel/traverse": "^7.18.2",
- "@babel/types": "^7.18.2"
+ "@babel/helper-environment-visitor": "^7.18.9",
+ "@babel/helper-member-expression-to-functions": "^7.18.9",
+ "@babel/helper-optimise-call-expression": "^7.18.6",
+ "@babel/traverse": "^7.18.9",
+ "@babel/types": "^7.18.9"
}
},
"@babel/helper-simple-access": {
@@ -7265,11 +7460,18 @@
}
},
"@babel/plugin-syntax-typescript": {
- "version": "7.16.7",
- "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz",
- "integrity": "sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A==",
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz",
+ "integrity": "sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA==",
"requires": {
- "@babel/helper-plugin-utils": "^7.16.7"
+ "@babel/helper-plugin-utils": "^7.18.6"
+ },
+ "dependencies": {
+ "@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w=="
+ }
}
},
"@babel/plugin-transform-arrow-functions": {
@@ -7452,13 +7654,20 @@
}
},
"@babel/plugin-transform-typescript": {
- "version": "7.16.8",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz",
- "integrity": "sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ==",
+ "version": "7.18.12",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.12.tgz",
+ "integrity": "sha512-2vjjam0cum0miPkenUbQswKowuxs/NjMwIKEq0zwegRxXk12C9YOF9STXnaUptITOtOJHKHpzvvWYOjbm6tc0w==",
"requires": {
- "@babel/helper-create-class-features-plugin": "^7.16.7",
- "@babel/helper-plugin-utils": "^7.16.7",
- "@babel/plugin-syntax-typescript": "^7.16.7"
+ "@babel/helper-create-class-features-plugin": "^7.18.9",
+ "@babel/helper-plugin-utils": "^7.18.9",
+ "@babel/plugin-syntax-typescript": "^7.18.6"
+ },
+ "dependencies": {
+ "@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w=="
+ }
}
},
"@babel/preset-react": {
@@ -7475,6 +7684,23 @@
"@babel/plugin-transform-react-pure-annotations": "^7.16.7"
}
},
+ "@babel/preset-typescript": {
+ "version": "7.18.6",
+ "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz",
+ "integrity": "sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ==",
+ "requires": {
+ "@babel/helper-plugin-utils": "^7.18.6",
+ "@babel/helper-validator-option": "^7.18.6",
+ "@babel/plugin-transform-typescript": "^7.18.6"
+ },
+ "dependencies": {
+ "@babel/helper-plugin-utils": {
+ "version": "7.18.9",
+ "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz",
+ "integrity": "sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w=="
+ }
+ }
+ },
"@babel/template": {
"version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.18.10.tgz",
@@ -7681,14 +7907,6 @@
"vite": "^3.0.9"
},
"dependencies": {
- "@babel/code-frame": {
- "version": "7.18.6",
- "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
- "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
- "requires": {
- "@babel/highlight": "^7.18.6"
- }
- },
"@babel/core": {
"version": "7.18.10",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.18.10.tgz",
@@ -7744,6 +7962,41 @@
}
}
},
+ "@playwright/experimental-ct-solid": {
+ "version": "file:packages/playwright-ct-solid",
+ "requires": {
+ "@playwright/test": "1.26.0-next",
+ "solid-js": "^1.4.7",
+ "vite": "^3.0.0",
+ "vite-plugin-solid": "^2.3.0"
+ },
+ "dependencies": {
+ "vite": {
+ "version": "3.0.9",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-3.0.9.tgz",
+ "integrity": "sha512-waYABTM+G6DBTCpYAxvevpG50UOlZuynR0ckTK5PawNVt7ebX6X7wNXHaGIO6wYYFXSM7/WcuFuO2QzhBB6aMw==",
+ "requires": {
+ "esbuild": "^0.14.47",
+ "fsevents": "~2.3.2",
+ "postcss": "^8.4.16",
+ "resolve": "^1.22.1",
+ "rollup": ">=2.75.6 <2.77.0 || ~2.77.0"
+ }
+ },
+ "vite-plugin-solid": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/vite-plugin-solid/-/vite-plugin-solid-2.3.0.tgz",
+ "integrity": "sha512-N2sa54C3UZC2nN5vpj5o6YP+XdIAZW6n6xv8OasxNAcAJPFeZT7EOVvumL0V4c8hBz1yuYniMWdESY8807fVSg==",
+ "requires": {
+ "@babel/core": "^7.18.6",
+ "@babel/preset-typescript": "^7.18.6",
+ "babel-preset-solid": "^1.4.6",
+ "merge-anything": "^5.0.2",
+ "solid-refresh": "^0.4.1"
+ }
+ }
+ }
+ },
"@playwright/experimental-ct-svelte": {
"version": "file:packages/playwright-ct-svelte",
"requires": {
@@ -8537,6 +8790,35 @@
"object.assign": "^4.1.0"
}
},
+ "babel-plugin-jsx-dom-expressions": {
+ "version": "0.33.14",
+ "resolved": "https://registry.npmjs.org/babel-plugin-jsx-dom-expressions/-/babel-plugin-jsx-dom-expressions-0.33.14.tgz",
+ "integrity": "sha512-91T8uEz6Wb42bUm5vxRBawY05fBHiwUxah/xWBimuWpH3nf7E0KJ0Wm/s8R7lxRIZzwGCILv1IBlUCqA50WOVw==",
+ "requires": {
+ "@babel/helper-module-imports": "7.16.0",
+ "@babel/plugin-syntax-jsx": "^7.16.5",
+ "@babel/types": "^7.16.0",
+ "html-entities": "2.3.2"
+ },
+ "dependencies": {
+ "@babel/helper-module-imports": {
+ "version": "7.16.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz",
+ "integrity": "sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg==",
+ "requires": {
+ "@babel/types": "^7.16.0"
+ }
+ }
+ }
+ },
+ "babel-preset-solid": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/babel-preset-solid/-/babel-preset-solid-1.4.8.tgz",
+ "integrity": "sha512-Qv1yoE7yIux68egUsUUEV26t7B0KLNyXKz1MTk89GJDc6mt+2s7+lDVr4tXa29PTZ/hXDTu2uLbEN/1OtmFFBg==",
+ "requires": {
+ "babel-plugin-jsx-dom-expressions": "^0.33.14"
+ }
+ },
"balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
@@ -9960,6 +10242,11 @@
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
"dev": true
},
+ "html-entities": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz",
+ "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ=="
+ },
"html-reporter": {
"version": "file:packages/html-reporter"
},
@@ -10060,6 +10347,11 @@
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
+ "is-what": {
+ "version": "4.1.7",
+ "resolved": "https://registry.npmjs.org/is-what/-/is-what-4.1.7.tgz",
+ "integrity": "sha512-DBVOQNiPKnGMxRMLIYSwERAS5MVY1B7xYiGnpgctsOFvVDz9f9PFXXxMcTOHuoqYp4NK9qFYQaIC1NRRxLMpBQ=="
+ },
"isarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
@@ -10305,6 +10597,15 @@
"integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
"dev": true
},
+ "merge-anything": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/merge-anything/-/merge-anything-5.0.2.tgz",
+ "integrity": "sha512-POPQBWkBC0vxdgzRJ2Mkj4+2NTKbvkHo93ih+jGDhNMLzIw+rYKjO7949hOQM2X7DxMHH1uoUkwWFLIzImw7gA==",
+ "requires": {
+ "is-what": "^4.1.6",
+ "ts-toolbelt": "^9.6.0"
+ }
+ },
"merge-source-map": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz",
@@ -11067,6 +11368,21 @@
}
}
},
+ "solid-js": {
+ "version": "1.4.8",
+ "resolved": "https://registry.npmjs.org/solid-js/-/solid-js-1.4.8.tgz",
+ "integrity": "sha512-XErZdnnYYXF7OwGSUAPcua2y5/ELB/c53zFCpWiEGqxTNoH1iQghzI8EsHJXk06sNn+Z/TGhb8bPDNNGSgimag=="
+ },
+ "solid-refresh": {
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/solid-refresh/-/solid-refresh-0.4.1.tgz",
+ "integrity": "sha512-v3tD/OXQcUyXLrWjPW1dXZyeWwP7/+GQNs8YTL09GBq+5FguA6IejJWUvJDrLIA4M0ho9/5zK2e9n+uy+4488g==",
+ "requires": {
+ "@babel/generator": "^7.18.2",
+ "@babel/helper-module-imports": "^7.16.7",
+ "@babel/types": "^7.18.4"
+ }
+ },
"source-map": {
"version": "0.5.7",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
@@ -11281,6 +11597,11 @@
"integrity": "sha512-1m4RA7xVAJrSGrrXGs0L3YTwyvBs2S8PbRHaLZAkFw7JR8oIFwYtysxlBZhYIa7xSyiYJKZ3iGrrk55cGA3i9A==",
"dev": true
},
+ "ts-toolbelt": {
+ "version": "9.6.0",
+ "resolved": "https://registry.npmjs.org/ts-toolbelt/-/ts-toolbelt-9.6.0.tgz",
+ "integrity": "sha512-nsZd8ZeNUzukXPlJmTBwUAuABDe/9qtVDelJeT/qW0ow3ZS3BsQJtNkan1802aM9Uf68/Y8ljw86Hu0h5IUW3w=="
+ },
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
diff --git a/packages/playwright-ct-solid/.npmignore b/packages/playwright-ct-solid/.npmignore
new file mode 100644
index 0000000000..dd4553cbc5
--- /dev/null
+++ b/packages/playwright-ct-solid/.npmignore
@@ -0,0 +1,11 @@
+**/*
+
+!README.md
+!LICENSE
+!register.d.ts
+!register.mjs
+!registerSource.mjs
+!index.d.ts
+!index.js
+!hooks.d.ts
+!hooks.mjs
diff --git a/packages/playwright-ct-solid/README.md b/packages/playwright-ct-solid/README.md
new file mode 100644
index 0000000000..23ae82312d
--- /dev/null
+++ b/packages/playwright-ct-solid/README.md
@@ -0,0 +1,3 @@
+> **BEWARE** This package is EXPERIMENTAL and does not respect semver.
+
+Read more at https://playwright.dev/docs/test-components
diff --git a/packages/playwright-ct-solid/hooks.d.ts b/packages/playwright-ct-solid/hooks.d.ts
new file mode 100644
index 0000000000..36ac2620fa
--- /dev/null
+++ b/packages/playwright-ct-solid/hooks.d.ts
@@ -0,0 +1,18 @@
+/**
+ * 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 declare function beforeMount(callback: (params: { hooksConfig: any }) => Promise<void>): void;
+export declare function afterMount(callback: (params: { hooksConfig: any }) => Promise<void>): void;
diff --git a/packages/playwright-ct-solid/hooks.mjs b/packages/playwright-ct-solid/hooks.mjs
new file mode 100644
index 0000000000..b7cea242c4
--- /dev/null
+++ b/packages/playwright-ct-solid/hooks.mjs
@@ -0,0 +1,29 @@
+/**
+ * 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.
+ */
+
+const __pw_hooks_before_mount = [];
+const __pw_hooks_after_mount = [];
+
+window.__pw_hooks_before_mount = __pw_hooks_before_mount;
+window.__pw_hooks_after_mount = __pw_hooks_after_mount;
+
+export const beforeMount = callback => {
+ __pw_hooks_before_mount.push(callback);
+};
+
+export const afterMount = callback => {
+ __pw_hooks_after_mount.push(callback);
+};
diff --git a/packages/playwright-ct-solid/index.d.ts b/packages/playwright-ct-solid/index.d.ts
new file mode 100644
index 0000000000..4e52d19c0d
--- /dev/null
+++ b/packages/playwright-ct-solid/index.d.ts
@@ -0,0 +1,51 @@
+/**
+ * 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.
+ */
+
+import type {
+ TestType,
+ PlaywrightTestArgs,
+ PlaywrightTestConfig as BasePlaywrightTestConfig,
+ PlaywrightTestOptions,
+ PlaywrightWorkerArgs,
+ PlaywrightWorkerOptions,
+ Locator,
+} from '@playwright/test';
+import type { InlineConfig } from 'vite';
+
+export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
+ use?: BasePlaywrightTestConfig['use'] & {
+ ctPort?: number,
+ ctTemplateDir?: string,
+ ctCacheDir?: string,
+ ctViteConfig?: InlineConfig
+ }
+};
+
+export interface MountOptions {
+ hooksConfig?: any;
+}
+
+interface MountResult extends Locator {}
+
+export interface ComponentFixtures {
+ mount(component: JSX.Element, options?: MountOptions): Promise<MountResult>;
+}
+
+export const test: TestType<
+ PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
+ PlaywrightWorkerArgs & PlaywrightWorkerOptions>;
+
+export { expect, devices } from '@playwright/test';
diff --git a/packages/playwright-ct-solid/index.js b/packages/playwright-ct-solid/index.js
new file mode 100644
index 0000000000..e2da5e0d18
--- /dev/null
+++ b/packages/playwright-ct-solid/index.js
@@ -0,0 +1,31 @@
+/**
+ * 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.
+ */
+
+const { test: baseTest, expect, devices, _addRunnerPlugin } = require('@playwright/test');
+const { fixtures } = require('@playwright/test/lib/mount');
+const path = require('path');
+
+_addRunnerPlugin(() => {
+ // Only fetch upon request to avoid resolution in workers.
+ const { createPlugin } = require('@playwright/test/lib/plugins/vitePlugin');
+ return createPlugin(
+ path.join(__dirname, 'registerSource.mjs'),
+ () => require('vite-plugin-solid')());
+});
+
+const test = baseTest.extend(fixtures);
+
+module.exports = { test, expect, devices };
diff --git a/packages/playwright-ct-solid/package.json b/packages/playwright-ct-solid/package.json
new file mode 100644
index 0000000000..88738616a3
--- /dev/null
+++ b/packages/playwright-ct-solid/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "@playwright/experimental-ct-solid",
+ "version": "1.26.0-next",
+ "description": "Playwright Component Testing for Solid",
+ "repository": "github:Microsoft/playwright",
+ "homepage": "https://playwright.dev",
+ "engines": {
+ "node": ">=14"
+ },
+ "author": {
+ "name": "Microsoft Corporation"
+ },
+ "license": "Apache-2.0",
+ "exports": {
+ ".": {
+ "types": "./index.d.ts",
+ "default": "./index.js"
+ },
+ "./register": {
+ "types": "./register.d.ts",
+ "default": "./register.mjs"
+ },
+ "./hooks": {
+ "types": "./hooks.d.ts",
+ "default": "./hooks.mjs"
+ }
+ },
+ "dependencies": {
+ "vite": "^3.0.0",
+ "vite-plugin-solid": "^2.3.0",
+ "@playwright/test": "1.26.0-next"
+ },
+ "devDependencies": {
+ "solid-js": "^1.4.7"
+ }
+}
diff --git a/packages/playwright-ct-solid/register.d.ts b/packages/playwright-ct-solid/register.d.ts
new file mode 100644
index 0000000000..0925c1f690
--- /dev/null
+++ b/packages/playwright-ct-solid/register.d.ts
@@ -0,0 +1,19 @@
+/**
+ * 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 default function register(
+ components: { [key: string]: any },
+): void
diff --git a/packages/playwright-ct-solid/register.mjs b/packages/playwright-ct-solid/register.mjs
new file mode 100644
index 0000000000..47f32ee602
--- /dev/null
+++ b/packages/playwright-ct-solid/register.mjs
@@ -0,0 +1,21 @@
+/**
+ * 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.
+ */
+
+import { register } from './registerSource.mjs';
+
+export default components => {
+ register(components);
+};
diff --git a/packages/playwright-ct-solid/registerSource.mjs b/packages/playwright-ct-solid/registerSource.mjs
new file mode 100644
index 0000000000..682801de08
--- /dev/null
+++ b/packages/playwright-ct-solid/registerSource.mjs
@@ -0,0 +1,70 @@
+/**
+ * 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.
+ */
+
+// @ts-check
+// This file is injected into the registry as text, no dependencies are allowed.
+
+import { render as solidRender } from 'solid-js/web';
+
+/** @typedef {import('../playwright-test/types/component').Component} Component */
+/** @typedef {import('solid-js').JSX.Element} FrameworkComponent */
+
+/** @type {Map<string, FrameworkComponent>} */
+const registry = new Map();
+
+/**
+ * @param {{[key: string]: FrameworkComponent}} components
+ */
+export function register(components) {
+ for (const [name, value] of Object.entries(components))
+ registry.set(name, value);
+}
+
+/**
+ * @param {Component} component
+ */
+function render(component) {
+ let componentFunc = registry.get(component.type);
+ if (!componentFunc) {
+ // Lookup by shorthand.
+ for (const [name, value] of registry) {
+ if (component.type.endsWith(`_${name}`)) {
+ componentFunc = value;
+ break;
+ }
+ }
+ }
+
+ if (!componentFunc && component.type[0].toUpperCase() === component.type[0])
+ throw new Error(`Unregistered component: ${component.type}. Following components are registered: ${[...registry.keys()]}`);
+
+ const componentFuncOrString = componentFunc || component.type;
+
+ if (component.kind !== 'jsx')
+ throw new Error('Object mount notation is not supported');
+
+ return componentFuncOrString;
+}
+
+window.playwrightMount = async (component, rootElement, hooksConfig) => {
+ for (const hook of /** @type {any} */(window).__pw_hooks_before_mount || [])
+ await hook({ hooksConfig });
+
+ solidRender(() => render(component), rootElement);
+
+ for (const hook of /** @type {any} */(window).__pw_hooks_after_mount || [])
+ await hook({ hooksConfig });
+};
diff --git a/tests/components/ct-solid/.gitignore b/tests/components/ct-solid/.gitignore
new file mode 100644
index 0000000000..f06235c460
--- /dev/null
+++ b/tests/components/ct-solid/.gitignore
@@ -0,0 +1,2 @@
+node_modules
+dist
diff --git a/tests/components/ct-solid/README.md b/tests/components/ct-solid/README.md
new file mode 100644
index 0000000000..434f7bb9df
--- /dev/null
+++ b/tests/components/ct-solid/README.md
@@ -0,0 +1,34 @@
+## Usage
+
+Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
+
+This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
+
+```bash
+$ npm install # or pnpm install or yarn install
+```
+
+### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `npm dev` or `npm start`
+
+Runs the app in the development mode.<br>
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+
+The page will reload if you make edits.<br>
+
+### `npm run build`
+
+Builds the app for production to the `dist` folder.<br>
+It correctly bundles Solid in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.<br>
+Your app is ready to be deployed!
+
+## Deployment
+
+You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
diff --git a/tests/components/ct-solid/index.html b/tests/components/ct-solid/index.html
new file mode 100644
index 0000000000..48c59fc124
--- /dev/null
+++ b/tests/components/ct-solid/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="theme-color" content="#000000" />
+ <link rel="shortcut icon" type="image/ico" href="/src/assets/favicon.ico" />
+ <title>Solid App</title>
+ </head>
+ <body>
+ <noscript>You need to enable JavaScript to run this app.</noscript>
+ <div id="root"></div>
+
+ <script src="/src/index.tsx" type="module"></script>
+ </body>
+</html>
diff --git a/tests/components/ct-solid/package.json b/tests/components/ct-solid/package.json
new file mode 100644
index 0000000000..8176ee5f4b
--- /dev/null
+++ b/tests/components/ct-solid/package.json
@@ -0,0 +1,24 @@
+{
+ "name": "ct-solid",
+ "version": "0.0.0",
+ "description": "",
+ "scripts": {
+ "start": "vite",
+ "dev": "vite",
+ "build": "vite build",
+ "serve": "vite preview"
+ },
+ "license": "MIT",
+ "devDependencies": {
+ "typescript": "^4.7.4",
+ "vite": "^3.0.0",
+ "vite-plugin-solid": "^2.3.0"
+ },
+ "dependencies": {
+ "solid-js": "^1.4.7"
+ },
+ "@standaloneDevDependencies": {
+ "@playwright/experimental-ct-solid": "^1.22.2",
+ "@playwright/test": "^1.22.2"
+ }
+}
diff --git a/tests/components/ct-solid/playwright.config.ts b/tests/components/ct-solid/playwright.config.ts
new file mode 100644
index 0000000000..891aeb6e04
--- /dev/null
+++ b/tests/components/ct-solid/playwright.config.ts
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+import { type PlaywrightTestConfig, devices } from '@playwright/experimental-ct-solid';
+
+const config: PlaywrightTestConfig = {
+ testDir: 'src',
+ forbidOnly: !!process.env.CI,
+ retries: process.env.CI ? 2 : 0,
+ reporter: 'html',
+ use: {
+ trace: 'on-first-retry',
+ },
+ projects: [
+ {
+ name: 'chromium',
+ use: { ...devices['Desktop Chrome'] },
+ },
+ {
+ name: 'firefox',
+ use: { ...devices['Desktop Firefox'] },
+ },
+ {
+ name: 'webkit',
+ use: { ...devices['Desktop Safari'] },
+ },
+ ],
+};
+
+export default config;
diff --git a/tests/components/ct-solid/playwright/index.html b/tests/components/ct-solid/playwright/index.html
new file mode 100644
index 0000000000..9c332655e8
--- /dev/null
+++ b/tests/components/ct-solid/playwright/index.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
+ <title>Solid App</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="/playwright/index.js"></script>
+ </body>
+</html>
diff --git a/tests/components/ct-solid/playwright/index.js b/tests/components/ct-solid/playwright/index.js
new file mode 100644
index 0000000000..313b081507
--- /dev/null
+++ b/tests/components/ct-solid/playwright/index.js
@@ -0,0 +1,10 @@
+import '../src/assets/index.css';
+import { beforeMount, afterMount } from '@playwright/experimental-ct-solid/hooks';
+
+beforeMount(async ({ hooksConfig }) => {
+ console.log(`Before mount: ${JSON.stringify(hooksConfig)}`);
+});
+
+afterMount(async ({}) => {
+ console.log(`After mount`);
+});
diff --git a/tests/components/ct-solid/src/App.module.css b/tests/components/ct-solid/src/App.module.css
new file mode 100644
index 0000000000..48308b24a8
--- /dev/null
+++ b/tests/components/ct-solid/src/App.module.css
@@ -0,0 +1,33 @@
+.App {
+ text-align: center;
+}
+
+.logo {
+ animation: logo-spin infinite 20s linear;
+ height: 40vmin;
+ pointer-events: none;
+}
+
+.header {
+ background-color: #282c34;
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: calc(10px + 2vmin);
+ color: white;
+}
+
+.link {
+ color: #b318f0;
+}
+
+@keyframes logo-spin {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
diff --git a/tests/components/ct-solid/src/App.tsx b/tests/components/ct-solid/src/App.tsx
new file mode 100644
index 0000000000..5810710a36
--- /dev/null
+++ b/tests/components/ct-solid/src/App.tsx
@@ -0,0 +1,27 @@
+import type { Component } from 'solid-js';
+
+import logo from './assets/logo.svg';
+import styles from './App.module.css';
+
+const App: Component = () => {
+ return (
+ <div class={styles.App}>
+ <header class={styles.header}>
+ <img src={logo} class={styles.logo} alt="logo" />
+ <p>
+ Edit <code>src/App.tsx</code> and save to reload.
+ </p>
+ <a
+ class={styles.link}
+ href="https://github.com/solidjs/solid"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ Learn Solid
+ </a>
+ </header>
+ </div>
+ );
+};
+
+export default App;
diff --git a/tests/components/ct-solid/src/assets/favicon.ico b/tests/components/ct-solid/src/assets/favicon.ico
new file mode 100644
index 0000000000..b836b2bcca
Binary files /dev/null and b/tests/components/ct-solid/src/assets/favicon.ico differ
diff --git a/tests/components/ct-solid/src/assets/index.css b/tests/components/ct-solid/src/assets/index.css
new file mode 100644
index 0000000000..ec2585e8c0
--- /dev/null
+++ b/tests/components/ct-solid/src/assets/index.css
@@ -0,0 +1,13 @@
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+ sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+code {
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+ monospace;
+}
diff --git a/tests/components/ct-solid/src/assets/logo.svg b/tests/components/ct-solid/src/assets/logo.svg
new file mode 100644
index 0000000000..025aa303c5
--- /dev/null
+++ b/tests/components/ct-solid/src/assets/logo.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 166 155.3"><path d="M163 35S110-4 69 5l-3 1c-6 2-11 5-14 9l-2 3-15 26 26 5c11 7 25 10 38 7l46 9 18-30z" fill="#76b3e1"/><linearGradient id="a" gradientUnits="userSpaceOnUse" x1="27.5" y1="3" x2="152" y2="63.5"><stop offset=".1" stop-color="#76b3e1"/><stop offset=".3" stop-color="#dcf2fd"/><stop offset="1" stop-color="#76b3e1"/></linearGradient><path d="M163 35S110-4 69 5l-3 1c-6 2-11 5-14 9l-2 3-15 26 26 5c11 7 25 10 38 7l46 9 18-30z" opacity=".3" fill="url(#a)"/><path d="M52 35l-4 1c-17 5-22 21-13 35 10 13 31 20 48 15l62-21S92 26 52 35z" fill="#518ac8"/><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="95.8" y1="32.6" x2="74" y2="105.2"><stop offset="0" stop-color="#76b3e1"/><stop offset=".5" stop-color="#4377bb"/><stop offset="1" stop-color="#1f3b77"/></linearGradient><path d="M52 35l-4 1c-17 5-22 21-13 35 10 13 31 20 48 15l62-21S92 26 52 35z" opacity=".3" fill="url(#b)"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="18.4" y1="64.2" x2="144.3" y2="149.8"><stop offset="0" stop-color="#315aa9"/><stop offset=".5" stop-color="#518ac8"/><stop offset="1" stop-color="#315aa9"/></linearGradient><path d="M134 80a45 45 0 00-48-15L24 85 4 120l112 19 20-36c4-7 3-15-2-23z" fill="url(#c)"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="75.2" y1="74.5" x2="24.4" y2="260.8"><stop offset="0" stop-color="#4377bb"/><stop offset=".5" stop-color="#1a336b"/><stop offset="1" stop-color="#1a336b"/></linearGradient><path d="M114 115a45 45 0 00-48-15L4 120s53 40 94 30l3-1c17-5 23-21 13-34z" fill="url(#d)"/></svg>
\ No newline at end of file
diff --git a/tests/components/ct-solid/src/components/Button.tsx b/tests/components/ct-solid/src/components/Button.tsx
new file mode 100644
index 0000000000..a3b37db845
--- /dev/null
+++ b/tests/components/ct-solid/src/components/Button.tsx
@@ -0,0 +1,3 @@
+export default function Button() {
+ return <button>Submit</button>
+}
diff --git a/tests/components/ct-solid/src/index.tsx b/tests/components/ct-solid/src/index.tsx
new file mode 100644
index 0000000000..1cb0a23d38
--- /dev/null
+++ b/tests/components/ct-solid/src/index.tsx
@@ -0,0 +1,7 @@
+/* @refresh reload */
+import { render } from 'solid-js/web';
+
+import './assets/index.css';
+import App from './App';
+
+render(() => <App />, document.getElementById('root') as HTMLElement);
diff --git a/tests/components/ct-solid/src/tests.spec.tsx b/tests/components/ct-solid/src/tests.spec.tsx
new file mode 100644
index 0000000000..95827a2939
--- /dev/null
+++ b/tests/components/ct-solid/src/tests.spec.tsx
@@ -0,0 +1,9 @@
+import { test, expect } from '@playwright/experimental-ct-solid'
+import Button from './components/Button';
+
+test.use({ viewport: { width: 500, height: 500 } });
+
+test('should work', async ({ mount }) => {
+ const component = await mount(<Button />);
+ await expect(component).toContainText('Submit');
+});
diff --git a/tests/components/ct-solid/tsconfig.json b/tests/components/ct-solid/tsconfig.json
new file mode 100644
index 0000000000..249b2732a7
--- /dev/null
+++ b/tests/components/ct-solid/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "strict": true,
+ "target": "ESNext",
+ "module": "ESNext",
+ "moduleResolution": "node",
+ "allowSyntheticDefaultImports": true,
+ "esModuleInterop": true,
+ "jsx": "preserve",
+ "jsxImportSource": "solid-js",
+ "types": ["vite/client"],
+ "noEmit": true,
+ "isolatedModules": true
+ }
+}
diff --git a/tests/components/ct-solid/vite.config.ts b/tests/components/ct-solid/vite.config.ts
new file mode 100644
index 0000000000..9ff59a1722
--- /dev/null
+++ b/tests/components/ct-solid/vite.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from 'vite';
+import solidPlugin from 'vite-plugin-solid';
+
+export default defineConfig({
+ plugins: [solidPlugin()],
+ server: {
+ port: 3000,
+ },
+ build: {
+ target: 'esnext',
+ },
+});
diff --git a/tsconfig.json b/tsconfig.json
index 8543fe7b2c..767795f069 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -28,6 +28,7 @@
"packages/*/lib",
"packages/html-reporter",
"packages/playwright-ct-react",
+ "packages/playwright-ct-solid",
"packages/playwright-ct-svelte",
"packages/playwright-ct-vue",
"packages/recorder",
diff --git a/utils/workspace.js b/utils/workspace.js
index c146fa6129..d7486f9aec 100755
--- a/utils/workspace.js
+++ b/utils/workspace.js
@@ -183,6 +183,11 @@ const workspace = new Workspace(ROOT_PATH, [
path: path.join(ROOT_PATH, 'packages', 'playwright-ct-react'),
files: ['LICENSE'],
}),
+ new PWPackage({
+ name: '@playwright/experimental-ct-solid',
+ path: path.join(ROOT_PATH, 'packages', 'playwright-ct-solid'),
+ files: ['LICENSE'],
+ }),
new PWPackage({
name: '@playwright/experimental-ct-svelte',
path: path.join(ROOT_PATH, 'packages', 'playwright-ct-svelte'),