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

feat: on before suite script #170

Merged
merged 16 commits into from
Feb 20, 2019
Merged

feat: on before suite script #170

merged 16 commits into from
Feb 20, 2019

Conversation

milesillsley
Copy link
Contributor

Adds an onBeforeSuiteScript config option which runs a script once, before any snaps are taken.

The script is executed without a driver, so all scripts implemented here need to operate independently of the snappshotters' functionality.

executeScript has been extracted from snapshotter into two separate functions; one taking a driver as an argument (for use in snapshotter) and the other without.

@L0wry L0wry changed the title Feat/on before suite script feat: on before suite script Feb 19, 2019
src/executeScript.js Outdated Show resolved Hide resolved
src/executeScript.js Outdated Show resolved Hide resolved
src/executeScript.test.js Outdated Show resolved Hide resolved
src/executeScript.test.js Outdated Show resolved Hide resolved
src/getScreenshots.js Outdated Show resolved Hide resolved
src/getScreenshots.js Outdated Show resolved Hide resolved
src/getScreenshots.test.js Outdated Show resolved Hide resolved
src/getScreenshots.js Outdated Show resolved Hide resolved
src/snapshotter.test.js Outdated Show resolved Hide resolved
src/snapshotter.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@L0wry L0wry left a comment

Choose a reason for hiding this comment

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

👍

README.md Show resolved Hide resolved
README.md Outdated

In cases where you need to run a script once, before the entire suite is launched (e.g. setting up global objects or setting up external services), pass the path of the script into `onBeforeSuiteScript` in the config file.

Unlike the onReady and onBefore script options onBeforeSuite scripts do not have any driver exposed and take no arguments. Any external dependancys will need to be set up independantly inside the script.
Copy link
Contributor

Choose a reason for hiding this comment

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

"dependencies"

@milesillsley milesillsley merged commit 3b3f45a into master Feb 20, 2019
@milesillsley milesillsley deleted the feat/onBeforeSuiteScript branch February 20, 2019 15:40
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.

3 participants