Tests: Improve acceptance tests to be more stable

This commit is contained in:
graciousgrey
2025-11-28 10:32:00 +01:00
parent d19c70e8e7
commit 75515d3653
6 changed files with 245 additions and 282 deletions

View File

@@ -55,7 +55,7 @@ test.meta("testID", "sharing-001").meta({ mode: "auth" })("Common: Create, view,
.click(sharedialog.linkExpireInput) .click(sharedialog.linkExpireInput)
.click(Selector("div").withText("After 1 day").parent('div[role="option"]')) .click(Selector("div").withText("After 1 day").parent('div[role="option"]'))
.click(sharedialog.dialogSave) .click(sharedialog.dialogSave)
.click(sharedialog.dialogSave); .click(sharedialog.dialogClose);
await contextmenu.clearSelection(); await contextmenu.clearSelection();
await t.navigateTo(url); await t.navigateTo(url);
@@ -136,71 +136,64 @@ test.meta("testID", "sharing-001").meta({ mode: "auth" })("Common: Create, view,
.ok(); .ok();
}); });
test.meta("testID", "sharing-002").meta({ type: "short", mode: "auth" })( test.meta("testID", "sharing-002").meta({ type: "short", mode: "auth" })("Multi-Window: Verify visitor role has limited permissions", async (t) => {
"Multi-Window: Verify visitor role has limited permissions", await t.navigateTo("http://localhost:2343/s/jxoux5ub1e/british-columbia-canada");
async (t) => { await t.expect(toolbar.toolbarSecondTitle.withText("British Columbia").visible).ok();
await t.navigateTo("http://localhost:2343/s/jxoux5ub1e/british-columbia-canada");
await t.expect(toolbar.toolbarSecondTitle.withText("British Columbia").visible).ok();
await toolbar.checkToolbarActionAvailability("edit", false); await toolbar.checkToolbarActionAvailability("edit", false);
await toolbar.checkToolbarActionAvailability("share", false); await toolbar.checkToolbarActionAvailability("share", false);
await toolbar.checkToolbarActionAvailability("upload", false); await toolbar.checkToolbarActionAvailability("upload", false);
await toolbar.checkToolbarActionAvailability("refresh", true); await toolbar.checkToolbarActionAvailability("refresh", true);
await toolbar.checkToolbarActionAvailability("download", true); await toolbar.checkToolbarActionAvailability("download", true);
await photo.triggerHoverAction("nth", 0, "select"); await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.checkContextMenuActionAvailability("download", true); await contextmenu.checkContextMenuActionAvailability("download", true);
await contextmenu.checkContextMenuActionAvailability("archive", false); await contextmenu.checkContextMenuActionAvailability("archive", false);
await contextmenu.checkContextMenuActionAvailability("private", false); await contextmenu.checkContextMenuActionAvailability("private", false);
await contextmenu.checkContextMenuActionAvailability("edit", false); await contextmenu.checkContextMenuActionAvailability("edit", false);
await contextmenu.checkContextMenuActionAvailability("share", false); await contextmenu.checkContextMenuActionAvailability("share", false);
await contextmenu.checkContextMenuActionAvailability("album", false); await contextmenu.checkContextMenuActionAvailability("album", false);
await contextmenu.clearSelection(); await contextmenu.clearSelection();
await photoviewer.openPhotoViewer("nth", 0); await photoviewer.openPhotoViewer("nth", 0);
await photoviewer.checkPhotoViewerActionAvailability("download", true); await photoviewer.checkPhotoViewerActionAvailability("download", true);
await photoviewer.checkPhotoViewerActionAvailability("select-toggle", true); await photoviewer.checkPhotoViewerActionAvailability("select-toggle", true);
await photoviewer.checkPhotoViewerActionAvailability("fullscreen-toggle", true); await photoviewer.checkPhotoViewerActionAvailability("fullscreen-toggle", true);
await photoviewer.checkPhotoViewerActionAvailability("slideshow-toggle", true); await photoviewer.checkPhotoViewerActionAvailability("slideshow-toggle", true);
await photoviewer.checkPhotoViewerActionAvailability("favorite-toggle", false); await photoviewer.checkPhotoViewerActionAvailability("favorite-toggle", false);
await photoviewer.checkPhotoViewerActionAvailability("edit-button", false); await photoviewer.checkPhotoViewerActionAvailability("edit-button", false);
await photoviewer.triggerPhotoViewerAction("close-button"); await photoviewer.triggerPhotoViewerAction("close-button");
await t.expect(Selector("div.p-lightbox__pswp").visible).notOk(); await t.expect(Selector("div.p-lightbox__pswp").visible).notOk();
await photo.checkHoverActionAvailability("nth", 0, "favorite", false); await photo.checkHoverActionAvailability("nth", 0, "favorite", false);
await photo.checkHoverActionAvailability("nth", 0, "select", true); await photo.checkHoverActionAvailability("nth", 0, "select", true);
await toolbar.triggerToolbarAction("view-list"); await toolbar.triggerToolbarAction("view-list");
await t await t.expect(Selector(`td button.input-private`).visible).notOk().expect(Selector(`td button.input-favorite`).visible).notOk();
.expect(Selector(`td button.input-private`).visible) await toolbar.triggerToolbarAction("view-mosaic");
.notOk() await toolbar.triggerToolbarAction("view-cards");
.expect(Selector(`td button.input-favorite`).visible) await t.click(page.cardLocation.nth(0));
.notOk(); await t.expect(places.placesSearch.visible).notOk();
await toolbar.triggerToolbarAction("view-mosaic"); await t.expect(Selector('div[title="Cape / Bowen Island / 2019"]').visible).ok();
await toolbar.triggerToolbarAction("view-cards"); await t.click(places.zoomOut).click(places.zoomOut).click(places.zoomOut).click(places.zoomOut);
await t.click(page.cardLocation.nth(0)); await t.click(Selector("div.cluster-marker"));
await t.expect(places.placesSearch.visible).notOk(); await t.expect(places.openClusterInSearch.visible).notOk();
await t.expect(Selector('div[title="Cape / Bowen Island / 2019"]').visible).ok(); await t.expect(places.closeCluster.visible).ok();
await t.click(places.zoomOut).click(places.zoomOut).click(places.zoomOut).click(places.zoomOut);
await t.click(Selector("div.cluster-marker"));
await t.expect(places.openClusterInSearch.visible).notOk();
await t.expect(places.closeCluster.visible).ok();
await t.navigateTo("/library/states"); await t.navigateTo("/library/states");
const AlbumUid = await album.getNthAlbumUid("all", 0); const AlbumUid = await album.getNthAlbumUid("all", 0);
await album.triggerHoverAction("uid", AlbumUid, "select"); await album.triggerHoverAction("uid", AlbumUid, "select");
await contextmenu.checkContextMenuActionAvailability("download", true); await contextmenu.checkContextMenuActionAvailability("download", true);
await contextmenu.checkContextMenuActionAvailability("delete", false); await contextmenu.checkContextMenuActionAvailability("delete", false);
await contextmenu.checkContextMenuActionAvailability("album", false); await contextmenu.checkContextMenuActionAvailability("album", false);
await contextmenu.checkContextMenuActionAvailability("edit", false); await contextmenu.checkContextMenuActionAvailability("edit", false);
await contextmenu.checkContextMenuActionAvailability("share", false); await contextmenu.checkContextMenuActionAvailability("share", false);
await contextmenu.clearSelection(); await contextmenu.clearSelection();
} });
);

