feat: Migrate Selenium + TestNG (Java/Maven) to Playwright (TypeScript)#10
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
feat: Migrate Selenium + TestNG (Java/Maven) to Playwright (TypeScript)#10devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
- Migrate Page Object Model from Java/Selenium to TypeScript/Playwright - BasePage: WebDriver + FluentWait → Page with auto-wait - GooglePage: @findby(name=q) → page.locator('[name="q"]') - FacebookLoginPage: @findby(id=email/pass) → page.locator('#email/#pass') - Convert TestNG tests to Playwright test specs - GoogleSearchTest → google-search.spec.ts - FaceBookLoginTest → facebook-login.spec.ts - Replace framework infrastructure with Playwright built-ins - ExtentReports → Playwright HTML reporter - Log4j → Trace viewer + console - WebDriverContext (ThreadLocal) → Playwright fixtures - PageinstancesFactory → Direct construction - ReportListener/LogListener → Built-in reporter config - Configure cross-browser testing (Chromium, Firefox, WebKit) - Enable parallel execution, trace collection, screenshot-on-failure - Add MIGRATION_PLAN.md with component analysis and risk assessment - Add MIGRATION_RUNBOOK.md with pattern conversion reference
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Complete migration of the test automation framework from Selenium + TestNG (Java/Maven) to Playwright (TypeScript).
What changed
Page Object Model preserved:
BasePage.java→pages/base.page.ts— WebDriver + FluentWait replaced by Playwright Page with auto-waitGooglePage.java→pages/google.page.ts—@FindBy(name="q")→page.locator('[name="q"]')FacebookLoginPage.java→pages/facebook-login.page.ts—@FindBy(id=...)→page.locator('#...')Tests converted:
GoogleSearchTest.java→tests/google-search.spec.tsFaceBookLoginTest.java→tests/facebook-login.spec.tsFramework infrastructure eliminated (replaced by Playwright built-ins):
ExtentReports→ Playwright HTML reporterLog4j→ Trace viewer + console outputWebDriverContext(ThreadLocal) → Playwright fixtures (automatic per-worker isolation)PageinstancesFactory→ Directnew Page(page)constructionReportListener/LogListener→ Built-in reporter configMailUtil/TestProperties→ CI-level notifications / env varsOptimization configured:
fullyParallel: trueon-first-retryonly-on-failureon-first-retryDocumentation:
MIGRATION_PLAN.md— Component analysis, risk assessment, language decision rationaleMIGRATION_RUNBOOK.md— Pattern conversion reference, gotchas, framework comparison, team recommendationsLanguage decision: TypeScript over Java
Playwright TypeScript was chosen because the built-in test runner eliminates ~600 LOC of framework infrastructure (WebDriverContext, ExtentReportManager, listeners, factories). See
MIGRATION_PLAN.mdSection 3 for full rationale.Code reduction
Review & Testing Checklist for Human
npm install && npx playwright install --with-depsthennpm testto verify tests execute across all 3 browsersMIGRATION_PLAN.mdfor accuracy of the existing framework inventory[name="q"], Facebook#email/#pass)MIGRATION_RUNBOOK.mdpattern conversion tables for completeness — add any project-specific patterns your team usesplaywright.config.tssettings (timeouts, retries, parallel workers) and adjust for your CI environmentRecommended test plan:
npm install && npx playwright install --with-depsnpm test— expect 6 tests (2 specs × 3 browsers). Google search test should pass; Facebook test verifies URL after invalid login.npm run test:headedto see browser execution visuallynpm run reportto view the HTML reportNotes
src/,pom.xml) are preserved in the repo — they were not deleted to allow side-by-side comparison during review. They can be removed in a follow-up PR.Assert.assertTrue(false)). The migrated version tests meaningful behavior instead (verifying the URL remains on facebook.com after invalid credentials).Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/660fda71a9ee47718f4fba4cc27c9bf3
Requested by: @bsmitches