manual-yaml
v1.3.1
Published
manual-yaml is a standardised method for generating maunal tests. The tool will then convert manual tests to e2e tests automatically for you.
Downloads
9
Readme
manual-yaml
Table of Contents generated with DocToc
- What is manual-yaml
- How to install
- Available manual-yaml commands
- Starting a new project
- Adding a new test suit to an existing project
- Excel sheet creation from yml tests
- Converting a yml stack of manual tests to e2e test stubs
What is manual-yaml
An npm package to normalise manual test writing into yaml files. The normalised form of the manual tests can then be automatically used to generate all the required stubs for e2e testing.
How to install
Installed globally to your local machine:
npm i -g manual-yaml
Available manual-yaml commands
Usage: index [options]
Options:
-v, --version output the version number
-S, --skeletonGenerate Generate a skeleton structure of yml manual tests within the current folder
-s, --ymlSuiteGenerate [string] Generate a single yml test suite to the current dir. Pass the name of test as a string eg tests/contact-us/sendMsg.yml
-e, --e2eGenerate Generate e2e stubs for a directory the command is used within, ie "./"
-t, --templates [string] If passed should be the path to custom templates for manual-yaml
-f, --format [string] Defaults to nightwatchjs if not passed. The string should match the name of the tpl minus the .njk file ext. To use an alternate e2e output please use the custom templates directive. Alternatively please send a pull request to merge in your favourite e2e test env. tpl.
-x, --excel Generates a spreadsheet manual testing session based on the Yaml tests
-h, --help output usage information
Starting a new project
- Navigate to the root of your manual testing folder.
- Insert a manual-yaml skeleton to quickly get started:
manual-yaml -S
- When asked to create the skeleton yml folder press 'y' then 'enter'
NB: If there is already a folder named 'yml' then manual-yaml will stop and let you know.
Adding a new test suit to an existing project
- Navigate to the root of your manual testing folder
- Insert a manual-yaml test suit quickly by running (replacing the path with your own):
manual-yaml -s yml/tests/contact-us/sendMsg.yml
NB: If this test already exists it will stop and let you know.
NB2:
If you pass the -t
to override the templates directory you have the option to use your own yml tpl (see below).
Excel sheet creation from yml tests
(rough and ready solution at present)
You can generate a spreadsheet from the yaml files to assist in keeping track of the progress of the tests.
- Navigate to the root folder of your manual yaml folder
- manual-yaml -x
Converting a yml stack of manual tests to e2e test stubs
- Navigate to the root of your manual testing folder
- Run the following command to create your e2e stubs
manual-yaml -e
- manual-yaml will automatically convert all the yml to files to nightwatchjs e2e test stubs
NB: It will not overwrite any tests already found.
Changing the default e2e template
By default manual-yaml will use a built in template for nightwatchjs to generate the e2e stubs. You can instruct manual-yaml to use another template by passing its name minus the .njk
extension:
manual-yaml -e -f someothertestrig
Currently there is only 1 built in template and this is for nightwatchjs, to use manual-yaml with another test runner, please use the -f
directive in combination with the -t
custom templates (documented below) eg: -f testcafe -t /home/me/manual-yaml-templates
will instruct manual-yaml to use the testcafe test runner and the template is in the custom templates directory.
e2e conversion custom templates
Using the --templates
or -t
for short directive you are able to overwrite the directory for the templates and thus use your own.
manual-yaml -e -t /home/me/manual-yaml-templates
The provided custom tpl directory should contain at least 1 folder with the tests, eg:
test-suites/
------------ karma.njk
------------ nightwatchjs.njk
------------ testcafe.njk
You can then switch between your own custom tpls with ease (don't forget the default is nightwatchjs):
manual-yaml -e -f testcafe -t /home/me/manual-yaml-templates