UNPKG

@uuv/cypress

Version:

A solution to facilitate the writing and execution of E2E tests understandable by any human being using cucumber(BDD) and cypress

39 lines (38 loc) 2 kB
/** * Software Name : UUV * * SPDX-License-Identifier: MIT * * This software is distributed under the MIT License, * see the "LICENSE" file for more details * * Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley * Software description: Make test writing fast, understandable by any human * understanding English or French. */ import "@testing-library/cypress/add-commands"; import "cypress-axe"; import { ByRoleOptions } from "@testing-library/cypress"; import { UuvA11yOptions } from "../cucumber/step_definitions/cypress/_.common"; import { Context } from "../cucumber/step_definitions/cypress/_context"; import "cypress-real-events"; import { A11yReferenceEnum, A11yResult } from "@uuv/a11y"; declare global { namespace Cypress { interface Chainable { uuvGetContext(contextName?: string): Cypress.Chainable<Context>; uuvCheckContextWithinFocusedElement(dontThrowError?: boolean): Cypress.Chainable<Context>; uuvCheckContextKeyboardFocusedElement(): Cypress.Chainable<Context>; uuvPatchContext(partOfContext: any, contextName?: string): Chainable<Context>; uuvFindByText(textToSearch: string, roleOptions: ByRoleOptions): Cypress.Chainable<JQuery<HTMLElement>>; uuvFindByTestId(testId: string): Cypress.Chainable<JQuery<HTMLElement>>; uuvFindByRole(role: string, roleOptions: ByRoleOptions): Cypress.Chainable<JQuery<HTMLElement>>; uuvFindByLabelText(labelTextToSearch: string, roleOptions: ByRoleOptions): Cypress.Chainable<JQuery<HTMLElement>>; uuvFindAllByRole(role: string, roleOptions: ByRoleOptions): Cypress.Chainable<JQuery<HTMLElement>>; uuvFoundedElement(): Cypress.Chainable<JQuery<HTMLElement>>; injectUvvA11y(): Cypress.Chainable<void>; checkUvvA11y(options: UuvA11yOptions): Cypress.Chainable<A11yResult>; showUvvA11yReport(reference: A11yReferenceEnum): Cypress.Chainable<A11yResult[]>; } } }