An open API service indexing awesome lists of open source software.

https://github.com/qavajs/cypress-runner-adapter

Adapter to launch qavajs project with cypress runner
https://github.com/qavajs/cypress-runner-adapter

qa test-automation testing

Last synced: 4 months ago
JSON representation

Adapter to launch qavajs project with cypress runner

Awesome Lists containing this project

README

          

# @qavajs/cypress-runner-adapter
Adapter to run cucumberjs tests via cypress test runner

## Installation

`npm install @qavajs/cypress-runner-adapter`

## Basic Configuration

```javascript
const { defineConfig } = require('cypress');
const cucumber = require('@qavajs/cypress-runner-adapter/adapter');

module.exports = defineConfig({
e2e: {
specPattern: 'cypress/feature/**/*.feature',
supportFile: 'cypress/support/e2e.js',
setupNodeEvents(on, config) {
on('file:preprocessor', cucumber)
},
},
});
```

`support/e2e.js` is entry point with step definition;

```javascript
import { When, setWorldConstructor } from '@qavajs/cypress-runner-adapter';

class World {
parameter = 42;
}

setWorldConstructor(World);

When('open {string} url', function (url) {
cy.visit(url);
});
```