Services

Prerequisites

Before you begin, ensure the following dependencies and requirements are met:

Requirement
Version / Notes

Node.js

>= 22.x

Cypress

>= 13.x

Package Manager

npm or yarn

Language Support

TypeScript / JavaScript

Installation

Add @ordino.ai/ordino-engine to your Cypress project:

npm install @ordino.ai/ordino-engine@2.2.0-cy.8 --save-dev

A recommended directory layout for using @ordino.ai/ordino-engine with Cypress:

/ordino
  /e2e
    /api
      users.spec.ts
  /services
    add_user.ts
  /payloads
    user_info.ts
  /support
    commands.ts
cypress.config.ts
package.json

Directory / File Details

  • /e2e/api/ Contains your end-to-end test specifications.

    • users.spec.ts → Example Cypress spec file testing user-related API endpoints.

  • /services/ Houses service classes that encapsulate API calls and business logic.

    • add_user.ts → Example service class for handling user-related API operations.

  • /payloads/ Stores request/response payloads used in tests.

    • user_info.ts → Example test payload for creating or validating users data.

  • /support/ Contains Cypress custom commands and global hooks.

    • commands.ts → Extend Cypress with reusable commands for common actions.

  • cypress.config.ts Cypress configuration file. Define base URL, environment variables, and test settings here.

  • package.json Project dependencies, scripts, and metadata. Includes the installed @ordino.ai/ordino-engine package.


Engine Import

In any service or test file, import the HTTP API from @ordino.ai/ordino-engine:

import { ordinoSuite } from '@ordino.ai/ordino-engine';

const http = ordinoSuite.api(ApiServiceType.HTTP);
  • ordinoSuite → Main entry point to the Ordino Engine.

  • ApiServiceType.HTTP → Specifies that the API service should use HTTP as the communication layer.

  • http → An initialized API client instance to perform requests.

Last updated