Skip to content

amp-consent fullscreen interaction e2e#26584

Merged
micajuine-ho merged 18 commits intoampproject:masterfrom
micajuine-ho:amp-consent-fullscreen-e2e
Jul 27, 2020
Merged

amp-consent fullscreen interaction e2e#26584
micajuine-ho merged 18 commits intoampproject:masterfrom
micajuine-ho:amp-consent-fullscreen-e2e

Conversation

@micajuine-ho
Copy link
Copy Markdown
Contributor

@micajuine-ho micajuine-ho commented Jan 31, 2020

Last task of #26432

Created an e2e test to test the fullscreen signal and interaction.

Changes:

  • Created new _test_ CMP (only available in test/dev mode) that points at the new .html file for the promptUiSrc
    • Access _test_ CMP in the e2e test by declaring __AMP_TEST = true in fullscreen-cmp.html
  • Minor change to diy-consent.html for clarity

Notes:

  • Created new test fixtures (including the new test CMP) instead of reusing example pages (and ping), so that we can have more control over what we test in the future
  • In the e2e test, we are currently waiting 3s for the prompt to load, and 1 sec for the fullscreen signal and class to be applied. This seems to be working fine on Travis but might need to increase the sleep to avoid flakiness

Copy link
Copy Markdown
Contributor

@zhouyx zhouyx left a comment

Choose a reason for hiding this comment

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

Does the PR only add e2e test? Or it also implements the logic? Asking because I thought the real implementation is covered by a different PR.


parent.postMessage(readyObject, '*');
}, 2500);
}, 500);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: why attempting to set fullscreen every 500ms?

@micajuine-ho micajuine-ho force-pushed the amp-consent-fullscreen-e2e branch from ea05343 to b9cae21 Compare March 2, 2020 22:46
@mrjoro
Copy link
Copy Markdown
Member

mrjoro commented Jun 12, 2020

Is this PR still active?

@micajuine-ho micajuine-ho changed the title amp-consent fullscreen e2e [WIP] amp-consent fullscreen e2e Jul 20, 2020
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 20, 2020

This pull request introduces 1 alert when merging 4ec66d7 into 69320ba - view on LGTM.com

new alerts:

  • 1 for Useless assignment to property

@micajuine-ho micajuine-ho force-pushed the amp-consent-fullscreen-e2e branch 2 times, most recently from 140a77f to e06b0bd Compare July 21, 2020 21:34
@micajuine-ho micajuine-ho force-pushed the amp-consent-fullscreen-e2e branch from e06b0bd to 726fdf9 Compare July 21, 2020 21:45
@micajuine-ho micajuine-ho requested a review from zhouyx July 21, 2020 21:45
@micajuine-ho micajuine-ho changed the title [WIP] amp-consent fullscreen e2e amp-consent fullscreen interaction e2e Jul 21, 2020
CMP_CONFIG['_test_'] = {
'consentInstanceId': '_test_',
'checkConsentHref': '/get-consent-v1?cid=CLIENT_ID&pid=PAGE_VIEW_ID',
'promptUISrc': '/test/fixtures/served/cmp-iframe.html',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could we override the promptUISrc with inline config, and get rid of either _ping_ or _test_

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ahh yes, good point.

@@ -0,0 +1,68 @@
/**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if you want to add additional UI test here. For example the lightbox mode. If so I might rename the file.
But that can also be a visual diff test. So your call

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like the idea of doing more e2e tests, so I'll change the file name.

@micajuine-ho micajuine-ho force-pushed the amp-consent-fullscreen-e2e branch from ddac21a to 9f344b8 Compare July 24, 2020 18:45
@micajuine-ho micajuine-ho merged commit 9e5f0bf into ampproject:master Jul 27, 2020
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.

5 participants