Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // demo.feature ---------------------------------------------------------------------
- Feature: Demo
- Scenario: Param
- When I want to print the configuration config param "param1" from config.xml
- // step_definitions/demo.js ---------------------------------------------------------
- var xml2js = require('xml2js')
- module.exports = function () {
- var config
- xml2js.parseString(`<?xml version="1.0" encoding="UTF-8"?>
- <config>
- <param1>Foo</param1>
- <param2>Bar</param2>
- </config>`, function (err, result) {
- config = result.config
- });
- this.When('I want to print the configuration config param "$configParamName"', function(configParamName) {
- var value = config[configParamName]
- console.log(`param ${configParamName} = ${value}`)
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement