Closed newmuis closed 5 years ago
A few more issues:
<html>
tag, the <body>
, and the <amp-story>
, to no avail; the viewport always remains too tall. Perhaps they have a min-height
?loading_complete_css
, loading_incomplete_css
, and forbidden_css
selectors do not work to target elements that are contained within shadow DOM (such as <amp-story>
's system layer.loading_complete_css
to be in the DOM, but it is never found in the DOM, the test will continue rather than failing.It's possible for us to write code in the runtime to combat some of these, but it feels wasteful for users to download code that exists to make the visual diff tests work.
/cc @danielrozenberg @rsimha
3 and 4 can be mitigated by writing custom loading CSS classes in the test HTML files themselves, hooking into the events triggered by amp-story
. 2 we might be able to live with for now; at the very least, we can change the height of the story and just leave blank space at the bottom of the screenshot. 1 is by far the biggest problem because it means we cannot test both desktop and mobile.
The height and width of the viewport in which the local rendering step is done are currently hard coded, and used across all visual tests.
I'd imagine they can be set programmatically before snapshotting each page. Assuming this is possible, instead of doing the client-side rendering once and server-side rendering in three widths, we could consider doing client-side rendering once per viewport size, and server-side rendering once with the same size. This will generate the same number of snapshots, but the build could take longer on the client side. If the delta isn't too much, we can allow individual tests to specify the widths they're interested in testing so the full run doesn't take as long.
@danielrozenberg I think it's worth investigating a) whether it's possible to dynamically change the viewport size between tests, and if so, b) how much longer it would take to run the tests as described above.
For the height, I think my issue is with the height of the screenshot, not necessarily the height of the viewport. The screenshots aren't 100000px
, so I'm not sure where the height comes from.
10000 is the maximum viewport height. It's used so that snapshots capture the entire page. Smaller pages generate smaller snapshots.
That's the issue I'm running into: even if I make the page "smaller", there appears to be a minimum height that is always used. As such, I'm unable to make the page sufficiently small (in height) for my use case.
I just don't know where the minimum is coming from ☹️
Between @danielrozenberg's fixes in #17028 and disabling amp-story
's use of shadow DOM while the tests are running, we're most of the way there. One other issue is that it appears that CSS grid is not working in the tests. For example, from https://github.com/ampproject/amphtml/pull/17028:
Percy's screenshot (incorrect):
Browser screenshot (correct):
Weirdly, I tested this locally in Firefox ESR 52 (on Mac OS), and it works fine.
Reopened because these tests are very flaky.
My initial suspicion is that while waiting for the .i-amphtml-story-loaded
class to be added to the DOM is sufficient for the actual content of the page, other UI chrome like the share pill and the desktop background may or may not be ready at that time.
So, my next step would be to try adding the CSS classes for all the other visible UI chrome to the loading_complete_css
list, and running the tests many times to ensure that there are no flakes.
This is a high priority issue but it hasn't been updated in awhile. @newmuis Do you have any updates?
This is a high priority issue but it hasn't been updated in awhile. @newmuis Do you have any updates?
This is a high priority issue but it hasn't been updated in awhile. @newmuis Do you have any updates?
This is a high priority issue but it hasn't been updated in awhile. @newmuis Do you have any updates?
Closing this in favor of keeping all skipped tests tracked in #11639
The initial attempt in #11682 ran into some issues, but now that the experiment is removed from 1.0, I believe we should be able to add these tests with no problem.