🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@qavajs/template

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qavajs/template

library that allow to define step definitions on Gherkin language

Source
npmnpm
Version
0.0.3
Version published
Weekly downloads
310
35.96%
Maintainers
2
Weekly downloads
 
Created
Source

@qavajs/template

Library that allow to define step definitions on Gherkin language.

Feature: Templates

  Scenario: I login
    When I open 'https://your-app.com'
    And I type 'username' to 'Login Form > Username Input'
    And I type 'password' to 'Login Form > Password Input'
    And I click 'Login Form > Login Button'

Then following template can be called from scenario as simple step

Feature: Auth

  Scenario: Verify that user is able to login
    When I login
    Then I expect 'Header' to be visible

Templates also can accept parameters as < param> e.g

Feature: Templates

  Scenario: I login as '<username>' with '<password>' password
    When I open 'https://your-app.com'
    And I type '<username>' to 'Login Form > Username Input'
    And I type '<password>' to 'Login Form > Password Input'
    And I click 'Login Form > Login Button'

Then following template can be called with actual params

Feature: Auth

  Scenario: Verify that user is able to login
    When I login as 'admin' with 'admin' password
    Then I expect 'Header' to be visible

To use templates their location need to be passed to templates property of config file and library need to be listed in require

module.exports = {
    default: {
        require: [
            'node_modules/@qavajs/steps-config-loader'
        ],
        requireModule: [
            '@qavajs/template'
        ],
        templates: ['templates/*.feature']
    }
}

FAQs

Package last updated on 31 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts