fffunction / backstop-crawl

🕷 Crawls a site to generate a backstopjs config file with scenarios pre-populated
38 stars 18 forks source link

Override generated scenarios #31

Closed ghost closed 1 year ago

ghost commented 4 years ago

This PR probably needs a little work. I'm new to contributing to other people's projects, so criticism is welcome!

First of all, I had to update nyc and ava to get the tests to run. Then I noticed two of the tests were failing because I'm running the project on my Windows machine. I updated the tests so that they are now Windows-compatible.

Normally, backstop-crawl allows the user to define a backstop.template.json, however, I wanted to ability to explicitly state which template file to use.

I added the option to pass in a --template flag. If the path is invalid, an error will be shown. If the flag isn't provided, backstop-crawl behaves as usual.

I also added functionality to process scenario overrides. If the user defines scenarios in their template, those will override generated scenarios with the same label.

If there are no matching labels, the override is ignored.

An idea I had that might be nice is to have overridden scenarios AND additional scenarios. I figured this could be tackled later.

This ticket resolves #30

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-1.4%) to 98.63% when pulling e51f1c8ce3dc5ddf4387155583454bb8d9a3629e on steigenTI:override-generated-scenarios into 33399d53a91752c9af547c610174a04d3d095317 on fffunction:master.