Migrating from Playwright, Cypress and Cucumber
Bring existing suites into SDODS without rewriting everything on day one.
What to keep, what to convert, and in which order, when you come from plain Playwright, Cypress or a Cucumber-based framework.
From Playwright
- Point
sdods analyze <dir> --applyat the existing suite. It copies the specs intoprojects/<slug>/recorded/imported/and they run as therecordedlayer immediately. Pass--no-import-specsto scaffold the project without copying them. - Move base URLs and credentials into
envs/<env>.yamland.env.<env>. - Convert high-value flows with
sdods record convert <spec>so they become tagged features with shared steps. - Turn
page.locator('css')calls intoheal.locator(primary, context)in page objects as you touch them.
From Cypress
- Run
sdods analyzeto detect routes, the test-id attribute (data-cyis recognised) and existing specs. - Port custom commands to steps in the shared vocabulary or to page-object methods.
- Replace
cy.interceptfixtures with the mock step or HAR files. - Keep
data-cyastestIdAttributeso locators keep working.
From Cucumber frameworks
For a Cucumber-JS suite, let SDODS do the first pass:
sdods import cucumber ../old-suite -p shop --dry-run # the report, nothing written
sdods import cucumber ../old-suite -p shop # a proposal holding the whole project
sdods proposals show <id> && sdods proposals accept <id>
sdods lint -p shopIt reads the features, the step definitions and cucumber.js as text (nothing from the old suite
is executed), copies the features into features/imported/, gives each scenario one layer tag
(inferred from whether its step definitions use a browser or an HTTP client) and one suite tag,
declares the suite's other tags under tags.extra, reuses SDODS library steps where the wording
matches, and writes the rest as stubs in steps/imported.steps.ts that fail with not ported yet
until you port them. IMPORT-REPORT.md lists every scenario's tags, the stubs, steps with no
definition, and the hooks and World code to port by hand. The design is in
docs/adr/0001-import-existing-suites.md. sdods import playwright <dir> analyses a Playwright
suite and proposes the report only.
By hand, or for other Cucumber frameworks:
- Copy
.featurefiles intofeatures/<module>/; add the layer and suite tags;sdods lint --fix-tagshandles obvious folders. - Map step definitions: most HTTP and navigation steps already exist in the shared library; keep the rest in
steps/*.steps.tsusing the projecttestfromsteps/fixtures.ts. - Replace world state with the
apiContextvariables and dataset rows. - Replace separate UI and API runners with one
sdods run.
Do the migration per module and let the coverage report show what is still uncovered.