migrate-selenium-java-to-codeceptjs
Installation
SKILL.md
Migrate Selenium / Selenide (Java) → CodeceptJS 4
This migration is more than a syntax port — every file changes language. Java becomes JavaScript (or TypeScript), Maven/Gradle becomes npm, JUnit/TestNG becomes the CodeceptJS runner. The mechanical translation is fully tractable; the wins are real (semantic locators, auto-wait, first-class abstractions, AI-assisted authoring), and the patterns transfer.
Three foundational differences to internalize:
- Tests read sequentially without explicit waits. CodeceptJS auto-queues every
I.*call onto an internal recorder and waits on DOM/element stability automatically. Selenium'sWebDriverWait+ExpectedConditions.*boilerplate goes to zero; Selenide's.shouldBe(visible)/.shouldHave(text(...))chains usually collapse into the action itself (I.click('Save')waits, clicks, asserts).awaitin CodeceptJS is reserved for grabs (await I.grabTextFrom(...)) — on plain actions it works but isn't recommended. This is the single biggest visible change in spec files. - Helpers, not
WebDriver/driver.I.*dispatches to a configured helper. Default to the WebDriver helper — it speaks the same W3C WebDriver protocol your Java suite already speaks, so the migration is most native: same Selenium server, same browser drivers, same capabilities, same Grid if you have one. Once the suite is green on WebDriver, you can swap in the Playwright helper (modern, faster, less flaky, native multi-browser via one config) by changing one helper block — the test code is identical either way. - First-class abstractions. Page objects, the
authplugin, multi-usersession(...), custom helpers, and thecustomLocatorplugin are built in. Java suites already centralise these (PageFactory,LoginHelper,DriverManager); the migration consolidates them onto the framework's idioms instead of carrying the Java-specific glue forward.
Authoritative references: node_modules/codeceptjs/docs/basics.md, locators.md, playwright.md, webdriver.md, custom-helpers.md, pageobjects.md.
When to trigger
Any of: