Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override generated scenarios #31

Closed
wants to merge 6 commits into from
Closed

Override generated scenarios #31

wants to merge 6 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Dec 6, 2019

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

module.exports = processOverrides;
function processOverrides(urls, scenarios) {

scenarios.forEach((scenario, scenarioKey) => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that doing a forEach inside another forEach isn't ideal, but I haven't yet figured out a more efficient way to do this.

@coveralls
Copy link

coveralls commented Dec 6, 2019

Coverage Status

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

README.md Outdated Show resolved Hide resolved
lib/crawl.js Show resolved Hide resolved
lib/crawl.js Show resolved Hide resolved
@ghost ghost marked this pull request as ready for review December 6, 2019 17:50
@ssteigen ssteigen closed this by deleting the head repository Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Override specific scenarios via template?
3 participants