From a62fa05711968e5df40429153041c7a6f1db32b6 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 11:39:33 +0000 Subject: [PATCH 1/2] Add Playwright Google search migration --- .github/workflows/playwright-google.yml | 39 +++++++++++ e2e-playwright/.gitignore | 3 + e2e-playwright/package-lock.json | 76 ++++++++++++++++++++++ e2e-playwright/package.json | 10 +++ e2e-playwright/playwright.config.ts | 26 ++++++++ e2e-playwright/tests/google-search.spec.ts | 18 +++++ 6 files changed, 172 insertions(+) create mode 100644 .github/workflows/playwright-google.yml create mode 100644 e2e-playwright/.gitignore create mode 100644 e2e-playwright/package-lock.json create mode 100644 e2e-playwright/package.json create mode 100644 e2e-playwright/playwright.config.ts create mode 100644 e2e-playwright/tests/google-search.spec.ts diff --git a/.github/workflows/playwright-google.yml b/.github/workflows/playwright-google.yml new file mode 100644 index 0000000..d643e6b --- /dev/null +++ b/.github/workflows/playwright-google.yml @@ -0,0 +1,39 @@ +name: Playwright Google search + +on: + pull_request: + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: e2e-playwright + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: e2e-playwright/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Install Chromium + run: npx playwright install --with-deps chromium + + - name: Run Google search spec + run: npx playwright test tests/google-search.spec.ts + + - name: Upload Playwright report + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-report + path: e2e-playwright/playwright-report + if-no-files-found: ignore diff --git a/e2e-playwright/.gitignore b/e2e-playwright/.gitignore new file mode 100644 index 0000000..dbd64df --- /dev/null +++ b/e2e-playwright/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +test-results/ +playwright-report/ diff --git a/e2e-playwright/package-lock.json b/e2e-playwright/package-lock.json new file mode 100644 index 0000000..674d80c --- /dev/null +++ b/e2e-playwright/package-lock.json @@ -0,0 +1,76 @@ +{ + "name": "ts-java-selenium-testng-playwright", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ts-java-selenium-testng-playwright", + "devDependencies": { + "@playwright/test": "1.50.1" + } + }, + "node_modules/@playwright/test": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.1.tgz", + "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.50.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", + "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.50.1" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.50.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", + "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + } + } +} diff --git a/e2e-playwright/package.json b/e2e-playwright/package.json new file mode 100644 index 0000000..0e3ae83 --- /dev/null +++ b/e2e-playwright/package.json @@ -0,0 +1,10 @@ +{ + "name": "ts-java-selenium-testng-playwright", + "private": true, + "scripts": { + "test": "playwright test" + }, + "devDependencies": { + "@playwright/test": "1.50.1" + } +} diff --git a/e2e-playwright/playwright.config.ts b/e2e-playwright/playwright.config.ts new file mode 100644 index 0000000..9c51e2d --- /dev/null +++ b/e2e-playwright/playwright.config.ts @@ -0,0 +1,26 @@ +import { defineConfig, devices } from '@playwright/test'; + +export default defineConfig({ + testDir: './tests', + timeout: 30_000, + expect: { + timeout: 10_000, + }, + fullyParallel: true, + forbidOnly: Boolean(process.env.CI), + retries: process.env.CI ? 2 : 0, + reporter: [['html', { outputFolder: 'playwright-report', open: 'never' }]], + use: { + headless: true, + actionTimeout: 10_000, + navigationTimeout: 30_000, + screenshot: 'only-on-failure', + trace: 'retain-on-failure', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}); diff --git a/e2e-playwright/tests/google-search.spec.ts b/e2e-playwright/tests/google-search.spec.ts new file mode 100644 index 0000000..31e4087 --- /dev/null +++ b/e2e-playwright/tests/google-search.spec.ts @@ -0,0 +1,18 @@ +import { expect, test } from '@playwright/test'; + +test('Google search title contains the query', async ({ page }) => { + await page.goto('https://www.google.co.in/?hl=en'); + + const consentButton = page + .getByRole('button', { name: /accept all|i agree/i }) + .first(); + if (await consentButton.isVisible().catch(() => false)) { + await consentButton.click(); + } + + const searchInput = page.locator('[name="q"]'); + await searchInput.fill('abc'); + await searchInput.press('Enter'); + + await expect(page).toHaveTitle(/abc/i); +}); From c7f945939dacb028c3af10ad98202f350c46373a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 11:40:39 +0000 Subject: [PATCH 2/2] Upgrade Playwright to patched release --- e2e-playwright/package-lock.json | 30 +++++++++++++++--------------- e2e-playwright/package.json | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/e2e-playwright/package-lock.json b/e2e-playwright/package-lock.json index 674d80c..1d6ed95 100644 --- a/e2e-playwright/package-lock.json +++ b/e2e-playwright/package-lock.json @@ -6,23 +6,23 @@ "": { "name": "ts-java-selenium-testng-playwright", "devDependencies": { - "@playwright/test": "1.50.1" + "@playwright/test": "1.62.1" } }, "node_modules/@playwright/test": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.50.1.tgz", - "integrity": "sha512-Jii3aBg+CEDpgnuDxEp/h7BimHcUTDlpEtce89xEumlJ5ef2hqepZ+PWp1DDpYC/VO9fmWVI1IlEaoI5fK9FXQ==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.62.1.tgz", + "integrity": "sha512-DTcUc8qii+cpHvtOwggMtBRMjKZHXYWdw8syRYu2vtzuq4Wxphqq4NfCs5Zt44L6mA8rfDfj+PHnxFc/FeK6mQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.50.1" + "playwright": "1.62.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/fsevents": { @@ -41,35 +41,35 @@ } }, "node_modules/playwright": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.50.1.tgz", - "integrity": "sha512-G8rwsOQJ63XG6BbKj2w5rHeavFjy5zynBA9zsJMMtBoe/Uf757oG12NXz6e6OirF7RCrTVAKFXbLmn1RbL7Qaw==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.62.1.tgz", + "integrity": "sha512-0M+L3LAD8/nm554LOla9Ayx0j0tmFZ0FBcoQ7F1VuVHpM/XpiC8RcDzBQB8W5+hA8L22THxELzeF+2WcUzvcLg==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.50.1" + "playwright-core": "1.62.1" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.50.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.50.1.tgz", - "integrity": "sha512-ra9fsNWayuYumt+NiM069M6OkcRb1FZSK8bgi66AtpFoWkg2+y0bJSNmkFrWhMbEBbVKC/EruAHH3g0zmtwGmQ==", + "version": "1.62.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.62.1.tgz", + "integrity": "sha512-wPYSwEBJY9GHraISXqyqtx0na0LpO3XEX7jNDhntbex7tzUS7kLnZsOlFruFJB4Hi/rhDMjXGqHewDZ68nYZVw==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } } } diff --git a/e2e-playwright/package.json b/e2e-playwright/package.json index 0e3ae83..a3499a4 100644 --- a/e2e-playwright/package.json +++ b/e2e-playwright/package.json @@ -5,6 +5,6 @@ "test": "playwright test" }, "devDependencies": { - "@playwright/test": "1.50.1" + "@playwright/test": "1.62.1" } }