COR SDK & CLI In development

Page objects out. One repo in.

The COR CLI reads your existing suite, moves every hardcoded selector into a versioned, graded locator repo, and rewrites the calls. At run time your tests resolve from it.

Not yet on npm · The Chrome extension is live today

cor analyze reads your suite and grades every hardcoded selector. Nothing is rewritten.

Example output. Counts are illustrative. SDK and CLI are in development.

How it works

Four commands from POM to repo

  1. 1

    Analyze

    Scans specs and page objects, finds every hardcoded selector and grades it A to F.

    cor analyze ./testsRead-only. Nothing is rewritten.
  2. 2

    Migrate

    Preview with a dry run, then rewrite the calls at the depth you choose: layer 1, 2 or 3.

    cor migrate --layer=1 --dry-runRollback is git revert.
  3. 3

    Push

    Uploads every locator to COR Studio as a new commit on your branch.

    cor pushVersioned like code.
  4. 4

    Pull and verify

    CI pulls once, then checks that every call in your tests has a backing locator.

    cor pull && cor verifyWrites .cor-cache.json.

Migration layers

Migrate as deep as you want

Start with selectors only and keep your page objects. Go further when the team is ready. Each layer is a plain diff in your test files.

Playwright examplecor migrate --layer=1|2|3

Inline: selectors move, page objects stay

Each hardcoded selector becomes a cor() lookup. Your page object classes and their methods are untouched.

Before CheckoutPage.ts · checkout.spec.ts
// CheckoutPage.ts
class CheckoutPage {
  constructor(page) {
    this.pay = page.locator('#pay-btn');
  }
}

// checkout.spec.ts
await new CheckoutPage(page)
  .pay.click();
After CheckoutPage.ts · checkout.spec.ts
// CheckoutPage.ts
class CheckoutPage {
  constructor(page) {
    this.pay = page.locator(cor('checkout', 'pay'));
  }
}

// checkout.spec.ts · unchanged
await new CheckoutPage(page)
  .pay.click();
Touches selector strings onlyRollback git revert on the test files

Framework adapters

Same repo, your framework's call

Each adapter resolves a named locator from the repo in your framework's own idiom. The CLI itself works on any suite.

AdaptersIn development

@corlabs/playwright

// Layer 3
await cor.page('checkout').get('pay').click();

// Layer 1
page.locator(cor('checkout', 'pay'))

At run time

Zero API calls per test

Locators are pulled once, then read from a local file. Your suite does not wait on a network round trip for every selector.

  • 1

    cor pull

    Writes every locator for your branch to .cor-cache.json.

  • 2

    globalSetup

    The adapter loads the cache once, before the first test.

  • 3

    each test

    Resolves names from memory. No per-test API call.

Also in the CLI

Checks that keep the repo honest

verify

Every call has a locator

Confirms each cor() call in your tests has a backing locator in the repo, before CI runs the suite.

cor verify
audit

Catch drift

Compares what is in the repo with what your code references: used but missing, or captured but never used.

cor audit
branch

Review locator changes

Branch the repo and diff it against main, like code, before a locator change merges.

cor branch diff --base main

In development, not yet published

The SDK and CLI are at version 0.1.0 and are not on npm, so there is no install command yet. Migration, versioning and branches can be tested today by linking the packages locally. The Chrome extension is live and captures the same locators the SDK will resolve.

Join the waitlist and we will write once when the packages ship.

Questions

Before you migrate

Can't find your answer? Ask in Discord or send us a message.

Can I install it today?

Not yet. The SDK and CLI are not published to npm. Join the waitlist to hear when they ship. The Chrome extension is live now, and what you capture there carries over.

What does migrating involve?

Run cor analyze to see what is in your suite, then cor migrate with --dry-run to preview the rewrite. You choose layer 1, 2 or 3, and review the diff before it lands in your tests.

Do I have to drop page objects?

No. Layer 1 keeps them and only moves the selectors into the repo. Layer 2 swaps their base class. Layer 3 removes them. Rollback at any layer is a git revert on your test files.

Can COR help me move from one framework to another?

For the locators, yes. Each locator is stored once, independent of framework, and every adapter resolves the same name. Moving a suite from Cypress to Playwright turns cy.corGet('checkout', 'pay') into cor.page('checkout').get('pay'), and the locator itself carries over unchanged. COR does not translate your test steps; those you still rewrite.

Which frameworks are supported?

Adapters are in development for Playwright, Cypress, WebdriverIO and Nightwatch. The CLI is framework-agnostic.

Does my suite need network access to run?

No per-test calls. The CLI pulls locators once into .cor-cache.json, the adapter loads it once in globalSetup, and every test resolves from memory.

Get on the list

Be first when the SDK ships

Use the extension today. Join the waitlist and we will write once as the SDK and CLI open.