Skip to content

Commit

Permalink
✅ ♻️ Reduce default e2e test timeout (#35273)
Browse files Browse the repository at this point in the history
* reduce default e2e test timeout, change timeout for offending tests
  • Loading branch information
rileyajones committed Jul 22, 2021
1 parent d6fadc0 commit 027d05c
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 14 deletions.
6 changes: 4 additions & 2 deletions build-system/tasks/e2e/describes-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ const {Builder, Capabilities, logging} = selenium;

/** Should have something in the name, otherwise nothing is shown. */
const SUB = ' ';
const TEST_TIMEOUT = 40000;
const SETUP_TIMEOUT = 30000;
const TEST_TIMEOUT = 3000;
// This can be much lower when the OSX container can be sped up allowing tests
// in extensions/amp-script/0.1/test-e2e/test-amp-script.js to run faster
const SETUP_TIMEOUT = 10000;
const SETUP_RETRIES = 3;
const DEFAULT_E2E_INITIAL_RECT = {width: 800, height: 600};
const COV_REPORT_PATH = '/coverage/client';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ describes.endtoend(
// TODO(sparhami): fails on shadow demo
it.configure()
.skipShadowDemo()
.run('should move forwards', async () => {
.run('should move forwards', async function () {
this.timeout(10000);
const slides = await getSlides(controller);

await expect(rect(slides[1])).to.include({x: 0});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ describes.endtoend(
prevArrow = await getPrevArrow(controller);
});

it('should not go forward past end and it should be able to go back correctly', async () => {
it('should not go forward past end and it should be able to go back correctly', async function () {
this.timeout(10000);
const slideCount = 7;
const slidesInView = 3;
const slides = await getSlides(controller);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ describes.endtoend(
controller = env.controller;
});

it('should fire low trust event for autoplay advance', async () => {
it('should fire low trust event for autoplay advance', async function () {
this.timeout(5000);
for (let i = 0; i < 3; i++) {
const event = await slideChangeEventAfterClicking(/* autoplay */);
await expect(event.actionTrust).to.equal(1); // ActionTrust.LOW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describes.endtoend(
controller = env.controller;
});

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describes.endtoend(
controller = env.controller;
});

it('should respect server side decision and clear on next visit', async () => {
it('should respect server side decision and clear on next visit', async function () {
this.timeout(10000);
resetAllElements();
const currentUrl = await controller.getCurrentUrl();
const nextGeoUrl = currentUrl.replace('mx', 'ca');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ describes.endtoend(
controller = env.controller;
});

it('should respect server side decision and persist it', async () => {
it('should respect server side decision and persist it', async function () {
this.timeout(5000);
resetAllElements();

const currentUrl = await controller.getCurrentUrl();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ describes.endtoend(
controller = env.controller;
});

it('should restrict fullscreen until user interaction', async () => {
it('should restrict fullscreen until user interaction', async function () {
this.timeout(10000);
// Await the CMP to load
await sleep(3000);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ describes.endtoend(

describe('without allow-blocked-end-date', () => {
const ID = 'disallow-blocked';
it('should NOT be able to select the first blocked date', async () => {
it('should NOT be able to select the first blocked date', async function () {
this.timeout(5000);
const today = new Date();
const nextWeek = new Date(new Date().setDate(today.getDate() + 7));
const todayCell = await selectDate(controller, ID, today);
Expand Down
3 changes: 2 additions & 1 deletion extensions/amp-script/0.1/test-e2e/test-amp-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ describes.endtoend(
controller = env.controller;
});

it('should support local scripts', async () => {
it('should support local scripts', async function () {
this.timeout(10000);
const element = await controller.findElement('amp-script#local');
await expect(controller.getElementAttribute(element, 'class')).to.contain(
'i-amphtml-hydrated'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ describes.endtoend(
});

// TODO(#35241): flaky test disabled in #35176
it.skip('should render correctly', async () => {
it.skip('should render correctly', async function () {
this.timeout(10000);
await clickThroughPages(controller, /* numPages */ 7);
const activePage = await controller.findElement('[active]');
await expect(controller.getElementAttribute(activePage, 'ad')).to.exist;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ describes.endtoend(
await expect(storyEl).to.exist;
});

it('when player becomes visible in viewport and first story finishes loading, second story starts preloading', async () => {
it('when player becomes visible in viewport and first story finishes loading, second story starts preloading', async function () {
this.timeout(10000);
const doc = await controller.getDocumentElement();
const playerRect = await controller.getElementRect(player);

Expand Down
3 changes: 2 additions & 1 deletion test/e2e/test-amp-story-player-prerender.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ describes.endtoend(
await expect(storyEl).to.exist;
});

it('when player becomes visible in viewport and first story finishes loading, second story starts preloading', async () => {
it('when player becomes visible in viewport and first story finishes loading, second story starts preloading', async function () {
this.timeout(10000);
const doc = await controller.getDocumentElement();
const playerRect = await controller.getElementRect(player);

Expand Down

0 comments on commit 027d05c

Please sign in to comment.