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
🏗✨✅ Introduce interactivity to visual diff tests (experimental) #19114
🏗✨✅ Introduce interactivity to visual diff tests (experimental) #19114
Conversation
/cc @newmuis - you might be interested in this |
I am indeed very interested in this. |
* // reference to the Puppeteer page, and the full name of the test (page | ||
* // name + test name). e.g., the JS file can be: | ||
* // module.exports = { | ||
* // 'tap red button': async (page, name) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the key here sort of just a description? it does nothing as far as execution correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a description, but it also sets the name of the snapshot in Percy - and that determines what snapshot any future PR will be compared against
e.g., in the example test that I added, I named the test tap "see more" button
, and in Percy the name of the snapshot is AMP List and Mustache (tap "see more" button)
https://percy.io/ampproject/amphtml/builds/1137857
// load those tests here. | ||
for (const webpage of webpages) { | ||
webpage.tests_ = { | ||
'': async() => {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whats the empty func for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sure each page has a "zero interactions" test as well (it's easier to add this empty function to the list of tests than it is to create a special case before the iterator later on)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excited to see this happen!
Adds an
interactive_tests
field to thevisual-tests
JSON5 file.The field is a file path to a JavaScript file that exports a dictionary of (async) test functions keyed by a short descriptive name.
Each test function is passed two arguments: a reference to the Puppeteer page, and the full name of the test (page name + test name). e.g., the JS file can be:
This PR also adds a single test as a proof-of-concept :)