Tests: Improve acceptance tests

This commit is contained in:
Theresa Gresch 2026-06-18 11:30:50 +02:00
parent 790181a743
commit acb04f2a05
5 changed files with 36 additions and 19 deletions

View file

@ -273,6 +273,9 @@ test.meta("testID", "settings-general-003").meta({ type: "short", mode: "auth" }
);
test.meta("testID", "settings-general-004").meta({ type: "short", mode: "auth" })("Common: Disable people and labels", async (t) => {
//Use photo with all kinds of metadata
await toolbar.search("filename:Images/albums-002_3.jpg");
await notifies.waitForSearchToFinish(7000);
await t.click(toolbar.cardsViewAction);
await t.click(page.cardTitle.nth(0));
await t.click(photoedit.labelsTab);
@ -297,9 +300,12 @@ test.meta("testID", "settings-general-004").meta({ type: "short", mode: "auth" }
// `.meta-faces-edit` (edit-mode discriminator); `markersEditToggle` is the
// compound selector that only matches the pencil variant.
await t.expect(photoviewer.markersEditToggle.exists).ok();
await t.expect(photoviewer.sidebarLabels.exists).ok();
await photoviewer.triggerPhotoViewerAction("close-button");
await photo.toggleSelectNthPhoto(0, "image");
await t.click(toolbar.searchClearAction);
await notifies.waitForSearchToFinish(7000);
await photo.toggleSelectNthPhoto(1, "image");
await contextmenu.triggerContextMenuAction("edit");
@ -315,6 +321,9 @@ test.meta("testID", "settings-general-004").meta({ type: "short", mode: "auth" }
await t.click(settings.peopleCheckbox).click(settings.labelsCheckbox);
await t.eval(() => location.reload());
await menu.openPage("browse");
//Use photo with all kinds of metadata
await toolbar.search("filename:Images/albums-002_3.jpg");
await notifies.waitForSearchToFinish(7000);
await t.click(toolbar.cardsViewAction);
await t.click(page.cardTitle.nth(0));
await t.click(photoedit.labelsTab);
@ -335,9 +344,12 @@ test.meta("testID", "settings-general-004").meta({ type: "short", mode: "auth" }
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("People").exists).notOk();
await t.expect(photoviewer.markersVisibilityToggle.exists).notOk();
await t.expect(photoviewer.markersEditToggle.exists).notOk();
await t.expect(photoviewer.sidebarLabels.exists).notOk();
await photoviewer.triggerPhotoViewerAction("close-button");
await photo.toggleSelectNthPhoto(0, "image");
await t.click(toolbar.searchClearAction);
await notifies.waitForSearchToFinish(7000);
await photo.toggleSelectNthPhoto(1, "image");
await contextmenu.triggerContextMenuAction("edit");
@ -474,7 +486,9 @@ test.meta("testID", "settings-general-006").meta({ type: "short", mode: "auth" }
await t.click(photoedit.dialogClose);
await contextmenu.clearSelection();
await toolbar.search("photo:true");
//Use photo with all kinds of metadata
await toolbar.search("filename:Images/albums-002_3.jpg");
await notifies.waitForSearchToFinish(7000);
await photoviewer.openPhotoViewer("nth", 0);
await photoviewer.checkPhotoViewerActionAvailability("download", true);
@ -571,7 +585,9 @@ test.meta("testID", "settings-general-006").meta({ type: "short", mode: "auth" }
await contextmenu.clearSelection();
await t.click(toolbar.cardsViewAction);
await toolbar.search("photo:true");
//Use photo with all kinds of metadata
await toolbar.search("filename:Images/albums-002_3.jpg");
await notifies.waitForSearchToFinish(7000);
await photoviewer.openPhotoViewer("nth", 0);
await photoviewer.checkPhotoViewerActionAvailability("download", false);
await photoviewer.checkPhotoViewerActionAvailability("edit-button", false);
@ -579,7 +595,7 @@ test.meta("testID", "settings-general-006").meta({ type: "short", mode: "auth" }
await photoviewer.openSidebar();
// The first non-stacked photo has Title + Labels + Albums but no Caption or People;
// the Filmpreis-anchored block below covers the People positive case.
await photoviewer.assertSidebarIsReadOnly({ expectCaption: false, expectPeople: false });
await photoviewer.assertSidebarIsReadOnly();
await photoviewer.triggerPhotoViewerAction("close-button");
await t.expect(Selector("div.p-lightbox__pswp").visible).notOk();

View file

@ -200,22 +200,21 @@ test.meta("testID", "sharing-002").meta({ type: "short", mode: "auth" })("Multi-
test.meta("testID", "sharing-003").meta({ type: "short", mode: "auth" })("Common: Lightbox sidebar shows only restricted metadata on share links", async (t) => {
await t.useRole(Role.anonymous());
await t.navigateTo("http://localhost:2343/s/jxoux5ub1e/british-columbia-canada");
await t.expect(toolbar.toolbarSecondTitle.withText("British Columbia").visible).ok();
await t.navigateTo("http://localhost:2343/s/2t6124pb6d/holiday");
await t.expect(toolbar.toolbarSecondTitle.withText("Holiday").visible).ok();
await photoviewer.openPhotoViewer("nth", 0);
await photoviewer.openPhotoViewer("nth", 1);
await photoviewer.openSidebar();
await t.expect(photoviewer.sidebarRow("mdi-calendar").exists).ok();
// The visitor share-link photo carries a Title but no Caption.
await photoviewer.assertSidebarIsReadOnly({ restricted: true, expectCaption: false });
await photoviewer.assertSidebarIsReadOnly({ restricted: true});
// Merged file row renders for restricted sessions (type + size as
// the title) but the filename subtitle must be suppressed.
await t.expect(Selector(".p-lightbox-sidebar .meta-file .v-list-item-subtitle").exists).notOk();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("People").exists).notOk();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("Labels").exists).notOk();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("Albums").exists).notOk();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("Albums").exists).ok();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("Keywords").exists).notOk();
await t.expect(Selector(".p-lightbox-sidebar .text-subtitle-2").withText("Notes").exists).notOk();

View file

@ -10,16 +10,16 @@ import AlbumDialog from "../page-model/dialog-album";
import { helperBeforeFixture, helperBeforeEach, helperAfterEach } from "../page-model/helpers";
fixture`Test moments`
.page`${testcafeconfig.url}`
.beforeEach(async t => {
await helperBeforeEach(t);
})
.afterEach(async t => {
await helperAfterEach(t);
})
.before(async ctx => {
await helperBeforeFixture(ctx);
});
.page`${testcafeconfig.url}`
.beforeEach(async t => {
await helperBeforeEach(t);
})
.afterEach(async t => {
await helperAfterEach(t);
})
.before(async ctx => {
await helperBeforeFixture(ctx);
});
const menu = new Menu();
const album = new Album();

View file

@ -48,6 +48,7 @@ export default class Page {
this.sidebarKeywords = Selector(".p-lightbox-sidebar .meta-keywords", { timeout: 15000 });
this.sidebarNotes = Selector(".p-lightbox-sidebar .meta-notes", { timeout: 15000 });
this.sidebarChips = Selector(".p-lightbox-sidebar .meta-chip", { timeout: 15000 });
this.sidebarLabels = Selector(".p-lightbox-sidebar .v-list-item.meta-labels", { timeout: 15000 });
this.faceMarkerClearSubjectButton = Selector(".metadata__person-row .meta-marker-clear-subject", { timeout: 15000 });
this.faceMarkerNameInput = Selector(".metadata__person-row .meta-inline-marker input", { timeout: 15000 });
this.peopleHeader = Selector(".p-lightbox-sidebar .text-subtitle-2").withText("People");

View file

@ -16,6 +16,7 @@ export default class Page {
this.cardsViewAction = Selector("button.action-view-cards");
this.mosaicViewAction = Selector("button.action-view-mosaic");
this.listViewAction = Selector("button.action-view-list");
this.searchClearAction = Selector("div.input-search .v-field__clearable", { timeout: 7000 });
}
async checkToolbarActionAvailability(action, visible) {