@tracera/cypress
v1.3.1
Published
Cypress plugin and support for Tracera autotest
Maintainers
Readme
@tracera/cypress
Cypress plugin and support for Tracera autotest.
Requires Node.js ≥ 22.19 and Cypress ≥ 14.
npm install @tracera/cypressHow-to: Cypress. Shared env / run mode: Autotest adapters.
Setup
// cypress.config.ts
import { defineConfig } from 'cypress';
import { registerTraceraPlugin } from '@tracera/cypress';
export default defineConfig({
e2e: {
setupNodeEvents(on, config) {
return registerTraceraPlugin(on, config);
},
supportFile: 'cypress/support/e2e.ts',
},
});// cypress/support/e2e.ts
import '@tracera/cypress/support';Bind
Import tracera / annotations from @tracera/cypress/runtime, or use cy.traceraTestCase after import '@tracera/cypress/support'. Prefer it(title, annotations(id, name), fn). Annotation names are literal (no {param}).
Skip
Stock Cypress / Mocha skip (it.skip, this.skip(), …). Optional: tracera.comment before this.skip() — Mocha has no skip-reason argument.
Steps
tracera.step(title, fn), cy.traceraStep(title, fn), @tracera.step("open {path}") on class methods, or tracera.step("…")(fn) wrap ({name} / {0} from args, or a title function). Sync bodies close immediately — return the Cypress chain (for example return cy.visit(…) or return cy.get(…).click().then(…)) so comments / attaches inside .then land on that step. Stock beforeEach / afterEach → Setup / Teardown; suite before / after are not reported.
Comments, errors, and attachments
tracera.comment / tracera.error / tracera.attachment — see Autotest adapters.
Parameterized
Loop with a distinct id/name per row, or tracera.testCase in the body. Annotation names stay literal. Retries: final attempt only; CYPRESS_RETRY on Env when retry > 0.
