Skip to content

Commit 5d3d395

Browse files
authored
Fix playwright test 'Empty out open editors on deleted documents' (#330)
* Fix playwright test 'Empty out open editors on deleted documents' * Increase timeout
1 parent 77a78fc commit 5d3d395

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/e2e/tests/delete.spec.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
import { test, expect } from '@playwright/test';
1313
import ENV from '../utils/env.js';
14-
import { getTestPageURL, getTestResourceAge } from '../utils/page.js';
14+
import { getQuery, getTestPageURL, getTestResourceAge } from '../utils/page.js';
1515

1616
// Files are deleted after 2 hours by default
1717
const MIN_HOURS = process.env.PW_DELETE_HOURS ? Number(process.env.PW_DELETE_HOURS) : 2;
@@ -104,7 +104,7 @@ test('Empty out open editors on deleted documents', async ({ browser, page }, wo
104104
await page.close();
105105

106106
const list = await browser.newPage();
107-
await list.goto(`${ENV}/#/da-sites/da-status/tests`);
107+
await list.goto(`${ENV}/${getQuery()}#/da-sites/da-status/tests`);
108108

109109
await list.waitForTimeout(3000);
110110
await list.reload();
@@ -119,7 +119,7 @@ test('Empty out open editors on deleted documents', async ({ browser, page }, wo
119119
await list.locator('button.delete-button').locator('visible=true').click();
120120

121121
// Give the second window a chance to update itself
122-
await list.waitForTimeout(3000);
122+
await list.waitForTimeout(10000);
123123

124124
// The open window should be cleared out now
125125
await expect(page2.locator('div.ProseMirror')).not.toContainText(enteredText);

test/e2e/utils/page.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
*/
1212
import ENV from './env.js';
1313

14-
function getQuery() {
14+
export function getQuery() {
1515
const { GITHUB_HEAD_REF: branch } = process.env;
1616
if (branch === 'local') {
17-
return '?da-admin=local&da-collab=local';
17+
return '?da-admin=local&da-collab=local&da-admin-room=local';
1818
}
1919
return '';
2020
}

0 commit comments

Comments
 (0)