Skip to content

Commit

Permalink
Unskip amp-consent e2e test (#27662)
Browse files Browse the repository at this point in the history
* test

* lint

* skip another flaky test

* revert promise

* unskip carousel test

* add promise

* use sleep()

* import

* 3sec
  • Loading branch information
zhouyx committed Apr 17, 2020
1 parent 8f47762 commit 503f321
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Expand Up @@ -20,6 +20,7 @@ import {
verifyElementsBuilt,
verifyPromptsHidden,
} from './common';
import sleep from 'sleep-promise';

describes.endtoend(
'amp-consent',
Expand All @@ -36,7 +37,7 @@ describes.endtoend(
controller = env.controller;
});

it.skip('should work with client side decision', async () => {
it('should work with client side decision', async () => {
resetAllElements();
const currentUrl = await controller.getCurrentUrl();

Expand Down Expand Up @@ -95,7 +96,9 @@ describes.endtoend(
'postPromptUi': false,
});

// Check the analytics request consentState
// Check the analytics request consentState. Wait for 1 second for the
// request to arrive to avoid flaky test.
await sleep(3000);
await expect(
'http://localhost:8000/amp4test/request-bank/e2e/deposit/tracking?consentState=sufficient'
).to.have.been.sent;
Expand Down
Expand Up @@ -20,6 +20,7 @@ import {
verifyElementsBuilt,
verifyPromptsHidden,
} from './common';
import sleep from 'sleep-promise';

describes.endtoend(
'amp-consent',
Expand All @@ -36,8 +37,7 @@ describes.endtoend(
controller = env.controller;
});

//TODO (micajuineho): Unskip flaky test
it.skip('should respect server side decision and persist it', async () => {
it('should respect server side decision and persist it', async () => {
resetAllElements();

const currentUrl = await controller.getCurrentUrl();
Expand Down Expand Up @@ -79,7 +79,9 @@ describes.endtoend(
'postPromptUi': false,
});

// Check the analytics request consentState
// Check the analytics request consentState. Wait for 1 second for the
// request to arrive to avoid flaky test.
await sleep(3000);
await expect(
'http://localhost:8000/amp4test/request-bank/e2e/deposit/tracking?consentState=insufficient'
).to.have.been.sent;
Expand Down

0 comments on commit 503f321

Please sign in to comment.