View File

@@ -24,86 +24,81 @@ const albumdialog = new AlbumDialog();
const photoedit = new PhotoEdit(); const photoedit = new PhotoEdit();
const notifies = new Notifies(); const notifies = new Notifies();
test.meta("testID", "albums-001").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-001").meta({ type: "short", mode: "public" })("Common: Create/delete album on /albums", async (t) => {
"Common: Create/delete album on /albums", await menu.openPage("albums");
async (t) => { const AlbumCount = await album.getAlbumCount("all");
await menu.openPage("albums"); await toolbar.triggerToolbarAction("add");
const AlbumCount = await album.getAlbumCount("all"); const AlbumCountAfterCreate = await album.getAlbumCount("all");
await toolbar.triggerToolbarAction("add"); const NewAlbumUid = await album.getNthAlbumUid("all", 0);
const AlbumCountAfterCreate = await album.getAlbumCount("all");
const NewAlbumUid = await album.getNthAlbumUid("all", 0);
await t.expect(AlbumCountAfterCreate).eql(AlbumCount + 1); await t.expect(AlbumCountAfterCreate).eql(AlbumCount + 1);
await album.selectAlbumFromUID(NewAlbumUid); await album.selectAlbumFromUID(NewAlbumUid);
await contextmenu.triggerContextMenuAction("delete", ""); await contextmenu.triggerContextMenuAction("delete", "");
const AlbumCountAfterDelete = await album.getAlbumCount("all"); const AlbumCountAfterDelete = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterDelete).eql(AlbumCountAfterCreate - 1); await t.expect(AlbumCountAfterDelete).eql(AlbumCountAfterCreate - 1);
} });
);
test.meta("testID", "albums-002").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-002").meta({ type: "short", mode: "public" })("Common: Create/delete album during add to album", async (t) => {
"Common: Create/delete album during add to album", await menu.openPage("albums");
async (t) => { const AlbumCount = await album.getAlbumCount("all");
await menu.openPage("albums"); await menu.openPage("browse");
const AlbumCount = await album.getAlbumCount("all"); await toolbar.search("photo:true");
await menu.openPage("browse"); const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
await toolbar.search("photo:true"); const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.notOk() .notOk()
.expect(Selector("td").withText("NotYetExistingAlbum").visible) .expect(Selector("td").withText("NotYetExistingAlbum").visible)
.notOk() .notOk()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
await photo.selectPhotoFromUID(SecondPhotoUid); await photo.selectPhotoFromUID(SecondPhotoUid);
await photo.selectPhotoFromUID(FirstPhotoUid); await photo.selectPhotoFromUID(FirstPhotoUid);
await contextmenu.triggerContextMenuAction("album", "NotYetExistingAlbum"); await contextmenu.triggerContextMenuAction("album", "NotYetExistingAlbum");
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.ok() .ok()
.expect(Selector("td").withText("NotYetExistingAlbum").visible) .expect(Selector("td").withText("NotYetExistingAlbum").visible)
.ok() .ok()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
await menu.openPage("albums"); await menu.openPage("albums");
const AlbumCountAfterCreation = await album.getAlbumCount("all"); const AlbumCountAfterCreation = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterCreation).eql(AlbumCount + 1); await t.expect(AlbumCountAfterCreation).eql(AlbumCount + 1);
await toolbar.search("NotYetExistingAlbum"); await toolbar.search("NotYetExistingAlbum");
const AlbumUid = await album.getNthAlbumUid("all", 0); const AlbumUid = await album.getNthAlbumUid("all", 0);
await album.openAlbumWithUid(AlbumUid); await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("delete"); await toolbar.triggerToolbarAction("delete");
await t.navigateTo("/library/albums"); await t.navigateTo("/library/albums");
const AlbumCountAfterDelete = await album.getAlbumCount("all"); await notifies.waitForAlbumsToLoad(7000);
const AlbumCountAfterDelete = await album.getAlbumCount("all");
await t.expect(AlbumCountAfterDelete).eql(AlbumCount); await t.expect(AlbumCountAfterDelete).eql(AlbumCount);
await menu.openPage("browse"); await menu.openPage("browse");
await toolbar.search("photo:true"); await toolbar.search("photo:true");
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.notOk() .notOk()
.expect(Selector("td").withText("NotYetExistingAlbum").visible) .expect(Selector("td").withText("NotYetExistingAlbum").visible)
.notOk() .notOk()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
} });
);
test.meta("testID", "albums-003").meta({ type: "short", mode: "public" })("Common: Update album details", async (t) => { test.meta("testID", "albums-003").meta({ type: "short", mode: "public" })("Common: Update album details", async (t) => {
await menu.openPage("albums"); await menu.openPage("albums");
@@ -116,11 +111,7 @@ test.meta("testID", "albums-003").meta({ type: "short", mode: "public" })("Commo
await t.expect(albumdialog.description.value).eql("").expect(albumdialog.category.value).eql(""); await t.expect(albumdialog.description.value).eql("").expect(albumdialog.category.value).eql("");
await t await t.typeText(albumdialog.description, "All my animals").typeText(albumdialog.category, "Pets").pressKey("enter").click(albumdialog.dialogSave);
.typeText(albumdialog.description, "All my animals")
.typeText(albumdialog.category, "Pets")
.pressKey("enter")
.click(albumdialog.dialogSave);
await t.expect(page.cardTitle.nth(0).innerText).contains("Animals"); await t.expect(page.cardTitle.nth(0).innerText).contains("Animals");
@@ -131,153 +122,142 @@ test.meta("testID", "albums-003").meta({ type: "short", mode: "public" })("Commo
await t.expect(albumdialog.description.value).eql("All my animals").expect(albumdialog.category.value).eql("Pets"); await t.expect(albumdialog.description.value).eql("All my animals").expect(albumdialog.category.value).eql("Pets");
await t.click(albumdialog.description).pressKey("ctrl+a delete"); await t.click(albumdialog.description).pressKey("ctrl+a delete");
await t await t.click(albumdialog.category).click(albumdialog.category).pressKey("ctrl+a delete").click(Selector("form.form-album-edit i.mdi-bookmark"));
.click(albumdialog.category)
.click(albumdialog.category)
.pressKey("ctrl+a delete")
.click(Selector("form.form-album-edit i.mdi-bookmark"));
await t.expect(albumdialog.category.value).eql(""); await t.expect(albumdialog.category.value).eql("");
await t.click(albumdialog.dialogSave); await t.click(albumdialog.dialogSave);
await menu.openPage("albums"); await menu.openPage("albums");
await t await t.expect(Selector("div").withText("Holiday").visible).ok().expect(Selector("div").withText("Animals").exists).notOk();
.expect(Selector("div").withText("Holiday").visible)
.ok()
.expect(Selector("div").withText("Animals").exists)
.notOk();
}); });
test.meta("testID", "albums-004").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-004").meta({ type: "short", mode: "public" })("Common: Add/Remove Photos to/from multiple albums", async (t) => {
"Common: Add/Remove Photos to/from multiple albums", // Get initial counts for both Holiday and Christmas albums
async (t) => { await menu.openPage("albums");
// Get initial counts for both Holiday and Christmas albums await notifies.waitForPhotosToLoad(2000);
await menu.openPage("albums"); await toolbar.search("Holiday");
await notifies.waitForPhotosToLoad(2000); const HolidayAlbumUid = await album.getNthAlbumUid("all", 0);
await toolbar.search("Holiday"); await album.openAlbumWithUid(HolidayAlbumUid);
const HolidayAlbumUid = await album.getNthAlbumUid("all", 0); const HolidayPhotoCount = await photo.getPhotoCount("all");
await album.openAlbumWithUid(HolidayAlbumUid); await menu.openPage("albums");
const HolidayPhotoCount = await photo.getPhotoCount("all"); await toolbar.search("Christmas");
await menu.openPage("albums"); const ChristmasAlbumUid = await album.getNthAlbumUid("all", 0);
await toolbar.search("Christmas"); await album.openAlbumWithUid(ChristmasAlbumUid);
const ChristmasAlbumUid = await album.getNthAlbumUid("all", 0); const ChristmasPhotoCount = await photo.getPhotoCount("all");
await album.openAlbumWithUid(ChristmasAlbumUid);
const ChristmasPhotoCount = await photo.getPhotoCount("all");
// Select photos to add to albums // Select photos to add to albums
await menu.openPage("browse"); await menu.openPage("browse");
await toolbar.search("photo:true"); await toolbar.search("photo:true");
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0); const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1); const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
// Verify photos are not in any albums initially // Verify photos are not in any albums initially
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Holiday").visible) .expect(Selector("td").withText("Holiday").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Christmas").visible) .expect(Selector("td").withText("Christmas").visible)
.notOk() .notOk()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
// Select both photos and add to multiple albums simultaneously // Select both photos and add to multiple albums simultaneously
await photo.selectPhotoFromUID(SecondPhotoUid); await photo.selectPhotoFromUID(SecondPhotoUid);
await photoviewer.openPhotoViewer("uid", FirstPhotoUid); await photoviewer.openPhotoViewer("uid", FirstPhotoUid);
await photoviewer.triggerPhotoViewerAction("select-toggle"); await photoviewer.triggerPhotoViewerAction("select-toggle");
await photoviewer.triggerPhotoViewerAction("close-button"); await photoviewer.triggerPhotoViewerAction("close-button");
await contextmenu.triggerContextMenuAction("album", ["Holiday", "Christmas", "Food"]); await contextmenu.triggerContextMenuAction("album", ["Holiday", "Christmas", "Food"]);
// Verify photos were added to Holiday album // Verify photos were added to Holiday album
await menu.openPage("albums"); await menu.openPage("albums");
await album.openAlbumWithUid(HolidayAlbumUid); await album.openAlbumWithUid(HolidayAlbumUid);
const HolidayPhotoCountAfterAdd = await photo.getPhotoCount("all"); const HolidayPhotoCountAfterAdd = await photo.getPhotoCount("all");
await t.expect(HolidayPhotoCountAfterAdd).eql(HolidayPhotoCount + 2); await t.expect(HolidayPhotoCountAfterAdd).eql(HolidayPhotoCount + 2);
// Verify photos were added to Christmas album // Verify photos were added to Christmas album
await menu.openPage("albums"); await menu.openPage("albums");
await album.openAlbumWithUid(ChristmasAlbumUid); await album.openAlbumWithUid(ChristmasAlbumUid);
const ChristmasPhotoCountAfterAdd = await photo.getPhotoCount("all"); const ChristmasPhotoCountAfterAdd = await photo.getPhotoCount("all");
await t.expect(ChristmasPhotoCountAfterAdd).eql(ChristmasPhotoCount + 2); await t.expect(ChristmasPhotoCountAfterAdd).eql(ChristmasPhotoCount + 2);
// Verify photo info shows all albums // Verify photo info shows all albums
await menu.openPage("browse"); await menu.openPage("browse");
await toolbar.search("photo:true"); await toolbar.search("photo:true");
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.ok() .ok()
.expect(Selector("td").withText("Holiday").visible) .expect(Selector("td").withText("Holiday").visible)
.ok() .ok()
.expect(Selector("td").withText("Food").visible) .expect(Selector("td").withText("Food").visible)
.ok() .ok()
.expect(Selector("td").withText("Christmas").visible) .expect(Selector("td").withText("Christmas").visible)
.ok() .ok()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
// Remove photos from Holiday album and verify count // Remove photos from Holiday album and verify count
await menu.openPage("albums"); await menu.openPage("albums");
await album.openAlbumWithUid(HolidayAlbumUid); await album.openAlbumWithUid(HolidayAlbumUid);
await photo.selectPhotoFromUID(FirstPhotoUid); await photo.selectPhotoFromUID(FirstPhotoUid);
await photo.selectPhotoFromUID(SecondPhotoUid); await photo.selectPhotoFromUID(SecondPhotoUid);
await contextmenu.triggerContextMenuAction("remove", ""); await contextmenu.triggerContextMenuAction("remove", "");
const HolidayPhotoCountAfterRemove = await photo.getPhotoCount("all"); const HolidayPhotoCountAfterRemove = await photo.getPhotoCount("all");
await t.expect(HolidayPhotoCountAfterRemove).eql(HolidayPhotoCountAfterAdd - 2); await t.expect(HolidayPhotoCountAfterRemove).eql(HolidayPhotoCountAfterAdd - 2);
// Verify photos are still in Christmas album // Verify photos are still in Christmas album
await menu.openPage("albums"); await menu.openPage("albums");
await album.openAlbumWithUid(ChristmasAlbumUid); await album.openAlbumWithUid(ChristmasAlbumUid);
const ChristmasPhotoCountAfterHolidayRemove = await photo.getPhotoCount("all"); const ChristmasPhotoCountAfterHolidayRemove = await photo.getPhotoCount("all");
await t.expect(ChristmasPhotoCountAfterHolidayRemove).eql(ChristmasPhotoCountAfterAdd); await t.expect(ChristmasPhotoCountAfterHolidayRemove).eql(ChristmasPhotoCountAfterAdd);
// Verify photo info shows only Christmas album now // Verify photo info shows only Christmas album now
await menu.openPage("browse"); await menu.openPage("browse");
await toolbar.search("photo:true"); await toolbar.search("photo:true");
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.ok() .ok()
.expect(Selector("td").withText("Holiday").visible) .expect(Selector("td").withText("Holiday").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Christmas").visible) .expect(Selector("td").withText("Christmas").visible)
.ok() .ok()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
// Remove photos from Christmas album to clean up // Remove photos from Christmas album to clean up
await menu.openPage("albums"); await menu.openPage("albums");
await album.openAlbumWithUid(ChristmasAlbumUid); await album.openAlbumWithUid(ChristmasAlbumUid);
await photo.selectPhotoFromUID(FirstPhotoUid); await photo.selectPhotoFromUID(FirstPhotoUid);
await photo.selectPhotoFromUID(SecondPhotoUid); await photo.selectPhotoFromUID(SecondPhotoUid);
await contextmenu.triggerContextMenuAction("remove", ""); await contextmenu.triggerContextMenuAction("remove", "");
const ChristmasPhotoCountAfterRemove = await photo.getPhotoCount("all"); const ChristmasPhotoCountAfterRemove = await photo.getPhotoCount("all");
await t.expect(ChristmasPhotoCountAfterRemove).eql(ChristmasPhotoCount); await t.expect(ChristmasPhotoCountAfterRemove).eql(ChristmasPhotoCount);
// Delete Food album // Delete Food album
await menu.openPage("albums"); await menu.openPage("albums");
await toolbar.search("Food"); await toolbar.search("Food");
const FoodUid = await album.getNthAlbumUid("all", 0); const FoodUid = await album.getNthAlbumUid("all", 0);
await album.selectAlbumFromUID(FoodUid); await album.selectAlbumFromUID(FoodUid);
await contextmenu.triggerContextMenuAction("delete", ""); await contextmenu.triggerContextMenuAction("delete", "");
// Final verification that photos are not in any albums // Final verification that photos are not in any albums
await menu.openPage("browse"); await menu.openPage("browse");
await toolbar.search("photo:true"); await toolbar.search("photo:true");
await page.clickCardTitleOfUID(FirstPhotoUid); await page.clickCardTitleOfUID(FirstPhotoUid);
await t await t
.click(photoedit.infoTab) .click(photoedit.infoTab)
.expect(Selector("td").withText("Albums").visible) .expect(Selector("td").withText("Albums").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Food").visible) .expect(Selector("td").withText("Food").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Holiday").visible) .expect(Selector("td").withText("Holiday").visible)
.notOk() .notOk()
.expect(Selector("td").withText("Christmas").visible) .expect(Selector("td").withText("Christmas").visible)
.notOk() .notOk()
.click(photoedit.dialogClose); .click(photoedit.dialogClose);
} });
);
test.meta("testID", "albums-004-duplicate").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-004-duplicate").meta({ type: "short", mode: "public" })(
"Common: Album duplication when selecting from dropdown then typing same name", "Common: Album duplication when selecting from dropdown then typing same name",
@@ -341,11 +321,7 @@ test.meta("testID", "albums-006").meta({ mode: "public" })("Common: Test album a
await contextmenu.openContextMenu(); await contextmenu.openContextMenu();
await t.click(Selector("button.action-album")).click(Selector(".input-albums input")); await t.click(Selector("button.action-album")).click(Selector(".input-albums input"));
await t await t.expect(page.selectOption.withText("Holiday").visible).ok().expect(page.selectOption.withText("Christmas").visible).ok();
.expect(page.selectOption.withText("Holiday").visible)
.ok()
.expect(page.selectOption.withText("Christmas").visible)
.ok();
await t.typeText(Selector(".input-albums input"), "C", { replace: true }); await t.typeText(Selector(".input-albums input"), "C", { replace: true });
@@ -358,24 +334,15 @@ test.meta("testID", "albums-006").meta({ mode: "public" })("Common: Test album a
.ok(); .ok();
}); });
test.meta("testID", "albums-007").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-007").meta({ type: "short", mode: "public" })("Common: Create, Edit, delete sharing link", async (t) => {
"Common: Create, Edit, delete sharing link", await page.testCreateEditDeleteSharingLink("albums");
async (t) => { });
await page.testCreateEditDeleteSharingLink("albums");
}
);
test.meta("testID", "albums-008").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-008").meta({ type: "short", mode: "public" })("Common: Verify album sort options", async (t) => {
"Common: Verify album sort options", await menu.openPage("albums");
async (t) => { await album.checkSortOptions("album");
await menu.openPage("albums"); });
await album.checkSortOptions("album");
}
);
test.meta("testID", "albums-009").meta({ type: "short", mode: "public" })( test.meta("testID", "albums-009").meta({ type: "short", mode: "public" })("Common: Set album cover from Albums Page", async (t) => {
"Common: Set album cover from Albums Page", await page.testSetAlbumCover("albums");
async (t) => { });
await page.testSetAlbumCover("albums");
}
);

