Skip to content

Commit

Permalink
Avoid using deprecated method waitForTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Oct 29, 2024
1 parent 3837c10 commit ab886e5
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/companion_windows.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Companion Windows', () => {
await expect(page).toFill('#manifestURL', 'http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json');
await expect(page).toClick('#fetchBtn');
await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/001.json"] button');
await page.waitForTimeout(300);
// await page.waitForTimeout(300);
await expect(page).toMatchElement('.mirador-window');
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/invalid-api-response.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe('Mirador Invalid API Response Handler Test', () => {
await page.evaluate(() => {
document.querySelector('.mirador-add-resource-button').click();
});
await page.waitForTimeout(50);
// await page.waitForTimeout(50);
await expect(page).toFill('#manifestURL', uri);

await expect(page).toClick('#fetchBtn');
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/language_switching.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Language Switching', () => {
await expect(page).toMatchElement('[aria-label="Start Here"]');
await expect(page).not.toMatchElement('[aria-label="Hier starten"]');
await expect(page).toClick('li', { text: 'Deutsch' });
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
await expect(page).not.toMatchElement('[aria-label="Start Here"]');
await expect(page).toMatchElement('[aria-label="Hier starten"]');
});
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/plugins/add.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('add two plugins to <WorkspaceControlPanelButtons>', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/add.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('all add plugins will be added to <WorkspaceControlPanelButtons>', async () => {
Expand Down
6 changes: 3 additions & 3 deletions __tests__/integration/mirador/plugins/companionWindow.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ describe('add plugins for companion windows', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/companionWindow.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('added a plugin to the window sidebar and companion window', async () => {
await expect(page).toClick('button[aria-label="Toggle sidebar"]');

await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
await expect(page).toMatchElement('.mirador-companion-window-left.mirador-window-sidebar-info-panel');
await expect(page).toMatchElement('#add-plugin-companion-window-button');

await expect(page).toClick('#add-plugin-companion-window-button');
await expect(page).toMatchElement('#add-plugin-companion-window');
});
}, 20000);
});
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/plugins/priority.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('try to apply 2 add plugins and 2 wrap plugins to <WorkspaceControlPane
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/priority.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('only apply the first wrap plugin', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/plugins/state.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('how plugins relate to state', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/state.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('plugin can read from state', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/plugins/validate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('pass valid and invalid plugins to <WorkspaceControlPanelButtons>', ()
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/validate.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('valid plugins will be applied <WorkspaceControlPanelButtons>', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/plugins/wrap.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ describe('wrap <WorkspaceControlPanelButtons> by a plugin', () => {
beforeAll(async () => {
await page.goto('http://127.0.0.1:4488/__tests__/integration/mirador/plugins/wrap.html');
await expect(page).toMatchElement('.mirador-viewer');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
});

it('wraps <WorkspaceControlPanelButtons>', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/integration/mirador/thumbnail-navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Thumbnail navigation', () => {
miradorInstance.store.getState().windows
));
expect(Object.values(windows)[0].canvasId).toBe('https://iiif.harvardartmuseums.org/manifests/object/299843/canvas/canvas-47174892'); // test harness in index.html starts at 2
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
await expect(page).toClick('.mirador-thumbnail-nav-canvas-1 img');
await expect(page).toMatchElement('.mirador-thumbnail-nav-canvas-1.mirador-current-canvas-grouping', { timeout: 1500 });
windows = await page.evaluate(() => (
Expand Down
4 changes: 2 additions & 2 deletions __tests__/integration/mirador/window_actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ describe('Window actions', () => {
await expect(page).toClick('[data-manifestid="http://127.0.0.1:4488/__tests__/fixtures/version-2/sn904cj3429.json"] button');

await expect(page).toMatchElement('.mirador-window');
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
await expect(page).toClick('.mirador-window-close');
const numWindows = await page.evaluate(page => (
document.querySelectorAll('.mirador-window').length
)); // only default configed windows found
await page.waitForTimeout(1000);
// await page.waitForTimeout(1000);
await expect(numWindows).toBe(0);
});
});

0 comments on commit ab886e5

Please sign in to comment.