diff --git a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ol.amp.html b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ol.amp.html index f076636e46e5..07421a4bb7ab 100644 --- a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ol.amp.html +++ b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ol.amp.html @@ -32,9 +32,6 @@ margin: 0; } - amp-sidebar ul { - list-style: none; - } amp-sidebar li { cursor: pointer; height: 30px; @@ -44,6 +41,12 @@ width: 50vw; } + /* Using invalid AMP to target the sidebar. + Disable transforms for visual diff test */ + .i-amphtml-sidebar-mask, amp-sidebar[side] { + transform: none; + } + #mybody section{ background: red; } @@ -68,7 +71,7 @@

AMP Sidebar Example

@@ -97,5 +100,7 @@

AMP Sidebar Example

+
+
diff --git a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ul.amp.html b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ul.amp.html index 7502a98e3942..fbd15d39ba3c 100644 --- a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ul.amp.html +++ b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ul.amp.html @@ -44,6 +44,12 @@ width: 50vw; } + /* Using invalid AMP to target the sidebar. + Disable transforms for visual diff test */ + .i-amphtml-sidebar-mask, amp-sidebar[side] { + transform: none; + } + #mybody section{ background: red; } @@ -68,7 +74,7 @@

AMP Sidebar Example

@@ -97,5 +103,8 @@

AMP Sidebar Example

+ +
+
diff --git a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js index 7b49cebfc231..879214b66575 100644 --- a/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js +++ b/examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js @@ -18,14 +18,14 @@ */ 'use strict'; -const {verifySelectorsVisible} = require('../../../build-system/tasks/visual-diff/helpers'); +const { + verifySelectorsVisible, +} = require('../../../build-system/tasks/visual-diff/helpers'); module.exports = { - // Since the sidebar now uses animations to open/close, the screenshots will - // not capture the correct state (Percy does not run animations). - // 'open sidebar toolbar': async (page, name) => { - // await page.tap('[on="tap:sidebar.toggle"]'); - // await verifySelectorsVisible(page, name, ['amp-sidebar[open]']); - // await verifySelectorsVisible(page, name, ['nav[toolbar]']); - // }, + 'open sidebar toolbar': async (page, name) => { + await page.tap('[on="tap:sidebar.toggle"]'); + await verifySelectorsVisible(page, name, ['amp-sidebar[open]']); + await verifySelectorsVisible(page, name, ['nav[toolbar]']); + }, }; diff --git a/examples/visual-tests/amp-sidebar/amp-sidebar.amp.html b/examples/visual-tests/amp-sidebar/amp-sidebar.amp.html index be93d57de728..e34d7487fae0 100644 --- a/examples/visual-tests/amp-sidebar/amp-sidebar.amp.html +++ b/examples/visual-tests/amp-sidebar/amp-sidebar.amp.html @@ -65,6 +65,12 @@ width: 50vw; } + /* Using invalid AMP to target the sidebar. + Disable transforms for visual diff test */ + .i-amphtml-sidebar-mask, amp-sidebar[side] { + transform: none; + } + #mybody section{ background: red; } diff --git a/examples/visual-tests/amp-sidebar/amp-sidebar.js b/examples/visual-tests/amp-sidebar/amp-sidebar.js index 94420b328ae2..3956e65e7f43 100644 --- a/examples/visual-tests/amp-sidebar/amp-sidebar.js +++ b/examples/visual-tests/amp-sidebar/amp-sidebar.js @@ -15,11 +15,13 @@ */ 'use strict'; +const { + verifySelectorsVisible, +} = require('../../../build-system/tasks/visual-diff/helpers'); + module.exports = { - // Since the sidebar now uses animations to open/close, the screenshots will - // not capture the correct state (Percy does not run animations). - // 'open sidebar': async (page, name) => { - // await page.tap('[on="tap:sidebar1.toggle"]'); - // await verifySelectorsVisible(page, name, ['amp-sidebar[open]']); - // }, + 'open sidebar': async (page, name) => { + await page.tap('[on="tap:sidebar1.toggle"]'); + await verifySelectorsVisible(page, name, ['amp-sidebar[open]']); + }, }; diff --git a/test/visual-diff/visual-tests b/test/visual-diff/visual-tests index e8f3e84641cf..9af2f260c906 100644 --- a/test/visual-diff/visual-tests +++ b/test/visual-diff/visual-tests @@ -210,26 +210,25 @@ "loading_complete_selectors": ["video.i-amphtml-replaced-content"] }, { - // TODO(#27456, @ampproject/wg-ui-and-a11y): see https://percy.io/ampproject/amphtml/builds/4656426 - "flaky": true, "url": "examples/visual-tests/amp-sidebar/amp-sidebar.amp.html", "name": "amp-sidebar", "viewport": {"width": 400, "height": 800}, "interactive_tests": "examples/visual-tests/amp-sidebar/amp-sidebar.js", + "loading_incomplete_selectors": ["amp-sidebar.i-amphtml-element"] }, { "url": "examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ol.amp.html", "name": "amp-sidebar toolbar > ol", "viewport": {"width": 400, "height": 800}, "interactive_tests": "examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js", + "loading_incomplete_selectors": ["amp-sidebar.i-amphtml-element"] }, { - // TODO(#27456, @ampproject/wg-ui-and-a11y): see https://percy.io/ampproject/amphtml/builds/4637948 - "flaky": true, "url": "examples/visual-tests/amp-sidebar/amp-sidebar-toolbar-ul.amp.html", "name": "amp-sidebar toolbar > ul", "viewport": {"width": 400, "height": 800}, "interactive_tests": "examples/visual-tests/amp-sidebar/amp-sidebar-toolbar.js", + "loading_incomplete_selectors": ["amp-sidebar.i-amphtml-element"] }, { // TODO(#27455, @ampproject/wg-ads): see https://percy.io/ampproject/amphtml/builds/4672752