Skip to content

Commit

Permalink
Fix ommissions in Playwright tests for local running
Browse files Browse the repository at this point in the history
  • Loading branch information
bosschaert committed Jan 7, 2025
1 parent 1d12837 commit ac9d015
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/e2e/tests/delete.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
import { test, expect } from '@playwright/test';
import ENV from '../utils/env.js';
import { getTestPageURL, getTestResourceAge } from '../utils/page.js';
import { getQuery, getTestPageURL, getTestResourceAge } from '../utils/page.js';

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

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

await list.waitForTimeout(3000);
await list.reload();
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/tests/edit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
import { test, expect } from '@playwright/test';
import ENV from '../utils/env.js';
import { getTestPageURL } from '../utils/page.js';
import { getQuery, getTestPageURL } from '../utils/page.js';

test('Update Document', async ({ browser, page }, workerInfo) => {
test.setTimeout(30000);
Expand Down Expand Up @@ -40,7 +40,7 @@ test('Create Delete Document', async ({ browser, page }, workerInfo) => {
const url = getTestPageURL('edit2', workerInfo);
const pageName = url.split('/').pop();

await page.goto(`${ENV}/#/da-sites/da-status/tests`);
await page.goto(`${ENV}/${getQuery()}#/da-sites/da-status/tests`);
await page.locator('button.da-actions-new-button').click();
await page.locator('button:text("Document")').click();
await page.locator('input.da-actions-input').fill(pageName);
Expand All @@ -51,7 +51,7 @@ test('Create Delete Document', async ({ browser, page }, workerInfo) => {
await page.waitForTimeout(1000);

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

await newPage.waitForTimeout(3000);
await newPage.reload();
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/utils/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
import ENV from './env.js';

function getQuery() {
export function getQuery() {
const { GITHUB_HEAD_REF: branch } = process.env;
if (branch === 'local') {
return '?da-admin=local&da-collab=local';
Expand Down

0 comments on commit ac9d015

Please sign in to comment.