-
Notifications
You must be signed in to change notification settings - Fork 3.9k
✅ [AMP Story] [Page attachments] Update visual tests for new UIs #34223
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
Conversation
Also fixes #33184 :) |
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.
Looks like the visual-tests
part still needs to be written but the html template is looking good! Left some comments.
test/visual-diff/visual-tests
Outdated
"url": "examples/visual-tests/amp-story/amp-story-page-attachment-v2.html", | ||
"name": "amp-story-page-attachment-v2: displays new inline & outlink CTA buttons with various customizations", |
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.
Nice, but each test is for one snapshot.
We need a snapshot for each page in the template so Percy can diff them.
I think we can link to a specific page in the template by adding #page=<page-id>
to the end of the url in each test.
For example, if we want to test the first page the url
value would be examples/visual-tests/amp-story/amp-story-page-attachment-v2.html#page=cover
In the next test, the url
for page 2 would be examples/visual-tests/amp-story/amp-story-page-attachment-v2.html#page=inline-custom-text
We will know it's working when new snapshots show up for review in the PR.
We also need to be sure the experiment is on.
It looks like that can be done in the html template by following the instructions in visual-tests
:
https://github.com/ampproject/amphtml/blob/main/test/visual-diff/visual-tests#L75-L80
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.
I turned on the experiment! And I added a test for each page
examples/visual-tests/amp-story/amp-story-page-attachment-v2.html
Outdated
Show resolved
Hide resolved
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.
I'm not sure that the visual tests are set up.
We will know they are set up properly when we see percy diffs for each page for review.
Please see the comment about having a unique ID for each page.
Hey @gmajoulet, @newmuis, @Enriqe! These files were changed:
|
Removes tap simulation to navigate to page. Removes timeout. Improves selector to be sure page is visible.
JS can be re-used for desktop and mobile.
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.
Looks awesome. Thank you for setting these up!
I think these will help code cleanup be much easier.
A note that I found a way to simplify the JS for selecting the page and added it to the PR.
I think it's a pattern we can use in the future for multipage tests.
Adding visual tests for:
Inline
Outlink
Demo:

Fixes #33185.
Fixes #33184