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

Add visual diff test for amp-user-notification #20635

Merged
merged 2 commits into from Feb 5, 2019

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Feb 1, 2019

No description provided.

@danielrozenberg
Copy link
Member

You need to resolve the conflict for Travis→Percy to run

Copy link
Member

@danielrozenberg danielrozenberg left a comment

Choose a reason for hiding this comment

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

Approval for test itself; I'll leave it to @torch2424 to approve the AMP page and Percy build

@@ -600,5 +600,14 @@
],
"interactive_tests": "examples/visual-tests/amp-story/amp-story-page-attachment-desktop.js"
},
{
"url": "examples/visual-tests/amp-user-notification/amp-user-notification-blocking.amp.html",
Copy link
Member

Choose a reason for hiding this comment

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

I think that it might be worth changing the file name to amp-user-notification.amp.html, since this is testing both blocking and unblocking, and you might want to check other things as well in later tests. Your choice of course :)

Copy link
Contributor Author

@zhouyx zhouyx Feb 5, 2019

Choose a reason for hiding this comment

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

Was going to have two different html files. Completely agreed amp-user-notification.amp.html is a better name given there's only one file.

"loading_complete_css": [
"amp-user-notification.amp-active",
],
"interactive_tests": "examples/visual-tests/amp-user-notification/dismiss-amp-user-notification.js"
Copy link
Member

Choose a reason for hiding this comment

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

Rename this file to amp-user-notification-blocking.js (or amp-user-notification.js, if you accept the previous comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to amp-user-notification.js

Copy link
Contributor

@torch2424 torch2424 left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! Some initial comments, and then we can go from there 👍

<link rel="canonical" href="amps.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Georgia|Open+Sans|Roboto' rel='stylesheet' type='text/css'>
<style amp-custom>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the CSS for this? 🤔 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, no I don't need the css. remove unrelated css. I still want to keep the amp-user-notification related css for easier visual diff comparison.

</div>
</div>
<div class="article-body" itemprop="articleBody">
<p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this much sample text? 🤔 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, no we don't. cleaned up a bit. However I still want to keep enough content to make the page scrollable.

module.exports = {
'dismiss user notification': async (page, name) => {
await page.tap('amp-user-notification>button');
await page.waitFor(500);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could the veryfyCssElements thing work here? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried that before. Unfortunately there isn't a good css class to wait for given we need to wait for the ad iframe to load.

@zhouyx
Copy link
Contributor Author

zhouyx commented Feb 5, 2019

@torch2424 This is good for another round of review. Thank you

Copy link
Contributor

@torch2424 torch2424 left a comment

Choose a reason for hiding this comment

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

LGTM 😄 One last request/question from daniel that I will let them decide 👍

Super stoked that you made this, thank you! 🎉

"url": "examples/visual-tests/amp-user-notification/amp-user-notification.amp.html",
"name": "amp-user-notification",
"viewport": {"width": 400, "height": 600},
"loading_complete_css": [
Copy link
Contributor

Choose a reason for hiding this comment

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

@danielrozenberg Do you think it would be better practice to have test functionality all in the JS, or a mix between config and their JS.

I think we could move this into the JS file, and use the verifyCss... function right? I feel like that would be slightly cleaner 😄

Copy link
Member

Choose a reason for hiding this comment

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

They serve a different purpose - the JS code doesn't start running until after the loading_complete_css is verified; that means you should use loading_complete_css to mark when the page is ready for interactions, and move forward from there

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh. Sounds good! Thank you for the explanation! 😄

@zhouyx zhouyx merged commit 23e45f9 into ampproject:master Feb 5, 2019
@zhouyx zhouyx deleted the visual-diff branch February 5, 2019 23:52
nbeloglazov pushed a commit to nbeloglazov/amphtml that referenced this pull request Feb 12, 2019
* add visual diff test for amp-user-notification

* address comments
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
* add visual diff test for amp-user-notification

* address comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants