WebdriverIO Jasmine Framework Adapter (Legacy)

0.3.8 · abandoned · verified Sun Apr 19

This package, `wdio-jasmine-framework`, is an **abandoned** framework adapter for older versions of WebdriverIO, specifically designed for WebdriverIO v3 or v4. Its last update was 7 years ago, with version 0.3.8. It integrates the Jasmine testing framework with the WebdriverIO test runner, allowing users to write end-to-end tests using Jasmine's BDD syntax. Unlike its modern counterpart, `@wdio/jasmine-framework`, this package is not compatible with current WebdriverIO versions (v7, v8, v9) due to significant architectural changes and dependency updates within the WebdriverIO ecosystem. Its primary function was to enable Jasmine `describe`, `it`, and `expect` syntax within WebdriverIO test files, along with configuration options like `defaultTimeoutInterval` and `expectationResultHandler` via `wdio.conf.js`. Users requiring Jasmine integration with modern WebdriverIO should use the actively maintained `@wdio/jasmine-framework` package.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a basic `wdio.conf.js` configuration using the `wdio-jasmine-framework` and a simple Jasmine spec file. It showcases how to set up the framework and use global `browser` commands with Jasmine's `expect` assertions. It highlights basic navigation and element interaction with assertion. Note this configuration is for older WebdriverIO versions (pre-v5) and is provided for historical context.

/* wdio.conf.js */
const path = require('path');

exports.config = {
  runner: 'local',
  specs: [
    './test/specs/**/*.js'
  ],
  exclude: [],
  maxInstances: 1,
  capabilities: [{
    maxInstances: 1,
    browserName: 'chrome'
  }],
  logLevel: 'info',
  bail: 0,
  baseUrl: 'http://localhost',
  waitforTimeout: 10000,
  connectionRetryTimeout: 120000,
  connectionRetryCount: 3,
  services: [],
  framework: 'jasmine',
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000, // Extend timeout for example tests
    expectationResultHandler: function(passed, assertion) {
      if (!passed) {
        console.error(`Jasmine Assertion Failed: ${assertion.message} - ${assertion.fullName}`);
        // In a real scenario, you might take a screenshot here
        // browser.saveScreenshot(`./error_screenshots/${assertion.fullName}.png`);
      }
    }
  },
  reporters: ['spec'],
  compilerOptions: {
    module: 'commonjs',
    target: 'es5'
  },
  autoCompile: true,
};

/* test/specs/example.js */
describe('Example WebdriverIO with Jasmine', () => {
  it('should have the correct title', async () => {
    await browser.url('https://webdriver.io');
    await expect(browser).toHaveTitle('WebdriverIO · Next-gen browser and mobile automation test framework for Node.js');
  });

  it('should find an element by text', async () => {
    await browser.url('https://webdriver.io');
    const gettingStartedLink = await $('[href="/docs/gettingstarted"]');
    await expect(gettingStartedLink).toBePresent();
    await expect(gettingStartedLink).toHaveTextContaining('Getting Started');
  });
});

view raw JSON →