Skip to content

Commit 543a7c4

Browse files
committed
Tests: Adapt tests to changes
1 parent 4acbfd3 commit 543a7c4

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

frontend/tests/acceptance/acceptance-public/photos.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import Photo from "../page-model/photo";
88
import PhotoViewer from "../page-model/photoviewer";
99
import Page from "../page-model/page";
1010
import PhotoEdit from "../page-model/photo-edit";
11+
import Notify from "../page-model/notifications";
12+
1113
import { helperBeforeFixture, helperBeforeEach, helperAfterEach, logTime, logTimeEnd, logMessage } from "../page-model/helpers";
1214

1315
const scroll = ClientFunction((x, y) => window.scrollTo(x, y));
@@ -32,6 +34,7 @@ const photo = new Photo();
3234
const photoviewer = new PhotoViewer();
3335
const page = new Page();
3436
const photoedit = new PhotoEdit();
37+
const notify = new Notify();
3538

3639
test.meta("testID", "photos-001").meta({ mode: "public" })("Common: Scroll to top", async (t) => {
3740
await t.click(toolbar.cardsViewAction);
@@ -353,14 +356,13 @@ test.meta("testID", "photos-007").meta({ mode: "public" })("Common: Mark photos/
353356
await photoedit.turnSwitchOff("scan");
354357
await photoedit.turnSwitchOff("panorama");
355358
await t.click(photoedit.dialogClose);
356-
await t.wait(9000); // ToDo: is there a better way than a flat wait?
357359

358360
if (t.browser.platform === "mobile") {
359361
await t.eval(() => location.reload());
360362
} else {
361363
await toolbar.triggerToolbarAction("refresh");
362364
}
363-
365+
await notify.waitForPhotosToLoad(5000, true);
364366
await photo.checkPhotoVisibility(FirstPhotoUid, false);
365367
await photo.checkPhotoVisibility(FirstVideoUid, false);
366368
});
@@ -419,8 +421,7 @@ test.meta("testID", "photos-010").meta({ mode: "public" })("Common: Set location
419421
//search
420422
await t
421423
.typeText(photoedit.locationSearch, "Brandenburger Tor Berlin")
422-
.click(Selector('div.v-autocomplete__content').find('i.mdi-map-marker')); // Wait for the drop down to be populated, and select from it
423-
// .pressKey("enter"); // Was it important to test with the keyboard? Or is click above ok?
424+
.click(Selector('div.v-autocomplete__content').find('i.mdi-map-marker'));
424425
const Coordinates = await photoedit.locationInput.value;
425426
await t.expect(Coordinates).eql("52.5162546, 13.3777166");
426427
await t.expect(photoedit.locationMarker.visible).ok();

frontend/tests/acceptance/page-model/context-menu.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { Selector, t } from "testcafe";
22

33
export default class Page {
4-
constructor() {}
4+
constructor() {
5+
// Inert dialog title used to blur the album combobox while keeping focus in the dialog.
6+
this.albumDialogTitle = Selector("div.p-photo-album-dialog div.v-toolbar-title", { timeout: 7000 });
7+
}
58

69
async openContextMenu() {
710
if (!(await Selector(".action-clear").visible)) {
@@ -50,9 +53,9 @@ export default class Page {
5053
// Click on the album option to select it
5154
await t
5255
.click(Selector("div").withText(name).parent('div[role="option"]'))
53-
.click(Selector("div i.mdi-bookmark"));
56+
.click(this.albumDialogTitle);
5457
} else {
55-
await t.typeText(Selector(".input-albums input"), name).click(Selector("div i.mdi-bookmark"));
58+
await t.typeText(Selector(".input-albums input"), name).click(this.albumDialogTitle);
5659
}
5760
await t.expect(Selector("span.v-chip").withText(name).visible).ok();
5861
}

0 commit comments

Comments
 (0)