Skip to content

Commit 4aae428

Browse files
authored
fix: update test suite selectors for PCUI migration (#1964)
* fix: update project dialog close button selector for PCUI migration * fix: align root docker-compose with CI workflow and Dockerfile expectations * fix: update selectors for merge and checkpoint operations in version control tests * fix: dismiss dialog after download and publish actions in test suite * fix: remove redundant dialog dismissal in publish/download tests
1 parent e75ec29 commit 4aae428

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

docker-compose.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
services:
22
test-suite:
33
build: ./test-suite
4-
image: playcanvas/editor-test:latest
5-
container_name: test-suite
6-
env_file:
7-
- .env
8-
volumes:
9-
- ./test-suite/.auth:/usr/src/test/.auth
4+
image: ghcr.io/playcanvas/editor/test:latest
5+
command: "true"
106

117
playcanvas-editor:
128
build: .
139
container_name: playcanvas-editor
10+
depends_on:
11+
test-suite:
12+
condition: service_completed_successfully
1413
env_file:
1514
- .env
15+
environment:
16+
- PC_LOCAL_FRONTEND=true
1617
volumes:
18+
- ./test-suite/.auth:/usr/src/test/.auth
1719
- ./test-results:/usr/src/test/test-results

test-suite/test/ui/basic.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ test.describe('export/import', () => {
111111
test.setTimeout(4 * 60 * 1000);
112112
expect(await capture('import-project', page, async () => {
113113
// close project dialog
114-
await page.getByText('').click();
114+
const close = page.locator('.picker-project .close');
115+
await close.waitFor({ state: 'visible' });
116+
await close.click();
115117

116118
// import project
117119
const fileChooserPromise = page.waitForEvent('filechooser');
@@ -335,6 +337,9 @@ test.describe('publish/download', () => {
335337
await page.getByText('Download', { exact: true }).nth(2).click();
336338
await downloadPagePromise;
337339
await downloadPromise;
340+
341+
// dismiss dialog
342+
await page.locator('.picker-project .close').first().click();
338343
})).toStrictEqual([]);
339344
});
340345

test-suite/test/ui/version-control.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ test.describe('branch/checkpoint/diff/merge', () => {
173173
await page.locator(`#checkpoint-${mainCheckpointId} .ui-checkbox.tick`).click();
174174

175175
// compare
176-
await page.locator('.ui-button.compare:not(.disabled)').click();
176+
await page.locator('.pcui-button.compare:not(.pcui-disabled)').click();
177177

178178
// wait for diff to load
179179
await page.waitForSelector('.picker-conflict-manager.diff');
@@ -207,10 +207,10 @@ test.describe('branch/checkpoint/diff/merge', () => {
207207
await page.getByText('Merge Into Current Branch').click();
208208

209209
// uncheck checkpoint create
210-
await page.locator('div:nth-child(3) > div > div:nth-child(2) > .content > .ui-checkbox').click();
210+
await page.locator('.merge-branches .version-control-side-panel-box:last-child .checkpoint-checkbox .tick').click();
211211

212212
// check close branch
213-
await page.locator('div:nth-child(3) > .content > .ui-checkbox').first().click();
213+
await page.locator('.merge-branches .checkpoint-checkbox').filter({ hasText: 'Close branch' }).locator('.tick').click();
214214

215215
// create merge
216216
await page.getByText('START MERGE').click();
@@ -244,7 +244,7 @@ test.describe('branch/checkpoint/diff/merge', () => {
244244
await page.getByText('Merge Into Current Branch').click();
245245

246246
// uncheck checkpoint create
247-
await page.locator('div:nth-child(3) > div > div:nth-child(2) > .content > .ui-checkbox').click();
247+
await page.locator('.merge-branches .version-control-side-panel-box:last-child .checkpoint-checkbox .tick').click();
248248

249249
// create merge
250250
await page.getByText('START MERGE').click();
@@ -304,7 +304,7 @@ test.describe('branch/checkpoint/diff/merge', () => {
304304
await page.locator('.pcui-menu-item').filter({ hasText: /^Restore$/ }).first().click();
305305

306306
// uncheck checkpoint create
307-
await page.locator('.content > div:nth-child(2) > .content > .ui-checkbox').first().click();
307+
await page.locator('.restore-checkpoint .checkpoint-checkbox .tick').click();
308308

309309
// restore checkpoint
310310
await page.getByText('Restore Checkpoint', { exact: true }).click();

0 commit comments

Comments
 (0)