プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

create playwright

Kohei Watanabe (Oct 24, 2024, 9:31 PM +0900) ffe2af26 876d84fb

+138
+1
.gitignore
··· 1 1 node_modules/ 2 2 dist/ 3 + test-results/ 3 4 .next/ 4 5 .env
+21
playwright/inner-text.test.ts
··· 1 + import { expect, test } from "@playwright/test"; 2 + 3 + test("first", async ({ page }) => { 4 + // @ts-ignore 5 + await page.goto(`file:///${__dirname}/test.html`); 6 + 7 + // playwright test --browser=chromium : pass 8 + // playwright test --browser=firefox : pass 9 + // playwright test --browser=webkit : fail (return `1\n`) 10 + expect(await page.innerText("first-test")).toBe(`1`); 11 + }); 12 + 13 + test("second", async ({ page }) => { 14 + // @ts-ignore 15 + await page.goto(`file:///${__dirname}/test.html`); 16 + 17 + // playwright test --browser=chromium : pass 18 + // playwright test --browser=firefox : pass 19 + // playwright test --browser=webkit : fail (return `2\n`) 20 + expect(await page.innerText("second-test")).toBe(`2`); 21 + });
+75
playwright/package-lock.json
··· 1 + { 2 + "name": "playwright", 3 + "lockfileVersion": 3, 4 + "requires": true, 5 + "packages": { 6 + "": { 7 + "devDependencies": { 8 + "@playwright/test": "^1.48.1" 9 + } 10 + }, 11 + "node_modules/@playwright/test": { 12 + "version": "1.48.1", 13 + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.48.1.tgz", 14 + "integrity": "sha512-s9RtWoxkOLmRJdw3oFvhFbs9OJS0BzrLUc8Hf6l2UdCNd1rqeEyD4BhCJkvzeEoD1FsK4mirsWwGerhVmYKtZg==", 15 + "dev": true, 16 + "license": "Apache-2.0", 17 + "dependencies": { 18 + "playwright": "1.48.1" 19 + }, 20 + "bin": { 21 + "playwright": "cli.js" 22 + }, 23 + "engines": { 24 + "node": ">=18" 25 + } 26 + }, 27 + "node_modules/fsevents": { 28 + "version": "2.3.2", 29 + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 30 + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 31 + "dev": true, 32 + "hasInstallScript": true, 33 + "license": "MIT", 34 + "optional": true, 35 + "os": [ 36 + "darwin" 37 + ], 38 + "engines": { 39 + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 40 + } 41 + }, 42 + "node_modules/playwright": { 43 + "version": "1.48.1", 44 + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.48.1.tgz", 45 + "integrity": "sha512-j8CiHW/V6HxmbntOfyB4+T/uk08tBy6ph0MpBXwuoofkSnLmlfdYNNkFTYD6ofzzlSqLA1fwH4vwvVFvJgLN0w==", 46 + "dev": true, 47 + "license": "Apache-2.0", 48 + "dependencies": { 49 + "playwright-core": "1.48.1" 50 + }, 51 + "bin": { 52 + "playwright": "cli.js" 53 + }, 54 + "engines": { 55 + "node": ">=18" 56 + }, 57 + "optionalDependencies": { 58 + "fsevents": "2.3.2" 59 + } 60 + }, 61 + "node_modules/playwright-core": { 62 + "version": "1.48.1", 63 + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.48.1.tgz", 64 + "integrity": "sha512-Yw/t4VAFX/bBr1OzwCuOMZkY1Cnb4z/doAFSwf4huqAGWmf9eMNjmK7NiOljCdLmxeRYcGPPmcDgU0zOlzP0YA==", 65 + "dev": true, 66 + "license": "Apache-2.0", 67 + "bin": { 68 + "playwright-core": "cli.js" 69 + }, 70 + "engines": { 71 + "node": ">=18" 72 + } 73 + } 74 + } 75 + }
+8
playwright/package.json
··· 1 + { 2 + "scripts": { 3 + "test": "playwright test" 4 + }, 5 + "devDependencies": { 6 + "@playwright/test": "^1.48.1" 7 + } 8 + }
+18
playwright/playwright.config.ts
··· 1 + import { defineConfig, devices } from "@playwright/test"; 2 + 3 + export default defineConfig({ 4 + projects: [ 5 + { 6 + name: "chromium", 7 + use: devices["Desktop Chrome"], 8 + }, 9 + { 10 + name: "firefox", 11 + use: devices["Desktop Firefox"], 12 + }, 13 + { 14 + name: "webkit", 15 + use: devices["Desktop Safari"], 16 + }, 17 + ], 18 + });
+15
playwright/test.html
··· 1 + <!DOCTYPE html> 2 + <html> 3 + <head> 4 + <meta charset="UTF-8" /> 5 + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 6 + <title>Document</title> 7 + </head> 8 + <body> 9 + <first-test><div>1</div></first-test> 10 + <second-test> 11 + <div>2</div> 12 + <div></div> 13 + </second-test> 14 + </body> 15 + </html>