https://github.com/testxio/yaml-parser
https://github.com/testxio/yaml-parser
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/testxio/yaml-parser
- Owner: testxio
- Created: 2016-08-25T14:45:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-01-21T10:09:24.000Z (over 6 years ago)
- Last Synced: 2025-10-02T07:16:50.025Z (8 months ago)
- Language: CoffeeScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Usage
In your test file (_mytests/test.yaml_):
```YAML
- go to:
url: /
# fill in the search box and press search
- set:
searchBox: sample pdf files
- set:
searchBtn: ''
# check the content of the pdf file
- check in pdf:
link: pdfLink
expect1: D e n t i s t s
expect2: P o l i t i c i a n s
```
In your spec file (CoffeeScript):
```CoffeeScript
testx = require 'testx'
yamlParser = require '@testx/parser-yaml'
describe 'Some page', ->
it 'should work in a certain way', ->
testx.runScript yamlParser.parseFile 'mytests/test.yaml'
```
Alternatively you can pass the YAML as a literal string. In CoffeeScript:
```CoffeeScript
testx = require 'testx'
yamlParser = require '@testx/parser-yaml'
describe 'Some page', ->
it 'should work in a certain way', ->
testx.runScript yamlParser.parse """
- go to:
url: /
# fill in the search box and press search
- set:
searchBox: sample pdf files
- set:
searchBtn: ''
# check the content of the pdf file
- check in pdf:
link: pdfLink
expect1: D e n t i s t s
expect2: P o l i t i c i a n s
"""
```