CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-wdio--jasmine-framework

A WebdriverIO plugin adapter that integrates Jasmine testing framework with WebdriverIO test runner for end-to-end testing.

Pending
Overview
Eval results
Files

index.mddocs/

WDIO Jasmine Framework

A WebdriverIO plugin that provides adapter functionality for integrating the Jasmine testing framework with WebdriverIO test runner. This adapter enables end-to-end testing using Jasmine's familiar describe/it syntax and assertion methods within WebdriverIO environments.

Package Information

  • Package Name: @wdio/jasmine-framework
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install @wdio/jasmine-framework --save-dev

Core Imports

import JasmineAdapterFactory, { JasmineAdapter } from "@wdio/jasmine-framework";

For CommonJS:

const JasmineAdapterFactory = require("@wdio/jasmine-framework").default;
const { JasmineAdapter } = require("@wdio/jasmine-framework");

Basic Usage

The adapter is typically configured through WebdriverIO configuration rather than direct instantiation:

// wdio.conf.js
export const config = {
  framework: 'jasmine',
  jasmineOpts: {
    defaultTimeoutInterval: 10000,
    expectationResultHandler: (passed, data) => {
      // Handle assertion results
      if (!passed) {
        console.log('Assertion failed:', data.message);
      }
    }
  }
};

Direct adapter usage (advanced):

import JasmineAdapterFactory from "@wdio/jasmine-framework";
import type { EventEmitter } from "node:events";

const adapter = await JasmineAdapterFactory.init(
  'worker-id',
  config,
  specFiles,
  capabilities,
  reporter
);

const exitCode = await adapter.run();

Architecture

The WDIO Jasmine Framework is built around several key components:

  • Adapter Factory: Entry point that creates and initializes JasmineAdapter instances
  • JasmineAdapter: Core adapter class that bridges WebdriverIO with Jasmine framework
  • Event System: Internal reporting bridge that translates Jasmine events to WebdriverIO reporter format
  • Configuration System: Comprehensive options for customizing Jasmine behavior within WebdriverIO
  • Matcher Integration: Seamless integration of WebdriverIO matchers with Jasmine expectations

Capabilities

Adapter Factory

Factory for creating and initializing JasmineAdapter instances. Provides the main entry point for WebdriverIO test runner integration.

declare const adapterFactory: {
  init?: (
    cid: string,
    config: WebdriverIOJasmineConfig,
    specs: string[],
    capabilities: Capabilities.ResolvedTestrunnerCapabilities,
    reporter: EventEmitter
  ) => Promise<JasmineAdapter>;
};

export default adapterFactory;
export { JasmineAdapter, adapterFactory };

Adapter Implementation

Framework Configuration

Comprehensive configuration options for customizing Jasmine behavior within WebdriverIO environments, including timeouts, filtering, and custom handlers.

interface JasmineOpts {
  defaultTimeoutInterval?: number;
  helpers?: string[];
  requires?: string[];
  random?: boolean;
  seed?: Function;
  failFast?: boolean;
  failSpecWithNoExpectations?: boolean;
  oneFailurePerSpec?: boolean;
  specFilter?: () => boolean;
  grep?: string | RegExp;
  invertGrep?: boolean;
  cleanStack?: boolean;
  stopOnSpecFailure?: boolean;
  stopSpecOnExpectationFailure?: boolean;
  expectationResultHandler?: (passed: boolean, data: ResultHandlerPayload) => void;
}

Configuration Options

Types

interface WebdriverIOJasmineConfig extends Omit<WebdriverIO.Config, keyof HooksArray>, HooksArray {
  jasmineOpts: Omit<JasmineOpts, 'cleanStack'>;
}

interface ResultHandlerPayload {
  passed: boolean;
  message?: string;
  error?: Error;
}

type HooksArray = {
  [K in keyof Required<Services.HookFunctions>]: Required<Services.HookFunctions>[K][];
}

Install with Tessl CLI

npx tessl i tessl/npm-wdio--jasmine-framework

docs

adapter.md

configuration.md

index.md

tile.json