View File

@@ -85,7 +85,6 @@ test.meta("testID", "folders-002").meta({ mode: "public" })("Common: Update fold
await album.openAlbumWithUid(AlbumUid); await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit"); await toolbar.triggerToolbarAction("edit");
await t.click(albumdialog.category).wait(3000);
await t await t
.expect(albumdialog.description.value) .expect(albumdialog.description.value)

View File

@@ -71,7 +71,6 @@ test.meta("testID", "moments-001").meta({ mode: "public" })("Common: Update mome
await album.openAlbumWithUid(AlbumUid); await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit"); await toolbar.triggerToolbarAction("edit");
await t.click(albumdialog.category).wait(3000);
await t await t
.expect(albumdialog.description.value) .expect(albumdialog.description.value)

View File

@@ -173,7 +173,6 @@ test.meta("testID", "people-004").meta({ mode: "public" })("Common: Test new fac
await t await t
.expect(Selector('div[role="option"]').nth(0).visible) .expect(Selector('div[role="option"]').nth(0).visible)
.notOk() .notOk()
.click(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"))
.typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Otto"); .typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Otto");
await t.expect(Selector('div[role="option"]').nth(0).withText("Otto Visible").visible).ok(); await t.expect(Selector('div[role="option"]').nth(0).withText("Otto Visible").visible).ok();

View File

@@ -114,6 +114,12 @@ export default class Page {
showLogs && console.timeEnd("waitForPhotosToLoad") showLogs && console.timeEnd("waitForPhotosToLoad")
} }
async waitForAlbumsToLoad(delay, close = true){
showLogs && console.time("waitForAlbumsToLoad")
await this.waitForSpecficEvent(/(album|albums) found/, delay, close);
showLogs && console.timeEnd("waitForAlbumsToLoad")
}
async waitForSearchToFinish(delay, close = true){ async waitForSearchToFinish(delay, close = true){
showLogs && console.time("waitForSearchToFinish") showLogs && console.time("waitForSearchToFinish")
await this.waitForSpecficEvent(/(found|contain|empty)/, delay, close); await this.waitForSpecficEvent(/(found|contain|empty)/, delay, close);