From 543a7c4258c2a243be6606fd25d06dcba983e57f Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Wed, 8 Jul 2026 16:13:02 +0200 Subject: [PATCH] Tests: Adapt tests to changes --- frontend/tests/acceptance/acceptance-public/photos.js | 9 +++++---- frontend/tests/acceptance/page-model/context-menu.js | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/tests/acceptance/acceptance-public/photos.js b/frontend/tests/acceptance/acceptance-public/photos.js index 0d281aafe..f96a77e1a 100644 --- a/frontend/tests/acceptance/acceptance-public/photos.js +++ b/frontend/tests/acceptance/acceptance-public/photos.js @@ -8,6 +8,8 @@ import Photo from "../page-model/photo"; import PhotoViewer from "../page-model/photoviewer"; import Page from "../page-model/page"; import PhotoEdit from "../page-model/photo-edit"; +import Notify from "../page-model/notifications"; + import { helperBeforeFixture, helperBeforeEach, helperAfterEach, logTime, logTimeEnd, logMessage } from "../page-model/helpers"; const scroll = ClientFunction((x, y) => window.scrollTo(x, y)); @@ -32,6 +34,7 @@ const photo = new Photo(); const photoviewer = new PhotoViewer(); const page = new Page(); const photoedit = new PhotoEdit(); +const notify = new Notify(); test.meta("testID", "photos-001").meta({ mode: "public" })("Common: Scroll to top", async (t) => { await t.click(toolbar.cardsViewAction); @@ -353,14 +356,13 @@ test.meta("testID", "photos-007").meta({ mode: "public" })("Common: Mark photos/ await photoedit.turnSwitchOff("scan"); await photoedit.turnSwitchOff("panorama"); await t.click(photoedit.dialogClose); - await t.wait(9000); // ToDo: is there a better way than a flat wait? if (t.browser.platform === "mobile") { await t.eval(() => location.reload()); } else { await toolbar.triggerToolbarAction("refresh"); } - + await notify.waitForPhotosToLoad(5000, true); await photo.checkPhotoVisibility(FirstPhotoUid, false); await photo.checkPhotoVisibility(FirstVideoUid, false); }); @@ -419,8 +421,7 @@ test.meta("testID", "photos-010").meta({ mode: "public" })("Common: Set location //search await t .typeText(photoedit.locationSearch, "Brandenburger Tor Berlin") - .click(Selector('div.v-autocomplete__content').find('i.mdi-map-marker')); // Wait for the drop down to be populated, and select from it -// .pressKey("enter"); // Was it important to test with the keyboard? Or is click above ok? + .click(Selector('div.v-autocomplete__content').find('i.mdi-map-marker')); const Coordinates = await photoedit.locationInput.value; await t.expect(Coordinates).eql("52.5162546, 13.3777166"); await t.expect(photoedit.locationMarker.visible).ok(); diff --git a/frontend/tests/acceptance/page-model/context-menu.js b/frontend/tests/acceptance/page-model/context-menu.js index d44b4983d..99300b2f7 100644 --- a/frontend/tests/acceptance/page-model/context-menu.js +++ b/frontend/tests/acceptance/page-model/context-menu.js @@ -1,7 +1,10 @@ import { Selector, t } from "testcafe"; export default class Page { - constructor() {} + constructor() { + // Inert dialog title used to blur the album combobox while keeping focus in the dialog. + this.albumDialogTitle = Selector("div.p-photo-album-dialog div.v-toolbar-title", { timeout: 7000 }); + } async openContextMenu() { if (!(await Selector(".action-clear").visible)) { @@ -50,9 +53,9 @@ export default class Page { // Click on the album option to select it await t .click(Selector("div").withText(name).parent('div[role="option"]')) - .click(Selector("div i.mdi-bookmark")); + .click(this.albumDialogTitle); } else { - await t.typeText(Selector(".input-albums input"), name).click(Selector("div i.mdi-bookmark")); + await t.typeText(Selector(".input-albums input"), name).click(this.albumDialogTitle); } await t.expect(Selector("span.v-chip").withText(name).visible).ok(); }