mirror of
https://github.com/photoprism/photoprism.git
synced 2026-01-23 02:24:24 +00:00
Tests: Improve acceptance tests to be more stable
This commit is contained in:
parent
d19c70e8e7
commit
75515d3653
6 changed files with 245 additions and 282 deletions
|
|
@ -55,7 +55,7 @@ test.meta("testID", "sharing-001").meta({ mode: "auth" })("Common: Create, view,
|
|||
.click(sharedialog.linkExpireInput)
|
||||
.click(Selector("div").withText("After 1 day").parent('div[role="option"]'))
|
||||
.click(sharedialog.dialogSave)
|
||||
.click(sharedialog.dialogSave);
|
||||
.click(sharedialog.dialogClose);
|
||||
await contextmenu.clearSelection();
|
||||
await t.navigateTo(url);
|
||||
|
||||
|
|
@ -136,71 +136,64 @@ test.meta("testID", "sharing-001").meta({ mode: "auth" })("Common: Create, view,
|
|||
.ok();
|
||||
});
|
||||
|
||||
test.meta("testID", "sharing-002").meta({ type: "short", mode: "auth" })(
|
||||
"Multi-Window: Verify visitor role has limited permissions",
|
||||
async (t) => {
|
||||
await t.navigateTo("http://localhost:2343/s/jxoux5ub1e/british-columbia-canada");
|
||||
await t.expect(toolbar.toolbarSecondTitle.withText("British Columbia").visible).ok();
|
||||
test.meta("testID", "sharing-002").meta({ type: "short", mode: "auth" })("Multi-Window: Verify visitor role has limited permissions", async (t) => {
|
||||
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("share", false);
|
||||
await toolbar.checkToolbarActionAvailability("upload", false);
|
||||
await toolbar.checkToolbarActionAvailability("refresh", true);
|
||||
await toolbar.checkToolbarActionAvailability("download", true);
|
||||
await toolbar.checkToolbarActionAvailability("edit", false);
|
||||
await toolbar.checkToolbarActionAvailability("share", false);
|
||||
await toolbar.checkToolbarActionAvailability("upload", false);
|
||||
await toolbar.checkToolbarActionAvailability("refresh", 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("archive", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("private", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("edit", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("share", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("album", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("download", true);
|
||||
await contextmenu.checkContextMenuActionAvailability("archive", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("private", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("edit", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("share", 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("select-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("fullscreen-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("slideshow-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("favorite-toggle", false);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("edit-button", false);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("download", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("select-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("fullscreen-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("slideshow-toggle", true);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("favorite-toggle", false);
|
||||
await photoviewer.checkPhotoViewerActionAvailability("edit-button", false);
|
||||
|
||||
await photoviewer.triggerPhotoViewerAction("close-button");
|
||||
await t.expect(Selector("div.p-lightbox__pswp").visible).notOk();
|
||||
await photoviewer.triggerPhotoViewerAction("close-button");
|
||||
await t.expect(Selector("div.p-lightbox__pswp").visible).notOk();
|
||||
|
||||
await photo.checkHoverActionAvailability("nth", 0, "favorite", false);
|
||||
await photo.checkHoverActionAvailability("nth", 0, "select", true);
|
||||
await photo.checkHoverActionAvailability("nth", 0, "favorite", false);
|
||||
await photo.checkHoverActionAvailability("nth", 0, "select", true);
|
||||
|
||||
await toolbar.triggerToolbarAction("view-list");
|
||||
await toolbar.triggerToolbarAction("view-list");
|
||||
|
||||
await t
|
||||
.expect(Selector(`td button.input-private`).visible)
|
||||
.notOk()
|
||||
.expect(Selector(`td button.input-favorite`).visible)
|
||||
.notOk();
|
||||
await toolbar.triggerToolbarAction("view-mosaic");
|
||||
await toolbar.triggerToolbarAction("view-cards");
|
||||
await t.click(page.cardLocation.nth(0));
|
||||
await t.expect(places.placesSearch.visible).notOk();
|
||||
await t.expect(Selector('div[title="Cape / Bowen Island / 2019"]').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.expect(Selector(`td button.input-private`).visible).notOk().expect(Selector(`td button.input-favorite`).visible).notOk();
|
||||
await toolbar.triggerToolbarAction("view-mosaic");
|
||||
await toolbar.triggerToolbarAction("view-cards");
|
||||
await t.click(page.cardLocation.nth(0));
|
||||
await t.expect(places.placesSearch.visible).notOk();
|
||||
await t.expect(Selector('div[title="Cape / Bowen Island / 2019"]').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);
|
||||
await album.triggerHoverAction("uid", AlbumUid, "select");
|
||||
const AlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.triggerHoverAction("uid", AlbumUid, "select");
|
||||
|
||||
await contextmenu.checkContextMenuActionAvailability("download", true);
|
||||
await contextmenu.checkContextMenuActionAvailability("delete", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("album", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("edit", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("share", false);
|
||||
await contextmenu.clearSelection();
|
||||
}
|
||||
);
|
||||
await contextmenu.checkContextMenuActionAvailability("download", true);
|
||||
await contextmenu.checkContextMenuActionAvailability("delete", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("album", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("edit", false);
|
||||
await contextmenu.checkContextMenuActionAvailability("share", false);
|
||||
await contextmenu.clearSelection();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,86 +24,81 @@ const albumdialog = new AlbumDialog();
|
|||
const photoedit = new PhotoEdit();
|
||||
const notifies = new Notifies();
|
||||
|
||||
test.meta("testID", "albums-001").meta({ type: "short", mode: "public" })(
|
||||
"Common: Create/delete album on /albums",
|
||||
async (t) => {
|
||||
await menu.openPage("albums");
|
||||
const AlbumCount = await album.getAlbumCount("all");
|
||||
await toolbar.triggerToolbarAction("add");
|
||||
const AlbumCountAfterCreate = await album.getAlbumCount("all");
|
||||
const NewAlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
test.meta("testID", "albums-001").meta({ type: "short", mode: "public" })("Common: Create/delete album on /albums", async (t) => {
|
||||
await menu.openPage("albums");
|
||||
const AlbumCount = await album.getAlbumCount("all");
|
||||
await toolbar.triggerToolbarAction("add");
|
||||
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 contextmenu.triggerContextMenuAction("delete", "");
|
||||
const AlbumCountAfterDelete = await album.getAlbumCount("all");
|
||||
await album.selectAlbumFromUID(NewAlbumUid);
|
||||
await contextmenu.triggerContextMenuAction("delete", "");
|
||||
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" })(
|
||||
"Common: Create/delete album during add to album",
|
||||
async (t) => {
|
||||
await menu.openPage("albums");
|
||||
const AlbumCount = await album.getAlbumCount("all");
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
|
||||
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
|
||||
test.meta("testID", "albums-002").meta({ type: "short", mode: "public" })("Common: Create/delete album during add to album", async (t) => {
|
||||
await menu.openPage("albums");
|
||||
const AlbumCount = await album.getAlbumCount("all");
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
|
||||
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
|
||||
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("album", "NotYetExistingAlbum");
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("album", "NotYetExistingAlbum");
|
||||
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
|
||||
await menu.openPage("albums");
|
||||
const AlbumCountAfterCreation = await album.getAlbumCount("all");
|
||||
await menu.openPage("albums");
|
||||
const AlbumCountAfterCreation = await album.getAlbumCount("all");
|
||||
|
||||
await t.expect(AlbumCountAfterCreation).eql(AlbumCount + 1);
|
||||
await t.expect(AlbumCountAfterCreation).eql(AlbumCount + 1);
|
||||
|
||||
await toolbar.search("NotYetExistingAlbum");
|
||||
const AlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(AlbumUid);
|
||||
await toolbar.triggerToolbarAction("delete");
|
||||
await t.navigateTo("/library/albums");
|
||||
const AlbumCountAfterDelete = await album.getAlbumCount("all");
|
||||
await toolbar.search("NotYetExistingAlbum");
|
||||
const AlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(AlbumUid);
|
||||
await toolbar.triggerToolbarAction("delete");
|
||||
await t.navigateTo("/library/albums");
|
||||
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 toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
}
|
||||
);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("NotYetExistingAlbum").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-003").meta({ type: "short", mode: "public" })("Common: Update album details", async (t) => {
|
||||
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
|
||||
.typeText(albumdialog.description, "All my animals")
|
||||
.typeText(albumdialog.category, "Pets")
|
||||
.pressKey("enter")
|
||||
.click(albumdialog.dialogSave);
|
||||
await t.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");
|
||||
|
||||
|
|
@ -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.click(albumdialog.description).pressKey("ctrl+a delete");
|
||||
await t
|
||||
.click(albumdialog.category)
|
||||
.click(albumdialog.category)
|
||||
.pressKey("ctrl+a delete")
|
||||
.click(Selector("form.form-album-edit i.mdi-bookmark"));
|
||||
await t.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.click(albumdialog.dialogSave);
|
||||
await menu.openPage("albums");
|
||||
|
||||
await t
|
||||
.expect(Selector("div").withText("Holiday").visible)
|
||||
.ok()
|
||||
.expect(Selector("div").withText("Animals").exists)
|
||||
.notOk();
|
||||
await t.expect(Selector("div").withText("Holiday").visible).ok().expect(Selector("div").withText("Animals").exists).notOk();
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-004").meta({ type: "short", mode: "public" })(
|
||||
"Common: Add/Remove Photos to/from multiple albums",
|
||||
async (t) => {
|
||||
// Get initial counts for both Holiday and Christmas albums
|
||||
await menu.openPage("albums");
|
||||
await notifies.waitForPhotosToLoad(2000);
|
||||
await toolbar.search("Holiday");
|
||||
const HolidayAlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
const HolidayPhotoCount = await photo.getPhotoCount("all");
|
||||
await menu.openPage("albums");
|
||||
await toolbar.search("Christmas");
|
||||
const ChristmasAlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCount = await photo.getPhotoCount("all");
|
||||
test.meta("testID", "albums-004").meta({ type: "short", mode: "public" })("Common: Add/Remove Photos to/from multiple albums", async (t) => {
|
||||
// Get initial counts for both Holiday and Christmas albums
|
||||
await menu.openPage("albums");
|
||||
await notifies.waitForPhotosToLoad(2000);
|
||||
await toolbar.search("Holiday");
|
||||
const HolidayAlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
const HolidayPhotoCount = await photo.getPhotoCount("all");
|
||||
await menu.openPage("albums");
|
||||
await toolbar.search("Christmas");
|
||||
const ChristmasAlbumUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCount = await photo.getPhotoCount("all");
|
||||
|
||||
// Select photos to add to albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
|
||||
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
|
||||
// Select photos to add to albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
const FirstPhotoUid = await photo.getNthPhotoUid("image", 0);
|
||||
const SecondPhotoUid = await photo.getNthPhotoUid("image", 1);
|
||||
|
||||
// Verify photos are not in any albums initially
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
// Verify photos are not in any albums initially
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
|
||||
// Select both photos and add to multiple albums simultaneously
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await photoviewer.openPhotoViewer("uid", FirstPhotoUid);
|
||||
await photoviewer.triggerPhotoViewerAction("select-toggle");
|
||||
await photoviewer.triggerPhotoViewerAction("close-button");
|
||||
await contextmenu.triggerContextMenuAction("album", ["Holiday", "Christmas", "Food"]);
|
||||
// Select both photos and add to multiple albums simultaneously
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await photoviewer.openPhotoViewer("uid", FirstPhotoUid);
|
||||
await photoviewer.triggerPhotoViewerAction("select-toggle");
|
||||
await photoviewer.triggerPhotoViewerAction("close-button");
|
||||
await contextmenu.triggerContextMenuAction("album", ["Holiday", "Christmas", "Food"]);
|
||||
|
||||
// Verify photos were added to Holiday album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
const HolidayPhotoCountAfterAdd = await photo.getPhotoCount("all");
|
||||
await t.expect(HolidayPhotoCountAfterAdd).eql(HolidayPhotoCount + 2);
|
||||
// Verify photos were added to Holiday album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
const HolidayPhotoCountAfterAdd = await photo.getPhotoCount("all");
|
||||
await t.expect(HolidayPhotoCountAfterAdd).eql(HolidayPhotoCount + 2);
|
||||
|
||||
// Verify photos were added to Christmas album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCountAfterAdd = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterAdd).eql(ChristmasPhotoCount + 2);
|
||||
// Verify photos were added to Christmas album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCountAfterAdd = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterAdd).eql(ChristmasPhotoCount + 2);
|
||||
|
||||
// Verify photo info shows all albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Food").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
// Verify photo info shows all albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Food").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
|
||||
// Remove photos from Holiday album and verify count
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("remove", "");
|
||||
const HolidayPhotoCountAfterRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(HolidayPhotoCountAfterRemove).eql(HolidayPhotoCountAfterAdd - 2);
|
||||
// Remove photos from Holiday album and verify count
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(HolidayAlbumUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("remove", "");
|
||||
const HolidayPhotoCountAfterRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(HolidayPhotoCountAfterRemove).eql(HolidayPhotoCountAfterAdd - 2);
|
||||
|
||||
// Verify photos are still in Christmas album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCountAfterHolidayRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterHolidayRemove).eql(ChristmasPhotoCountAfterAdd);
|
||||
// Verify photos are still in Christmas album
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
const ChristmasPhotoCountAfterHolidayRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterHolidayRemove).eql(ChristmasPhotoCountAfterAdd);
|
||||
|
||||
// Verify photo info shows only Christmas album now
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
// Verify photo info shows only Christmas album now
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.ok()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.ok()
|
||||
.click(photoedit.dialogClose);
|
||||
|
||||
// Remove photos from Christmas album to clean up
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("remove", "");
|
||||
const ChristmasPhotoCountAfterRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterRemove).eql(ChristmasPhotoCount);
|
||||
// Remove photos from Christmas album to clean up
|
||||
await menu.openPage("albums");
|
||||
await album.openAlbumWithUid(ChristmasAlbumUid);
|
||||
await photo.selectPhotoFromUID(FirstPhotoUid);
|
||||
await photo.selectPhotoFromUID(SecondPhotoUid);
|
||||
await contextmenu.triggerContextMenuAction("remove", "");
|
||||
const ChristmasPhotoCountAfterRemove = await photo.getPhotoCount("all");
|
||||
await t.expect(ChristmasPhotoCountAfterRemove).eql(ChristmasPhotoCount);
|
||||
|
||||
// Delete Food album
|
||||
await menu.openPage("albums");
|
||||
await toolbar.search("Food");
|
||||
const FoodUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.selectAlbumFromUID(FoodUid);
|
||||
await contextmenu.triggerContextMenuAction("delete", "");
|
||||
// Delete Food album
|
||||
await menu.openPage("albums");
|
||||
await toolbar.search("Food");
|
||||
const FoodUid = await album.getNthAlbumUid("all", 0);
|
||||
await album.selectAlbumFromUID(FoodUid);
|
||||
await contextmenu.triggerContextMenuAction("delete", "");
|
||||
|
||||
// Final verification that photos are not in any albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Food").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
}
|
||||
);
|
||||
// Final verification that photos are not in any albums
|
||||
await menu.openPage("browse");
|
||||
await toolbar.search("photo:true");
|
||||
await page.clickCardTitleOfUID(FirstPhotoUid);
|
||||
await t
|
||||
.click(photoedit.infoTab)
|
||||
.expect(Selector("td").withText("Albums").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Food").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Holiday").visible)
|
||||
.notOk()
|
||||
.expect(Selector("td").withText("Christmas").visible)
|
||||
.notOk()
|
||||
.click(photoedit.dialogClose);
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-004-duplicate").meta({ type: "short", mode: "public" })(
|
||||
"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 t.click(Selector("button.action-album")).click(Selector(".input-albums input"));
|
||||
|
||||
await t
|
||||
.expect(page.selectOption.withText("Holiday").visible)
|
||||
.ok()
|
||||
.expect(page.selectOption.withText("Christmas").visible)
|
||||
.ok();
|
||||
await t.expect(page.selectOption.withText("Holiday").visible).ok().expect(page.selectOption.withText("Christmas").visible).ok();
|
||||
|
||||
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();
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-007").meta({ type: "short", mode: "public" })(
|
||||
"Common: Create, Edit, delete sharing link",
|
||||
async (t) => {
|
||||
await page.testCreateEditDeleteSharingLink("albums");
|
||||
}
|
||||
);
|
||||
test.meta("testID", "albums-007").meta({ type: "short", mode: "public" })("Common: Create, Edit, delete sharing link", async (t) => {
|
||||
await page.testCreateEditDeleteSharingLink("albums");
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-008").meta({ type: "short", mode: "public" })(
|
||||
"Common: Verify album sort options",
|
||||
async (t) => {
|
||||
await menu.openPage("albums");
|
||||
await album.checkSortOptions("album");
|
||||
}
|
||||
);
|
||||
test.meta("testID", "albums-008").meta({ type: "short", mode: "public" })("Common: Verify album sort options", async (t) => {
|
||||
await menu.openPage("albums");
|
||||
await album.checkSortOptions("album");
|
||||
});
|
||||
|
||||
test.meta("testID", "albums-009").meta({ type: "short", mode: "public" })(
|
||||
"Common: Set album cover from Albums Page",
|
||||
async (t) => {
|
||||
await page.testSetAlbumCover("albums");
|
||||
}
|
||||
);
|
||||
test.meta("testID", "albums-009").meta({ type: "short", mode: "public" })("Common: Set album cover from Albums Page", async (t) => {
|
||||
await page.testSetAlbumCover("albums");
|
||||
});
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ test.meta("testID", "folders-002").meta({ mode: "public" })("Common: Update fold
|
|||
|
||||
await album.openAlbumWithUid(AlbumUid);
|
||||
await toolbar.triggerToolbarAction("edit");
|
||||
await t.click(albumdialog.category).wait(3000);
|
||||
|
||||
await t
|
||||
.expect(albumdialog.description.value)
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ test.meta("testID", "moments-001").meta({ mode: "public" })("Common: Update mome
|
|||
|
||||
await album.openAlbumWithUid(AlbumUid);
|
||||
await toolbar.triggerToolbarAction("edit");
|
||||
await t.click(albumdialog.category).wait(3000);
|
||||
|
||||
await t
|
||||
.expect(albumdialog.description.value)
|
||||
|
|
|
|||
|
|
@ -173,7 +173,6 @@ test.meta("testID", "people-004").meta({ mode: "public" })("Common: Test new fac
|
|||
await t
|
||||
.expect(Selector('div[role="option"]').nth(0).visible)
|
||||
.notOk()
|
||||
.click(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"))
|
||||
.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();
|
||||
|
|
|
|||
|
|
@ -114,6 +114,12 @@ export default class Page {
|
|||
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){
|
||||
showLogs && console.time("waitForSearchToFinish")
|
||||
await this.waitForSpecficEvent(/(found|contain|empty)/, delay, close);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue