From 552ea54ea53d9f6df26c023f65eb04a8c4bb69f6 Mon Sep 17 00:00:00 2001 From: Drini Cami Date: Fri, 31 Jan 2025 20:41:29 -0500 Subject: [PATCH] Make autoplay e2e test faster + more reliable by configuring flip speed/delay --- tests/e2e/autoplay.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/autoplay.test.js b/tests/e2e/autoplay.test.js index 6f4583b2d..dcae1ab3e 100644 --- a/tests/e2e/autoplay.test.js +++ b/tests/e2e/autoplay.test.js @@ -2,12 +2,12 @@ import { ClientFunction } from 'testcafe'; import params from './helpers/params'; const getLocationHref = ClientFunction(() => window.location.href.toString()); -const FLIP_SPEED = 2000; -const FIRST_PAGE_DELAY = 6000; +const FLIP_SPEED = 200; +const FLIP_DELAY = 500; -fixture `Autoplay plugin`.page `${params.baseUrl}/BookReaderDemo/demo-internetarchive.html?ocaid=goody&autoflip=1`; +fixture `Autoplay plugin`.page `${params.baseUrl}/BookReaderDemo/demo-internetarchive.html?ocaid=goody&autoflip=1&flipSpeed=${FLIP_SPEED}&flipDelay=${FLIP_DELAY}`; -test('page auto-advances after allotted flip speed and delay', async t => { - await t.wait(2 * FLIP_SPEED + FIRST_PAGE_DELAY); +test.only('page auto-advances after allotted flip speed and delay', async t => { + await t.wait(2 * FLIP_SPEED + FLIP_DELAY + 500); await t.expect(getLocationHref()).match(/page\/n3/); });