Tests: Refactor acceptance tests

This commit is contained in:
theresa 2022-01-24 16:25:32 +01:00
parent 537f64cb9e
commit ce61e97c00
20 changed files with 413 additions and 352 deletions

View file

@ -6,7 +6,7 @@ import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import PhotoViewer from "../page-model/photoviewer";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test albums`.page`${testcafeconfig.url}`;
@ -16,7 +16,7 @@ const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const page = new Page();
test.meta("testID", "authentication-000")(
"Time to start instance (will be marked as unstable)",
@ -25,27 +25,30 @@ test.meta("testID", "authentication-000")(
}
);
test.meta("testID", "albums-001")("Create/delete album on /albums", async (t) => {
await menu.openPage("albums");
const countAlbums = await album.getAlbumCount("all");
await toolbar.triggerToolbarAction("add", "");
const countAlbumsAfterCreate = await album.getAlbumCount("all");
const NewAlbum = await album.getNthAlbumUid("all", 0);
await t.expect(countAlbumsAfterCreate).eql(countAlbums + 1);
await album.selectAlbumFromUID(NewAlbum);
await contextmenu.triggerContextMenuAction("delete", "", "");
const countAlbumsAfterDelete = await album.getAlbumCount("all");
await t.expect(countAlbumsAfterDelete).eql(countAlbumsAfterCreate - 1);
});
test.meta("testID", "albums-001").meta({ type: "smoke" })(
"Create/delete album on /albums",
async (t) => {
await menu.openPage("albums");
const countAlbums = await album.getAlbumCount("all");
await toolbar.triggerToolbarAction("add", "");
const countAlbumsAfterCreate = await album.getAlbumCount("all");
const NewAlbum = await album.getNthAlbumUid("all", 0);
await t.expect(countAlbumsAfterCreate).eql(countAlbums + 1);
await album.selectAlbumFromUID(NewAlbum);
await contextmenu.triggerContextMenuAction("delete", "", "");
const countAlbumsAfterDelete = await album.getAlbumCount("all");
await t.expect(countAlbumsAfterDelete).eql(countAlbumsAfterCreate - 1);
}
);
test.meta("testID", "albums-002")("Update album", async (t) => {
await menu.openPage("albums");
await toolbar.search("Holiday");
const AlbumUid = await album.getNthAlbumUid("all", 0);
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Holiday")
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.typeText(Selector(".input-title input"), "Animals", { replace: true })
.expect(Selector(".input-description textarea").value)
.eql("")
@ -74,7 +77,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
} else {
await toolbar.setFilter("category", "Family");
}
await t.expect(newpage.cardTitle.nth(0).innerText).contains("Christmas");
await t.expect(page.cardTitle.nth(0).innerText).contains("Christmas");
await menu.openPage("albums");
await toolbar.triggerToolbarAction("reload", "");
if (t.browser.platform === "mobile") {
@ -113,7 +116,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
//TODO test that sharing link works as expected --> move to sharing.js
test.meta("testID", "albums-006")("Create, Edit, delete sharing link", async (t) => {
await newpage.testCreateEditDeleteSharingLink("albums");
await page.testCreateEditDeleteSharingLink("albums");
});
test.meta("testID", "albums-007")("Create/delete album during add to album", async (t) => {
@ -146,15 +149,15 @@ test.meta("testID", "albums-008")("Test album autocomplete", async (t) => {
await t
.click(Selector("button.action-album"))
.click(Selector(".input-album input"))
.expect(newpage.selectOption.withText("Holiday").visible)
.expect(page.selectOption.withText("Holiday").visible)
.ok()
.expect(newpage.selectOption.withText("Christmas").visible)
.expect(page.selectOption.withText("Christmas").visible)
.ok()
.typeText(Selector(".input-album input"), "C", { replace: true })
.expect(newpage.selectOption.withText("Holiday").visible)
.expect(page.selectOption.withText("Holiday").visible)
.notOk()
.expect(newpage.selectOption.withText("Christmas").visible)
.expect(page.selectOption.withText("Christmas").visible)
.ok()
.expect(newpage.selectOption.withText("C").visible)
.expect(page.selectOption.withText("C").visible)
.ok();
});

View file

@ -6,7 +6,7 @@ import Album from "../page-model/album";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
const logger = RequestLogger(/http:\/\/localhost:2343\/api\/v1\/*/, {
logResponseHeaders: true,
@ -20,7 +20,7 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
test.meta("testID", "albums-005")("View calendar", async (t) => {
await menu.openPage("calendar");
@ -36,9 +36,9 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
await toolbar.search("March 2014");
const AlbumUid = await album.getNthAlbumUid("all", 0);
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("March 2014")
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.typeText(Selector(".input-location input"), "Snow", { replace: true })
.expect(Selector(".input-description textarea").value)
.eql("")
@ -48,9 +48,9 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
.typeText(Selector(".input-category input"), "Mountains")
.pressKey("enter")
.click(".action-confirm")
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("March 2014")
.expect(newpage.cardDescription.nth(0).innerText)
.expect(page.cardDescription.nth(0).innerText)
.contains("We went to ski")
.expect(Selector("div.caption").nth(1).innerText)
.contains("Mountains")
@ -65,7 +65,7 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
} else {
await toolbar.setFilter("category", "Mountains");
}
await t.expect(newpage.cardTitle.nth(0).innerText).contains("March 2014");
await t.expect(page.cardTitle.nth(0).innerText).contains("March 2014");
await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit", "");
await t
@ -88,7 +88,7 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
await menu.openPage("calendar");
await toolbar.search("March 2014");
await t
.expect(newpage.cardDescription.innerText)
.expect(page.cardDescription.innerText)
.notContains("We went to ski")
.expect(Selector("div.caption").nth(0).innerText)
.notContains("Snow");
@ -96,7 +96,7 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
//TODO test that sharing link works as expected
test.meta("testID", "calendar-003")("Create, Edit, delete sharing link", async (t) => {
await newpage.testCreateEditDeleteSharingLink("calendar");
await page.testCreateEditDeleteSharingLink("calendar");
});
test.meta("testID", "calendar-004")("Create/delete album-clone from calendar", async (t) => {

View file

@ -5,7 +5,7 @@ import Album from "../page-model/album";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test folders`.page`${testcafeconfig.url}`;
@ -14,7 +14,7 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
test.meta("testID", "albums-004")("View folders", async (t) => {
await menu.openPage("folders");
@ -32,9 +32,9 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
await toolbar.search("Kanada");
const AlbumUid = await album.getNthAlbumUid("all", 0);
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Kanada")
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.expect(Selector(".input-title input").value)
.eql("Kanada")
.expect(Selector(".input-location input").value)
@ -49,9 +49,9 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
.typeText(Selector(".input-category input"), "Mountains")
.pressKey("enter")
.click(".action-confirm")
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("MyFolder")
.expect(newpage.cardDescription.nth(0).innerText)
.expect(page.cardDescription.nth(0).innerText)
.contains("Last holiday")
.expect(Selector("div.caption").nth(1).innerText)
.contains("Mountains")
@ -69,7 +69,7 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
} else {
await toolbar.setFilter("category", "Mountains");
}
await t.expect(newpage.cardTitle.nth(0).innerText).contains("MyFolder");
await t.expect(page.cardTitle.nth(0).innerText).contains("MyFolder");
await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit", "");
await t
@ -93,9 +93,9 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
await menu.openPage("folders");
await toolbar.search("Kanada");
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Kanada")
.expect(newpage.cardDescription.nth(0).innerText)
.expect(page.cardDescription.nth(0).innerText)
.notContains("We went to ski")
.expect(Selector("div.caption").nth(0).innerText)
.notContains("USA");
@ -103,7 +103,7 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
//TODO test that sharing link works as expected
test.meta("testID", "folders-003")("Create, Edit, delete sharing link", async (t) => {
await newpage.testCreateEditDeleteSharingLink("folders");
await page.testCreateEditDeleteSharingLink("folders");
});
test.meta("testID", "folders-004")("Create/delete album-clone from folder", async (t) => {

View file

@ -5,9 +5,8 @@ import Album from "../page-model/album";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
import Label from "../page-model/label";
import PhotoViews from "../page-model/photo-views";
import PhotoEdit from "../page-model/photo-edit";
fixture`Test labels`.page`${testcafeconfig.url}`;
@ -17,9 +16,8 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
const label = new Label();
const photoviews = new PhotoViews();
const photoedit = new PhotoEdit();
test.meta("testID", "labels-001")("Remove/Activate Add/Delete Label from photo", async (t) => {
@ -34,7 +32,7 @@ test.meta("testID", "labels-001")("Remove/Activate Add/Delete Label from photo",
await label.openLabelWithUid(LabelBeacon);
await toolbar.setFilter("view", "Cards");
const PhotoBeacon = await photo.getNthPhotoUid("all", 0);
await t.click(newpage.cardTitle.withAttribute("data-uid", PhotoBeacon));
await t.click(page.cardTitle.withAttribute("data-uid", PhotoBeacon));
const PhotoKeywords = await Selector(".input-keywords textarea").value;
await t
.expect(PhotoKeywords)
@ -58,7 +56,7 @@ test.meta("testID", "labels-001")("Remove/Activate Add/Delete Label from photo",
const LabelTest = await label.getNthLabeltUid(0);
await label.openLabelWithUid(LabelTest);
await t
.click(newpage.cardTitle.withAttribute("data-uid", PhotoBeacon))
.click(page.cardTitle.withAttribute("data-uid", PhotoBeacon))
.click(Selector("#tab-labels"))
.click(photoedit.deleteLabel)
.click(photoedit.activateLabel)
@ -84,7 +82,7 @@ test.meta("testID", "labels-002")("Rename Label", async (t) => {
await label.openNthLabel(0);
const FirstPhotoZebra = await photo.getNthPhotoUid("all", 0);
await toolbar.setFilter("view", "Cards");
await t.click(newpage.cardTitle.withAttribute("data-uid", FirstPhotoZebra));
await t.click(page.cardTitle.withAttribute("data-uid", FirstPhotoZebra));
const FirstPhotoTitle = await Selector(".input-title input", { timeout: 5000 }).value;
const FirstPhotoKeywords = await Selector(".input-keywords textarea", { timeout: 5000 }).value;
await t
@ -114,7 +112,7 @@ test.meta("testID", "labels-002")("Rename Label", async (t) => {
await label.openLabelWithUid(LabelZebra);
await photo.checkPhotoVisibility(FirstPhotoZebra, true);
await t
.click(newpage.cardTitle.withAttribute("data-uid", FirstPhotoZebra))
.click(page.cardTitle.withAttribute("data-uid", FirstPhotoZebra))
.click(Selector("#tab-labels"))
.click(photoedit.openInlineEdit)
.typeText(photoedit.inputLabelRename, "Zebra", { replace: true })
@ -149,12 +147,12 @@ test.meta("testID", "labels-003")("Add label to album", async (t) => {
await album.openAlbumWithUid(AlbumUid);
const PhotoCountAfterAdd = await photo.getPhotoCount("all");
await t.expect(PhotoCountAfterAdd).eql(PhotoCount + 6);
await photoviews.triggerHoverAction("uid", FirstPhotoLandscape, "select");
await photoviews.triggerHoverAction("uid", SecondPhotoLandscape, "select");
await photoviews.triggerHoverAction("uid", ThirdPhotoLandscape, "select");
await photoviews.triggerHoverAction("uid", FourthPhotoLandscape, "select");
await photoviews.triggerHoverAction("uid", FifthPhotoLandscape, "select");
await photoviews.triggerHoverAction("uid", SixthPhotoLandscape, "select");
await photo.triggerHoverAction("uid", FirstPhotoLandscape, "select");
await photo.triggerHoverAction("uid", SecondPhotoLandscape, "select");
await photo.triggerHoverAction("uid", ThirdPhotoLandscape, "select");
await photo.triggerHoverAction("uid", FourthPhotoLandscape, "select");
await photo.triggerHoverAction("uid", FifthPhotoLandscape, "select");
await photo.triggerHoverAction("uid", SixthPhotoLandscape, "select");
await contextmenu.triggerContextMenuAction("remove", "");
const PhotoCountAfterDelete = await photo.getPhotoCount("all");
await t.expect(PhotoCountAfterDelete).eql(PhotoCountAfterAdd - 6);
@ -175,7 +173,7 @@ test.meta("testID", "labels-004")("Delete label", async (t) => {
await menu.openPage("browse");
await toolbar.setFilter("view", "Cards");
await t
.click(newpage.cardTitle.withAttribute("data-uid", FirstPhotoDome))
.click(page.cardTitle.withAttribute("data-uid", FirstPhotoDome))
.click(Selector("#tab-labels"))
.expect(Selector("td").withText("No labels found").visible)
.ok()

View file

@ -2,30 +2,33 @@ import { Selector } from "testcafe";
import testcafeconfig from "../testcafeconfig";
import Menu from "../../page-model/menu";
import Toolbar from "../../page-model/toolbar";
import NewPage from "../../page-model/page";
import Page from "../../page-model/page";
import Library from "../../page-model/library";
fixture`Import file from folder`.page`${testcafeconfig.url}`;
const menu = new Menu();
const toolbar = new Toolbar();
const newpage = new NewPage();
const page = new Page();
const library = new Library();
test.meta("testID", "library-import-001")("Import files from folder using copy", async (t) => {
await menu.openPage("labels");
await toolbar.search("bakery");
await t.expect(Selector("div.no-results").visible).ok();
await menu.openPage("library");
await t
.click(Selector("#tab-library-import"))
.typeText(library.openImportFolderSelect, "/B", { replace: true })
.click(newpage.selectOption.nth(0))
.click(library.import)
//TODO replace wait
.wait(60000);
await menu.openPage("labels");
await toolbar.triggerToolbarAction("reload", "");
await toolbar.search("bakery");
await t.expect(Selector(".is-label").visible).ok();
});
test.meta("testID", "library-import-001").meta({ type: "smoke" })(
"Import files from folder using copy",
async (t) => {
await menu.openPage("labels");
await toolbar.search("bakery");
await t.expect(Selector("div.no-results").visible).ok();
await menu.openPage("library");
await t
.click(Selector("#tab-library-import"))
.typeText(library.openImportFolderSelect, "/B", { replace: true })
.click(page.selectOption.nth(0))
.click(library.import)
//TODO replace wait
.wait(60000);
await menu.openPage("labels");
await toolbar.triggerToolbarAction("reload", "");
await toolbar.search("bakery");
await t.expect(Selector(".is-label").visible).ok();
}
);

View file

@ -3,7 +3,7 @@ import testcafeconfig from "../testcafeconfig";
import Menu from "../../page-model/menu";
import Toolbar from "../../page-model/toolbar";
import Photo from "../../page-model/photo";
import NewPage from "../../page-model/page";
import Page from "../../page-model/page";
import Library from "../../page-model/library";
import Album from "../../page-model/album";
@ -12,7 +12,7 @@ fixture`Test index`.page`${testcafeconfig.url}`;
const menu = new Menu();
const toolbar = new Toolbar();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
const library = new Library();
const album = new Album();
@ -56,7 +56,7 @@ test.meta("testID", "library-index-001")("Index files from folder", async (t) =>
await t
.click(Selector("#tab-library-index"))
.click(library.indexFolderSelect)
.click(newpage.selectOption.withText("/moment"))
.click(page.selectOption.withText("/moment"))
.click(library.index)
//TODO replace wait
.wait(50000)

View file

@ -5,7 +5,7 @@ import Album from "../page-model/album";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test moments`.page`${testcafeconfig.url}`;
@ -14,16 +14,16 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
test.meta("testID", "moments-001")("Update moment", async (t) => {
await menu.openPage("moments");
await toolbar.search("Nature");
const AlbumUid = await album.getNthAlbumUid("all", 0);
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Nature")
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.expect(Selector(".input-title input").value)
.eql("Nature & Landscape")
.expect(Selector(".input-location input").value)
@ -38,9 +38,9 @@ test.meta("testID", "moments-001")("Update moment", async (t) => {
.typeText(Selector(".input-category input"), "Mountains")
.pressKey("enter")
.click(".action-confirm")
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Winter")
.expect(newpage.cardDescription.nth(0).innerText)
.expect(page.cardDescription.nth(0).innerText)
.contains("We went to ski")
.expect(Selector("div.caption").nth(1).innerText)
.contains("Mountains")
@ -55,7 +55,7 @@ test.meta("testID", "moments-001")("Update moment", async (t) => {
} else {
await toolbar.setFilter("category", "Mountains");
}
await t.expect(newpage.cardTitle.nth(0).innerText).contains("Winter");
await t.expect(page.cardTitle.nth(0).innerText).contains("Winter");
await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit", "");
await t
@ -79,16 +79,16 @@ test.meta("testID", "moments-001")("Update moment", async (t) => {
await menu.openPage("moments");
await toolbar.search("Nature");
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Nature & Landscape")
.expect(newpage.cardDescription.innerText)
.expect(page.cardDescription.innerText)
.notContains("We went to ski")
.expect(Selector("div.caption").nth(0).innerText)
.notContains("Snow-Land");
});
test.meta("testID", "moments-003")("Create, Edit, delete sharing link", async (t) => {
await newpage.testCreateEditDeleteSharingLink("moments");
await page.testCreateEditDeleteSharingLink("moments");
});
test.meta("testID", "moments-004")("Create/delete album-clone from moment", async (t) => {

View file

@ -5,7 +5,6 @@ import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import Subject from "../page-model/subject";
import PhotoViews from "../page-model/photo-views";
import PhotoEdit from "../page-model/photo-edit";
fixture`Test people`.page`${testcafeconfig.url}`;
@ -15,7 +14,6 @@ const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const subject = new Subject();
const photoviews = new PhotoViews();
const photoedit = new PhotoEdit();
test.meta("testID", "people-001")("Add + Rename", async (t) => {
@ -53,9 +51,9 @@ test.meta("testID", "people-001")("Add + Rename", async (t) => {
await subject.openSubjectWithUid(JaneUID);
const countPhotosSubject = await photo.getPhotoCount("all");
await t.expect(countPhotosFace).eql(countPhotosSubject);
await photoviews.triggerHoverAction("nth", 0, "select");
await photoviews.triggerHoverAction("nth", 1, "select");
await photoviews.triggerHoverAction("nth", 2, "select");
await photo.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 1, "select");
await photo.triggerHoverAction("nth", 2, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t
.click(Selector("#tab-people"))
@ -106,7 +104,7 @@ test.meta("testID", "people-002")("Add + Reject + Star", async (t) => {
await t.eval(() => location.reload());
await t.wait(5000);
const countPhotosAndreaAfterAdd = await photo.getPhotoCount("all");
await photoviews.triggerHoverAction("nth", 1, "select");
await photo.triggerHoverAction("nth", 1, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t
.click(Selector("#tab-people"))
@ -139,7 +137,7 @@ test.meta("testID", "people-002")("Add + Reject + Star", async (t) => {
test.meta("testID", "people-003")("Remove face", async (t) => {
await toolbar.search("face:new");
const FirstPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t.click(Selector("#tab-people"));
const MarkerCount = await subject.getMarkerCount();
@ -166,7 +164,7 @@ test.meta("testID", "people-003")("Remove face", async (t) => {
await contextmenu.clearSelection();
await t.eval(() => location.reload());
await t.wait(5000);
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t.click(Selector("#tab-people"));
if ((await photoedit.inputName.nth(0).value) == "") {

View file

@ -4,11 +4,7 @@ import Menu from "../page-model/menu";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import PhotoViewer from "../page-model/photoviewer";
import NewPage from "../page-model/page";
import PhotoViews from "../page-model/photo-views";
import PhotoEdit from "../page-model/photo-edit";
import Library from "../page-model/library";
import Album from "../page-model/album";
import Subject from "../page-model/subject";
import Label from "../page-model/label";
@ -19,11 +15,7 @@ const menu = new Menu();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const photoedit = new PhotoEdit();
const library = new Library();
const album = new Album();
const label = new Label();
const subject = new Subject();
@ -46,15 +38,15 @@ test.meta("testID", "photos-005")(
await photo.checkPhotoVisibility(SecondVideo, false);
await photo.checkPhotoVisibility(ThirdVideo, false);
await menu.openPage("browse");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("private", "");
await toolbar.setFilter("view", "List");
await photoviews.triggerListViewActions("uid", SecondPhoto, "private");
await photoviews.triggerListViewActions("uid", SecondVideo, "private");
await photo.triggerListViewActions("uid", SecondPhoto, "private");
await photo.triggerListViewActions("uid", SecondVideo, "private");
await toolbar.setFilter("view", "Cards");
await photoviews.triggerHoverAction("uid", ThirdPhoto, "select");
await photoviews.triggerHoverAction("uid", ThirdVideo, "select");
await photo.triggerHoverAction("uid", ThirdPhoto, "select");
await photo.triggerHoverAction("uid", ThirdVideo, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await photoedit.turnSwitchOn("private");
await t.click(photoedit.dialogNext);
@ -83,12 +75,12 @@ test.meta("testID", "photos-005")(
await photo.checkPhotoVisibility(SecondVideo, true);
await photo.checkPhotoVisibility(ThirdVideo, true);
await contextmenu.clearSelection();
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photoviews.triggerHoverAction("uid", ThirdPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photoviews.triggerHoverAction("uid", SecondVideo, "select");
await photoviews.triggerHoverAction("uid", ThirdVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", ThirdPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", SecondVideo, "select");
await photo.triggerHoverAction("uid", ThirdVideo, "select");
await contextmenu.checkContextMenuCount("6");
await contextmenu.triggerContextMenuAction("private", "");
if (t.browser.platform === "mobile") {
@ -130,9 +122,9 @@ test.meta("testID", "photos-006")(
await photo.checkPhotoVisibility(FirstPrivatePhoto, false);
await photo.checkPhotoVisibility(FirstReviewPhoto, false);
await menu.openPage("browse");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("archive", "", "");
if (t.browser.platform === "mobile") {
await t.eval(() => location.reload());
@ -145,7 +137,7 @@ test.meta("testID", "photos-006")(
await photo.checkPhotoVisibility(FirstPrivatePhoto, false);
await photo.checkPhotoVisibility(FirstReviewPhoto, false);
await menu.openPage("review");
await photoviews.triggerHoverAction("uid", FirstReviewPhoto, "select");
await photo.triggerHoverAction("uid", FirstReviewPhoto, "select");
await contextmenu.triggerContextMenuAction("archive", "", "");
if (t.browser.platform === "mobile") {
await t.eval(() => location.reload());
@ -154,7 +146,7 @@ test.meta("testID", "photos-006")(
}
await photo.checkPhotoVisibility(FirstReviewPhoto, false);
await menu.openPage("private");
await photoviews.triggerHoverAction("uid", FirstPrivatePhoto, "select");
await photo.triggerHoverAction("uid", FirstPrivatePhoto, "select");
await contextmenu.triggerContextMenuAction("archive", "", "");
if (t.browser.platform === "mobile") {
await t.eval(() => location.reload());
@ -168,11 +160,11 @@ test.meta("testID", "photos-006")(
await photo.checkPhotoVisibility(FirstVideo, true);
await photo.checkPhotoVisibility(FirstPrivatePhoto, true);
await photo.checkPhotoVisibility(FirstReviewPhoto, true);
await photoviews.triggerHoverAction("uid", FirstPrivatePhoto, "select");
await photoviews.triggerHoverAction("uid", FirstReviewPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPrivatePhoto, "select");
await photo.triggerHoverAction("uid", FirstReviewPhoto, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("restore", "", "");
if (t.browser.platform === "mobile") {
await t.eval(() => location.reload());
@ -204,56 +196,56 @@ test.meta("testID", "photos-013")(
const InitialPhotoCountInArchive = await photo.getPhotoCount("all");
await menu.openPage("monochrome");
const MonochromePhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", MonochromePhoto, "select");
await photo.triggerHoverAction("uid", MonochromePhoto, "select");
await menu.openPage("panoramas");
const PanoramaPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", PanoramaPhoto, "select");
await photo.triggerHoverAction("uid", PanoramaPhoto, "select");
await menu.openPage("stacks");
const StackedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", StackedPhoto, "select");
await photo.triggerHoverAction("uid", StackedPhoto, "select");
await menu.openPage("scans");
const ScannedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", ScannedPhoto, "select");
await photo.triggerHoverAction("uid", ScannedPhoto, "select");
await menu.openPage("review");
const ReviewPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", ReviewPhoto, "select");
await photo.triggerHoverAction("uid", ReviewPhoto, "select");
await menu.openPage("favorites");
const FavoritesPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", FavoritesPhoto, "select");
await photo.triggerHoverAction("uid", FavoritesPhoto, "select");
await menu.openPage("private");
const PrivatePhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", PrivatePhoto, "select");
await photo.triggerHoverAction("uid", PrivatePhoto, "select");
await menu.openPage("video");
const Video = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Video, "select");
await photo.triggerHoverAction("uid", Video, "select");
await menu.openPage("calendar");
await toolbar.search("January 2017");
await album.openNthAlbum(0);
const CalendarPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", CalendarPhoto, "select");
await photo.triggerHoverAction("uid", CalendarPhoto, "select");
await menu.openPage("moments");
await album.openNthAlbum(0);
const MomentPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", MomentPhoto, "select");
await photo.triggerHoverAction("uid", MomentPhoto, "select");
await menu.openPage("states");
await toolbar.search("Western Cape");
await album.openNthAlbum(0);
const StatesPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", StatesPhoto, "select");
await photo.triggerHoverAction("uid", StatesPhoto, "select");
await menu.openPage("labels");
await toolbar.search("Seashore");
await label.openNthLabel(0);
const LabelPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", LabelPhoto, "select");
await photo.triggerHoverAction("uid", LabelPhoto, "select");
await menu.openPage("people");
await subject.openNthSubject(1);
const SubjectPhoto = await photo.getNthPhotoUid("all", 1);
await photoviews.triggerHoverAction("uid", SubjectPhoto, "select");
await photo.triggerHoverAction("uid", SubjectPhoto, "select");
await menu.openPage("folders");
await toolbar.search("archive");
await album.openNthAlbum(0);
const FolderPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", FolderPhoto, "select");
await photo.triggerHoverAction("uid", FolderPhoto, "select");
await contextmenu.checkContextMenuCount("14");
await contextmenu.triggerContextMenuAction("archive", "", "");
await menu.openPage("archive");
@ -293,20 +285,20 @@ test.meta("testID", "photos-013")(
await photo.checkPhotoVisibility(FolderPhoto, false);
await menu.openPage("archive");
await photoviews.triggerHoverAction("uid", MonochromePhoto, "select");
await photoviews.triggerHoverAction("uid", PanoramaPhoto, "select");
await photoviews.triggerHoverAction("uid", StackedPhoto, "select");
await photoviews.triggerHoverAction("uid", ScannedPhoto, "select");
await photoviews.triggerHoverAction("uid", FavoritesPhoto, "select");
await photoviews.triggerHoverAction("uid", ReviewPhoto, "select");
await photoviews.triggerHoverAction("uid", PrivatePhoto, "select");
await photoviews.triggerHoverAction("uid", Video, "select");
await photoviews.triggerHoverAction("uid", CalendarPhoto, "select");
await photoviews.triggerHoverAction("uid", MomentPhoto, "select");
await photoviews.triggerHoverAction("uid", StatesPhoto, "select");
await photoviews.triggerHoverAction("uid", LabelPhoto, "select");
await photoviews.triggerHoverAction("uid", SubjectPhoto, "select");
await photoviews.triggerHoverAction("uid", FolderPhoto, "select");
await photo.triggerHoverAction("uid", MonochromePhoto, "select");
await photo.triggerHoverAction("uid", PanoramaPhoto, "select");
await photo.triggerHoverAction("uid", StackedPhoto, "select");
await photo.triggerHoverAction("uid", ScannedPhoto, "select");
await photo.triggerHoverAction("uid", FavoritesPhoto, "select");
await photo.triggerHoverAction("uid", ReviewPhoto, "select");
await photo.triggerHoverAction("uid", PrivatePhoto, "select");
await photo.triggerHoverAction("uid", Video, "select");
await photo.triggerHoverAction("uid", CalendarPhoto, "select");
await photo.triggerHoverAction("uid", MomentPhoto, "select");
await photo.triggerHoverAction("uid", StatesPhoto, "select");
await photo.triggerHoverAction("uid", LabelPhoto, "select");
await photo.triggerHoverAction("uid", SubjectPhoto, "select");
await photo.triggerHoverAction("uid", FolderPhoto, "select");
await contextmenu.checkContextMenuCount("14");
await contextmenu.triggerContextMenuAction("restore", "", "");
@ -324,58 +316,58 @@ test.meta("testID", "photos-014")(
const InitialPhotoCountInPrivate = await photo.getPhotoCount("all");
await menu.openPage("monochrome");
const MonochromePhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", MonochromePhoto, "select");
await photo.triggerHoverAction("uid", MonochromePhoto, "select");
await menu.openPage("panoramas");
const PanoramaPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", PanoramaPhoto, "select");
await photo.triggerHoverAction("uid", PanoramaPhoto, "select");
await menu.openPage("stacks");
const StackedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", StackedPhoto, "select");
await photo.triggerHoverAction("uid", StackedPhoto, "select");
await menu.openPage("scans");
const ScannedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", ScannedPhoto, "select");
await photo.triggerHoverAction("uid", ScannedPhoto, "select");
await menu.openPage("review");
const ReviewPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", ReviewPhoto, "select");
await photo.triggerHoverAction("uid", ReviewPhoto, "select");
await menu.openPage("favorites");
const FavoritesPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", FavoritesPhoto, "select");
await photo.triggerHoverAction("uid", FavoritesPhoto, "select");
await menu.openPage("video");
const Video = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Video, "select");
await photo.triggerHoverAction("uid", Video, "select");
await menu.openPage("albums");
await toolbar.search("Holiday");
await album.openNthAlbum(0);
const AlbumPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", AlbumPhoto, "select");
await photo.triggerHoverAction("uid", AlbumPhoto, "select");
await menu.openPage("calendar");
await toolbar.search("January 2017");
await album.openNthAlbum(0);
const CalendarPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", CalendarPhoto, "select");
await photo.triggerHoverAction("uid", CalendarPhoto, "select");
await menu.openPage("moments");
await album.openNthAlbum(0);
const MomentPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", MomentPhoto, "select");
await photo.triggerHoverAction("uid", MomentPhoto, "select");
await menu.openPage("states");
await toolbar.search("Western Cape");
await album.openNthAlbum(0);
const StatesPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", StatesPhoto, "select");
await photo.triggerHoverAction("uid", StatesPhoto, "select");
await menu.openPage("labels");
await toolbar.search("Seashore");
await label.openNthLabel(0);
const LabelPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", LabelPhoto, "select");
await photo.triggerHoverAction("uid", LabelPhoto, "select");
await menu.openPage("people");
await subject.openNthSubject(1);
const SubjectPhoto = await photo.getNthPhotoUid("all", 1);
await photoviews.triggerHoverAction("uid", SubjectPhoto, "select");
await photo.triggerHoverAction("uid", SubjectPhoto, "select");
await menu.openPage("folders");
await toolbar.search("archive");
await album.openNthAlbum(0);
const FolderPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", FolderPhoto, "select");
await photo.triggerHoverAction("uid", FolderPhoto, "select");
await contextmenu.checkContextMenuCount("14");
await contextmenu.triggerContextMenuAction("private", "", "");
await menu.openPage("private");
@ -416,20 +408,20 @@ test.meta("testID", "photos-014")(
await photo.checkPhotoVisibility(FolderPhoto, false);
await menu.openPage("private");
await photoviews.triggerHoverAction("uid", MonochromePhoto, "select");
await photoviews.triggerHoverAction("uid", PanoramaPhoto, "select");
await photoviews.triggerHoverAction("uid", StackedPhoto, "select");
await photoviews.triggerHoverAction("uid", ScannedPhoto, "select");
await photoviews.triggerHoverAction("uid", FavoritesPhoto, "select");
await photoviews.triggerHoverAction("uid", ReviewPhoto, "select");
await photoviews.triggerHoverAction("uid", Video, "select");
await photoviews.triggerHoverAction("uid", CalendarPhoto, "select");
await photoviews.triggerHoverAction("uid", AlbumPhoto, "select");
await photoviews.triggerHoverAction("uid", MomentPhoto, "select");
await photoviews.triggerHoverAction("uid", StatesPhoto, "select");
await photoviews.triggerHoverAction("uid", LabelPhoto, "select");
await photoviews.triggerHoverAction("uid", SubjectPhoto, "select");
await photoviews.triggerHoverAction("uid", FolderPhoto, "select");
await photo.triggerHoverAction("uid", MonochromePhoto, "select");
await photo.triggerHoverAction("uid", PanoramaPhoto, "select");
await photo.triggerHoverAction("uid", StackedPhoto, "select");
await photo.triggerHoverAction("uid", ScannedPhoto, "select");
await photo.triggerHoverAction("uid", FavoritesPhoto, "select");
await photo.triggerHoverAction("uid", ReviewPhoto, "select");
await photo.triggerHoverAction("uid", Video, "select");
await photo.triggerHoverAction("uid", CalendarPhoto, "select");
await photo.triggerHoverAction("uid", AlbumPhoto, "select");
await photo.triggerHoverAction("uid", MomentPhoto, "select");
await photo.triggerHoverAction("uid", StatesPhoto, "select");
await photo.triggerHoverAction("uid", LabelPhoto, "select");
await photo.triggerHoverAction("uid", SubjectPhoto, "select");
await photo.triggerHoverAction("uid", FolderPhoto, "select");
await contextmenu.checkContextMenuCount("14");
await contextmenu.triggerContextMenuAction("private", "", "");
await toolbar.triggerToolbarAction("reload", "");

View file

@ -5,8 +5,7 @@ import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import PhotoViewer from "../page-model/photoviewer";
import NewPage from "../page-model/page";
import PhotoViews from "../page-model/photo-views";
import Page from "../page-model/page";
const logger = RequestLogger(/http:\/\/localhost:2343\/api\/v1\/*/, {
logResponseHeaders: true,
@ -21,8 +20,7 @@ const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const page = new Page();
//TODO Make those run from within the container
test.meta("testID", "photos-download-001")(
@ -30,14 +28,14 @@ test.meta("testID", "photos-download-001")(
async (t) => {
await toolbar.search("name:monochrome-2.jpg");
const Photo = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Photo, "select");
await photo.triggerHoverAction("uid", Photo, "select");
await logger.clear();
await contextmenu.triggerContextMenuAction("download", "", "");
const requestInfo = await logger.requests[1].response;
console.log(requestInfo);
const requestInfo0 = await logger.requests[0].response;
console.log(requestInfo0);
await newpage.validateDownloadRequest(requestInfo, "monochrome-2", ".jpg");
await page.validateDownloadRequest(requestInfo, "monochrome-2", ".jpg");
await logger.clear();
await contextmenu.clearSelection();
await toolbar.search("name:IMG_20200711_174006.jpg");
@ -54,14 +52,14 @@ test.meta("testID", "photos-download-001")(
test.meta("testID", "photos-download-002")("Test download video from context menu", async (t) => {
await toolbar.search("name:Mohn.mp4");
const Photo = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Photo, "select");
await photo.triggerHoverAction("uid", Photo, "select");
await logger.clear();
await contextmenu.triggerContextMenuAction("download", "", "");
const requestInfo = await logger.requests[0].response;
console.log(requestInfo);
const requestInfo2 = await logger.requests[1].response;
await newpage.validateDownloadRequest(requestInfo, "Mohn", ".mp4.jpg");
await newpage.validateDownloadRequest(requestInfo2, "Mohn", ".mp4");
await page.validateDownloadRequest(requestInfo, "Mohn", ".mp4.jpg");
await page.validateDownloadRequest(requestInfo2, "Mohn", ".mp4");
await logger.clear();
await contextmenu.clearSelection();
});
@ -71,15 +69,15 @@ test.meta("testID", "photos-download-003")(
async (t) => {
await toolbar.search("name:panorama_2.jpg");
const Photo = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Photo, "select");
await photo.triggerHoverAction("uid", Photo, "select");
await toolbar.search("name:IMG_6478.JPG");
const SecondPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await logger.clear();
await contextmenu.triggerContextMenuAction("download", "", "");
const requestInfo = await logger.requests[1].response;
console.log(requestInfo);
await newpage.validateDownloadRequest(requestInfo, "photoprism-download", ".zip");
await page.validateDownloadRequest(requestInfo, "photoprism-download", ".zip");
await logger.clear();
await contextmenu.clearSelection();
}
@ -91,11 +89,11 @@ test.meta("testID", "photos-download-004")(
async (t) => {
await toolbar.search("name:elephantRAW");
const Photo = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", Photo, "select");
await photo.triggerHoverAction("uid", Photo, "select");
await logger.clear();
await contextmenu.triggerContextMenuAction("download", "", "");
const requestInfo = await logger.requests[1].response;
await newpage.validateDownloadRequest(requestInfo, "elephantRAW", ".JPG");
await page.validateDownloadRequest(requestInfo, "elephantRAW", ".JPG");
await logger.clear();
await contextmenu.clearSelection();
await t.click(Selector("div").withAttribute("data-uid", Photo));
@ -104,7 +102,7 @@ test.meta("testID", "photos-download-004")(
await t.click(Selector(".action-download"));
const requestInfo3 = await logger.requests[1].response;
//const requestInfo4 = await logger.requests[2].response;
await newpage.validateDownloadRequest(requestInfo3, "elephantRAW", ".JPG");
await page.validateDownloadRequest(requestInfo3, "elephantRAW", ".JPG");
//await page.validateDownloadRequest(requestInfo4, "elephantRAW", ".mp4");
await logger.clear();
}

View file

@ -5,8 +5,7 @@ import Menu from "../page-model/menu";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import PhotoViews from "../page-model/photo-views";
import Page from "../page-model/page";
import PhotoEdit from "../page-model/photo-edit";
import Originals from "../page-model/originals";
import Album from "../page-model/album";
@ -18,8 +17,7 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const page = new Page();
const photoedit = new PhotoEdit();
const originals = new Originals();
@ -43,7 +41,7 @@ test.meta("testID", "photos-upload-delete-001")("Upload + Delete jpg/json", asyn
await t.expect(FileCount).eql(2);
await menu.openPage("browse");
await toolbar.search("digikam");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t
.click("#tab-files")
@ -59,7 +57,7 @@ test.meta("testID", "photos-upload-delete-001")("Upload + Delete jpg/json", asyn
}
await contextmenu.triggerContextMenuAction("archive", "", "");
await menu.openPage("archive");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("delete", "", "");
await menu.openPage("browse");
await toolbar.search("digikam");
@ -90,7 +88,7 @@ test.meta("testID", "photos-upload-delete-002")("Upload + Delete video", async (
await t.expect(FileCount).eql(1);
await menu.openPage("browse");
await toolbar.search("korn");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await t
.click("#tab-files")
@ -108,7 +106,7 @@ test.meta("testID", "photos-upload-delete-002")("Upload + Delete video", async (
}
await contextmenu.triggerContextMenuAction("archive", "", "");
await menu.openPage("archive");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("delete", "", "");
await menu.openPage("browse");
await toolbar.search("korn");
@ -137,7 +135,7 @@ test.meta("testID", "photos-upload-delete-003")("Upload to existing Album + Dele
await toolbar.triggerToolbarAction("upload", "");
await t
.click(Selector(".input-albums"))
.click(newpage.selectOption.withText("Christmas"))
.click(page.selectOption.withText("Christmas"))
.setFilesToUpload(Selector(".input-upload"), ["./upload-files/ladybug.jpg"])
.wait(15000);
const PhotoCountAfterUpload = await photo.getPhotoCount("all");
@ -145,10 +143,10 @@ test.meta("testID", "photos-upload-delete-003")("Upload to existing Album + Dele
await menu.openPage("browse");
await toolbar.search("ladybug");
const UploadedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("archive", "", "");
await menu.openPage("archive");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("delete", "", "");
await menu.openPage("browse");
await toolbar.search("ladybug");
@ -184,10 +182,10 @@ test.meta("testID", "photos-upload-delete-004")("Upload jpg to new Album + Delet
await menu.openPage("browse");
await toolbar.search("digikam");
const UploadedPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("archive", "", "");
await menu.openPage("archive");
await photoviews.triggerHoverAction("uid", UploadedPhoto, "select");
await photo.triggerHoverAction("uid", UploadedPhoto, "select");
await contextmenu.triggerContextMenuAction("delete", "", "");
await menu.openPage("browse");
await toolbar.search("digikam");

View file

@ -6,8 +6,7 @@ import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import PhotoViewer from "../page-model/photoviewer";
import NewPage from "../page-model/page";
import PhotoViews from "../page-model/photo-views";
import Page from "../page-model/page";
import PhotoEdit from "../page-model/photo-edit";
const scroll = ClientFunction((x, y) => window.scrollTo(x, y));
@ -20,8 +19,7 @@ const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const page = new Page();
const photoedit = new PhotoEdit();
test.meta("testID", "photos-001")("Scroll to top", async (t) => {
@ -48,8 +46,8 @@ test.meta("testID", "photos-002")(
await photoviewer.openPhotoViewer("uid", SecondPhoto);
await photoviewer.checkPhotoViewerActionAvailability("download", true);
await photoviewer.triggerPhotoViewerAction("close");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.checkContextMenuCount("2");
await contextmenu.checkContextMenuActionAvailability("download", true);
}
@ -66,7 +64,7 @@ test.meta("testID", "photos-003")(
await photo.checkPhotoVisibility(FirstPhoto, false);
await photo.checkPhotoVisibility(SecondPhoto, false);
await menu.openPage("review");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await t.click(photoedit.detailsClose);
if (t.browser.platform === "mobile") {
@ -82,7 +80,7 @@ test.meta("testID", "photos-003")(
} else {
await t.click(photoedit.detailsDone);
}
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await t
.typeText(Selector('input[aria-label="Latitude"]'), "9.999", { replace: true })
@ -120,9 +118,9 @@ test.meta("testID", "photos-004")("Like/dislike photo/video", async (t) => {
await photo.checkPhotoVisibility(SecondPhoto, false);
await photo.checkPhotoVisibility(FirstVideo, false);
await menu.openPage("browse");
await photoviews.triggerHoverAction("uid", FirstPhoto, "favorite");
await photoviews.triggerHoverAction("uid", FirstVideo, "favorite");
await photoviews.triggerHoverAction("uid", SecondPhoto, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "favorite");
await photo.triggerHoverAction("uid", FirstVideo, "favorite");
await photo.triggerHoverAction("uid", SecondPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await photoedit.turnSwitchOn("favorite");
await t.click(photoedit.dialogClose);
@ -134,8 +132,8 @@ test.meta("testID", "photos-004")("Like/dislike photo/video", async (t) => {
await photo.checkPhotoVisibility(FirstPhoto, true);
await photo.checkPhotoVisibility(FirstVideo, true);
await photo.checkPhotoVisibility(SecondPhoto, true);
await photoviews.triggerHoverAction("uid", SecondPhoto, "favorite");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", SecondPhoto, "favorite");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await photoedit.turnSwitchOff("favorite");
await t.click(photoedit.dialogClose);
@ -157,7 +155,7 @@ test.meta("testID", "photos-005")("Edit photo/video", async (t) => {
await toolbar.setFilter("view", "Cards");
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
await t
.click(newpage.cardTitle.withAttribute("data-uid", FirstPhoto))
.click(page.cardTitle.withAttribute("data-uid", FirstPhoto))
.expect(Selector('input[aria-label="Latitude"]').visible)
.ok();
await t.click(photoedit.dialogNext);
@ -228,9 +226,9 @@ test.meta("testID", "photos-005")("Edit photo/video", async (t) => {
await toolbar.triggerToolbarAction("reload", "");
}
await t
.expect(newpage.cardTitle.withAttribute("data-uid", FirstPhoto).innerText)
.expect(page.cardTitle.withAttribute("data-uid", FirstPhoto).innerText)
.eql("New Photo Title");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await contextmenu.triggerContextMenuAction("edit", "", "");
await photoedit.checkEditFormValues(
"New Photo Title",
@ -287,7 +285,7 @@ test.meta("testID", "photos-005")("Edit photo/video", async (t) => {
test.meta("testID", "photos-006")("Navigate from card view to place", async (t) => {
await toolbar.setFilter("view", "Cards");
await t
.click(newpage.cardLocation.nth(0))
.click(page.cardLocation.nth(0))
.expect(Selector("#map").exists, { timeout: 15000 })
.ok()
.expect(Selector("div.p-map-control").visible)
@ -306,8 +304,8 @@ test.meta("testID", "photos-007")("Mark photos/videos as panorama/scan", async (
await photo.checkPhotoVisibility(FirstPhoto, false);
await photo.checkPhotoVisibility(FirstVideo, false);
await menu.openPage("browse");
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await photoedit.turnSwitchOn("scan");
await photoedit.turnSwitchOn("panorama");
@ -324,8 +322,8 @@ test.meta("testID", "photos-007")("Mark photos/videos as panorama/scan", async (
await menu.openPage("panoramas");
await photo.checkPhotoVisibility(FirstPhoto, true);
await photo.checkPhotoVisibility(FirstVideo, true);
await photoviews.triggerHoverAction("uid", FirstPhoto, "select");
await photoviews.triggerHoverAction("uid", FirstVideo, "select");
await photo.triggerHoverAction("uid", FirstPhoto, "select");
await photo.triggerHoverAction("uid", FirstVideo, "select");
await contextmenu.triggerContextMenuAction("edit", "");
await photoedit.turnSwitchOff("scan");
await photoedit.turnSwitchOff("panorama");

View file

@ -4,8 +4,7 @@ import Menu from "../../page-model/menu";
import Toolbar from "../../page-model/toolbar";
import ContextMenu from "../../page-model/context-menu";
import PhotoViewer from "../../page-model/photoviewer";
import NewPage from "../../page-model/page";
import PhotoViews from "../../page-model/photo-views";
import Page from "../../page-model/page";
import PhotoEdit from "../../page-model/photo-edit";
import Album from "../../page-model/album";
import Settings from "../../page-model/settings";
@ -16,8 +15,7 @@ const menu = new Menu();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const page = new Page();
const photoedit = new PhotoEdit();
const album = new Album();
const settings = new Settings();
@ -26,7 +24,7 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
await toolbar.checkToolbarActionAvailability("upload", true);
await t.expect(Selector(".nav-browse").innerText).contains("Search").navigateTo("/browse");
await toolbar.search("photo:true stack:true");
await photoviews.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.checkContextMenuActionAvailability("download", true);
await contextmenu.checkContextMenuActionAvailability("share", true);
await contextmenu.checkContextMenuActionAvailability("edit", true);
@ -47,9 +45,9 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
await photoviewer.checkPhotoViewerActionAvailability("download", true);
await photoviewer.triggerPhotoViewerAction("close");
await t
.expect(newpage.cardLocation.visible)
.expect(page.cardLocation.visible)
.ok()
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.expect(Selector(".input-title input", { timeout: 8000 }).hasAttribute("disabled"))
.notOk()
.click(Selector("#tab-labels"))
@ -64,7 +62,7 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.expect(Selector("#tab-library-logs a").visible)
.ok();
await menu.openPage("archive");
await photoviews.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.checkContextMenuActionAvailability("delete", true);
await contextmenu.clearSelection();
await menu.checkMenuItemAvailability("archive", true);
@ -143,7 +141,7 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
await toolbar.checkToolbarActionAvailability("upload", false);
await t.expect(Selector(".nav-browse").innerText).contains("Suche");
await toolbar.search("photo:true stack:true");
await photoviews.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.checkContextMenuActionAvailability("download", false);
await contextmenu.checkContextMenuActionAvailability("share", false);
await contextmenu.checkContextMenuActionAvailability("edit", false);
@ -151,7 +149,7 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
await contextmenu.checkContextMenuActionAvailability("archive", false);
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.click(Selector("#tab-files"))
.expect(photoedit.downloadFile.nth(0).visible)
.notOk()
@ -167,9 +165,9 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
await photoviewer.checkPhotoViewerActionAvailability("edit", true);
await photoviewer.triggerPhotoViewerAction("close");
await t
.expect(newpage.cardLocation.exists)
.expect(page.cardLocation.exists)
.notOk()
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.expect(Selector(".input-title input").hasAttribute("disabled"))
.ok()
.expect(Selector(".input-latitude input").hasAttribute("disabled"))
@ -222,7 +220,7 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.click(Selector("#tab-settings-library"))
.click(settings.reviewCheckbox);
await menu.openPage("archive");
await photoviews.triggerHoverAction("nth", 0, "select");
await photo.triggerHoverAction("nth", 0, "select");
await contextmenu.checkContextMenuActionAvailability("restore", true);
await contextmenu.checkContextMenuActionAvailability("delete", false);
await contextmenu.clearSelection();

View file

@ -4,8 +4,7 @@ import Menu from "../page-model/menu";
import Toolbar from "../page-model/toolbar";
import Photo from "../page-model/photo";
import PhotoViewer from "../page-model/photoviewer";
import NewPage from "../page-model/page";
import PhotoViews from "../page-model/photo-views";
import Page from "../page-model/page";
import PhotoEdit from "../page-model/photo-edit";
import Library from "../page-model/library";
@ -15,25 +14,24 @@ const menu = new Menu();
const toolbar = new Toolbar();
const photo = new Photo();
const photoviewer = new PhotoViewer();
const newpage = new NewPage();
const photoviews = new PhotoViews();
const page = new Page();
const photoedit = new PhotoEdit();
const library = new Library();
test.meta("testID", "stacks-001")("Change primary file", async (t) => {
await toolbar.search("ski");
const SequentialPhoto = await photo.getNthPhotoUid("all", 0);
await photoviews.checkHoverActionAvailability("uid", SequentialPhoto, "open", true);
await photo.checkHoverActionAvailability("uid", SequentialPhoto, "open", true);
if (t.browser.platform === "desktop") {
console.log(t.browser.platform);
await photoviews.triggerHoverAction("nth", 0, "open");
await photo.triggerHoverAction("nth", 0, "open");
await photoviewer.triggerPhotoViewerAction("next");
await photoviewer.triggerPhotoViewerAction("previous");
await photoviewer.triggerPhotoViewerAction("close");
}
await toolbar.setFilter("view", "Cards");
await t
.click(newpage.cardTitle.withAttribute("data-uid", SequentialPhoto))
.click(page.cardTitle.withAttribute("data-uid", SequentialPhoto))
.click(Selector("#tab-files"));
const FirstFileName = await Selector("div.caption").nth(0).innerText;
await t
@ -42,7 +40,7 @@ test.meta("testID", "stacks-001")("Change primary file", async (t) => {
.click(photoedit.toggleExpandFile.nth(1))
.click(photoedit.makeFilePrimary)
.click(photoedit.dialogClose)
.click(newpage.cardTitle.withAttribute("data-uid", SequentialPhoto));
.click(page.cardTitle.withAttribute("data-uid", SequentialPhoto));
const FirstFileNameAfterChange = await Selector("div.caption").nth(0).innerText;
await t
.expect(FirstFileNameAfterChange)
@ -58,9 +56,9 @@ test.meta("testID", "stacks-002")("Ungroup files", async (t) => {
const SequentialPhoto = await photo.getNthPhotoUid("all", 0);
await t.expect(PhotoCount).eql(1);
await menu.openPage("stacks");
await photoviews.checkHoverActionAvailability("uid", SequentialPhoto, "open", true);
await photo.checkHoverActionAvailability("uid", SequentialPhoto, "open", true);
await t
.click(newpage.cardTitle.withAttribute("data-uid", SequentialPhoto))
.click(page.cardTitle.withAttribute("data-uid", SequentialPhoto))
.click(Selector("#tab-files"))
.click(photoedit.toggleExpandFile.nth(0))
.click(photoedit.toggleExpandFile.nth(1))
@ -83,7 +81,7 @@ test.meta("testID", "stacks-003")("Delete non primary file", async (t) => {
await t
.click(Selector("#tab-library-import"))
.click(library.openImportFolderSelect, { timeout: 5000 })
.click(newpage.selectOption.withText("/pizza"))
.click(page.selectOption.withText("/pizza"))
.click(library.import)
.wait(10000);
await menu.openPage("browse");
@ -94,7 +92,7 @@ test.meta("testID", "stacks-003")("Delete non primary file", async (t) => {
await t
.expect(PhotoCount)
.eql(1)
.click(newpage.cardTitle.withAttribute("data-uid", Photo))
.click(page.cardTitle.withAttribute("data-uid", Photo))
.click(Selector("#tab-files"));
const FileCount = await photoedit.getFileCount();
await t

View file

@ -5,7 +5,7 @@ import Album from "../page-model/album";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
import Photo from "../page-model/photo";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test states`.page`${testcafeconfig.url}`;
@ -14,16 +14,16 @@ const album = new Album();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
const photo = new Photo();
const newpage = new NewPage();
const page = new Page();
test.meta("testID", "states-001")("Update state", async (t) => {
await menu.openPage("states");
await toolbar.search("Canada");
const AlbumUid = await album.getNthAlbumUid("all", 0);
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("British Columbia")
.click(newpage.cardTitle.nth(0))
.click(page.cardTitle.nth(0))
.expect(Selector(".input-title input").value)
.eql("British Columbia")
.expect(Selector(".input-location input").value)
@ -38,9 +38,9 @@ test.meta("testID", "states-001")("Update state", async (t) => {
.typeText(Selector(".input-category input"), "Mountains")
.pressKey("enter")
.click(".action-confirm")
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("Wonderland")
.expect(newpage.cardDescription.nth(0).innerText)
.expect(page.cardDescription.nth(0).innerText)
.contains("We love earth")
.expect(Selector("div.caption").nth(1).innerText)
.contains("Mountains")
@ -55,7 +55,7 @@ test.meta("testID", "states-001")("Update state", async (t) => {
} else {
await toolbar.setFilter("category", "Mountains");
}
await t.expect(newpage.cardTitle.nth(0).innerText).contains("Wonderland");
await t.expect(page.cardTitle.nth(0).innerText).contains("Wonderland");
await album.openAlbumWithUid(AlbumUid);
await toolbar.triggerToolbarAction("edit", "");
await t
@ -77,9 +77,9 @@ test.meta("testID", "states-001")("Update state", async (t) => {
await menu.openPage("states");
await toolbar.search("Canada");
await t
.expect(newpage.cardTitle.nth(0).innerText)
.expect(page.cardTitle.nth(0).innerText)
.contains("British Columbia / Canada")
.expect(newpage.cardDescription.innerText)
.expect(page.cardDescription.innerText)
.notContains("We love earth")
.expect(Selector("div.caption").nth(0).innerText)
.notContains("Earth");
@ -87,7 +87,7 @@ test.meta("testID", "states-001")("Update state", async (t) => {
//TODO test that sharing link works as expected
test.meta("testID", "states-003")("Create, Edit, delete sharing link", async (t) => {
await newpage.testCreateEditDeleteSharingLink("states");
await page.testCreateEditDeleteSharingLink("states");
});
test.meta("testID", "states-004")("Create/delete album-clone from state", async (t) => {

View file

@ -9,7 +9,7 @@ import PhotoViews from "../page-model/photo-views";
import Label from "../page-model/label";
import Album from "../page-model/album";
import Subject from "../page-model/subject";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test admin role`.page`${testcafeconfig.url}`;
@ -21,7 +21,7 @@ const photoviews = new PhotoViews();
const label = new Label();
const album = new Album();
const subject = new Subject();
const newpage = new NewPage();
const page = new Page();
const getLocation = ClientFunction(() => document.location.href);
@ -33,7 +33,7 @@ test.meta("testID", "authentication-000")(
);
test.meta("testID", "admin-role-001")("Access to settings", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.checkMenuItemAvailability("settings", true);
await t.navigateTo("/settings");
await t
@ -60,7 +60,7 @@ test.meta("testID", "admin-role-001")("Access to settings", async (t) => {
});
test.meta("testID", "admin-role-002")("Access to archive", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const PhotoCountBrowse = await photo.getPhotoCount("all");
await menu.checkMenuItemAvailability("archive", true);
await t.navigateTo("/archive");
@ -70,7 +70,7 @@ test.meta("testID", "admin-role-002")("Access to archive", async (t) => {
});
test.meta("testID", "admin-role-003")("Access to review", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const PhotoCountBrowse = await photo.getPhotoCount("all");
await menu.checkMenuItemAvailability("review", true);
await t.navigateTo("/review");
@ -80,7 +80,7 @@ test.meta("testID", "admin-role-003")("Access to review", async (t) => {
});
test.meta("testID", "admin-role-004")("Access to private", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const PhotoCountBrowse = await photo.getPhotoCount("all");
await menu.checkMenuItemAvailability("private", true);
await t.navigateTo("/private");
@ -90,7 +90,7 @@ test.meta("testID", "admin-role-004")("Access to private", async (t) => {
});
test.meta("testID", "admin-role-005")("Access to library", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const PhotoCountBrowse = await photo.getPhotoCount("all");
await menu.checkMenuItemAvailability("library", true);
await t.navigateTo("/library");
@ -130,7 +130,7 @@ test.meta("testID", "admin-role-005")("Access to library", async (t) => {
});
test.meta("testID", "admin-role-006")("private/archived photos in search results", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const PhotoCountBrowse = await photo.getPhotoCount("all");
await toolbar.search("private:true");
const PhotoCountPrivate = await photo.getPhotoCount("all");
@ -180,7 +180,7 @@ test.meta("testID", "admin-role-006")("private/archived photos in search results
});
test.meta("testID", "admin-role-007")("Upload functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await toolbar.checkToolbarActionAvailability("upload", true);
await menu.openPage("albums");
await toolbar.checkToolbarActionAvailability("upload", true);
@ -211,7 +211,7 @@ test.meta("testID", "admin-role-007")("Upload functionality", async (t) => {
test.meta("testID", "admin-role-008")(
"Admin can private, archive, share, add/remove to album",
async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
await photo.selectPhotoFromUID(FirstPhoto);
await contextmenu.checkContextMenuActionAvailability("private", true);
@ -220,7 +220,7 @@ test.meta("testID", "admin-role-008")(
await contextmenu.checkContextMenuActionAvailability("album", true);
await contextmenu.clearSelection();
await toolbar.setFilter("view", "List");
await photoviews.checkListViewActionAvailability("private", false);
await photo.checkListViewActionAvailability("private", false);
await menu.openPage("albums");
await album.openNthAlbum(0);
await toolbar.checkToolbarActionAvailability("share", true);
@ -231,12 +231,12 @@ test.meta("testID", "admin-role-008")(
await contextmenu.checkContextMenuActionAvailability("album", true);
await contextmenu.clearSelection();
await toolbar.triggerToolbarAction("list-view", "");
await photoviews.checkListViewActionAvailability("private", false);
await photo.checkListViewActionAvailability("private", false);
}
);
test.meta("testID", "admin-role-009")("Admin can approve low quality photos", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await toolbar.search('quality:0 name:"photos-013_1"');
await photo.toggleSelectNthPhoto(0, "all");
await contextmenu.triggerContextMenuAction("edit", "", "");
@ -244,7 +244,7 @@ test.meta("testID", "admin-role-009")("Admin can approve low quality photos", as
});
test.meta("testID", "admin-role-010")("Edit dialog is not read only for admin", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await toolbar.search("faces:new");
//details
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
@ -339,7 +339,7 @@ test.meta("testID", "admin-role-010")("Edit dialog is not read only for admin",
});
test.meta("testID", "admin-role-011")("Edit labels functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("labels");
const FirstLabel = await label.getNthLabeltUid(0);
await label.checkHoverActionState("uid", FirstLabel, "favorite", false);
@ -357,7 +357,7 @@ test.meta("testID", "admin-role-011")("Edit labels functionality", async (t) =>
});
test.meta("testID", "admin-role-012")("Edit album functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("albums");
await toolbar.checkToolbarActionAvailability("add", true);
await t.expect(Selector("a.is-album button.action-share").visible).ok();
@ -370,7 +370,7 @@ test.meta("testID", "admin-role-012")("Edit album functionality", async (t) => {
await contextmenu.checkContextMenuActionAvailability("delete", true);
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.ok()
.click(Selector("button.action-cancel"));
@ -399,7 +399,7 @@ test.meta("testID", "admin-role-012")("Edit album functionality", async (t) => {
});
test.meta("testID", "admin-role-013")("Edit moment functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("moments");
await t.expect(Selector("a.is-album button.action-share").visible).ok();
const FirstAlbum = await album.getNthAlbumUid("moment", 0);
@ -412,7 +412,7 @@ test.meta("testID", "admin-role-013")("Edit moment functionality", async (t) =>
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.ok()
.click(Selector("button.action-cancel"));
@ -441,7 +441,7 @@ test.meta("testID", "admin-role-013")("Edit moment functionality", async (t) =>
});
test.meta("testID", "admin-role-014")("Edit state functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("states");
await t.expect(Selector("a.is-album button.action-share").visible).ok();
const FirstAlbum = await album.getNthAlbumUid("state", 0);
@ -453,7 +453,7 @@ test.meta("testID", "admin-role-014")("Edit state functionality", async (t) => {
await contextmenu.checkContextMenuActionAvailability("delete", true);
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.ok()
.click(Selector("button.action-cancel"));
@ -482,7 +482,7 @@ test.meta("testID", "admin-role-014")("Edit state functionality", async (t) => {
});
test.meta("testID", "admin-role-015")("Edit calendar functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("calendar");
await t.expect(Selector("a.is-album button.action-share").visible).ok();
const FirstAlbum = await album.getNthAlbumUid("month", 0);
@ -494,7 +494,7 @@ test.meta("testID", "admin-role-015")("Edit calendar functionality", async (t) =
await contextmenu.checkContextMenuActionAvailability("delete", false);
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.ok()
.click(Selector("button.action-cancel"));
@ -522,7 +522,7 @@ test.meta("testID", "admin-role-015")("Edit calendar functionality", async (t) =
});
test.meta("testID", "admin-role-016")("Edit folder functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("folders");
await t.expect(Selector("a.is-album button.action-share").visible).ok();
const FirstAlbum = await album.getNthAlbumUid("folder", 0);
@ -534,7 +534,7 @@ test.meta("testID", "admin-role-016")("Edit folder functionality", async (t) =>
await contextmenu.checkContextMenuActionAvailability("delete", false);
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.ok()
.click(Selector("button.action-cancel"));
@ -562,7 +562,7 @@ test.meta("testID", "admin-role-016")("Edit folder functionality", async (t) =>
});
test.meta("testID", "admin-role-017")("Edit people functionality", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("people");
await toolbar.checkToolbarActionAvailability("show-hidden", true);
await t.expect(Selector("#tab-people_faces > a").exists).ok();

View file

@ -1,11 +1,11 @@
import { Selector } from "testcafe";
import testcafeconfig from "../acceptance/testcafeconfig";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
import Menu from "../page-model/menu";
fixture`Test authentication`.page`${testcafeconfig.url}`;
const newpage = new NewPage();
const page = new Page();
const menu = new Menu();
test.meta("testID", "authentication-000")(
@ -55,14 +55,14 @@ test.meta("testID", "authentication-001")("Login and Logout", async (t) => {
//TODO test all pages not accessible while logged out
test.meta("testID", "authentication-002")("Login with wrong credentials", async (t) => {
await newpage.login("wrong", "photoprism");
await page.login("wrong", "photoprism");
await t
.navigateTo("/favorites")
.expect(Selector(".input-name input").visible)
.ok()
.expect(Selector(".input-search input").visible)
.notOk();
await newpage.login("admin", "abcdefg");
await page.login("admin", "abcdefg");
await t
.navigateTo("/archive")
.expect(Selector(".input-name input").visible)
@ -72,7 +72,7 @@ test.meta("testID", "authentication-002")("Login with wrong credentials", async
});
test.meta("testID", "authentication-003")("Change password", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await t.expect(Selector(".input-search input").visible).ok();
await page.openNav();
await t
@ -98,14 +98,14 @@ test.meta("testID", "authentication-003")("Change password", async (t) => {
if (t.browser.platform === "mobile") {
await t.wait(7000);
}
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await t
.navigateTo("/archive")
.expect(Selector(".input-name input", { timeout: 7000 }).visible)
.ok()
.expect(Selector(".input-search input").visible)
.notOk();
await newpage.login("admin", "photoprism123");
await page.login("admin", "photoprism123");
await t.expect(Selector(".input-search input").visible).ok();
await page.openNav();
await t
@ -116,7 +116,7 @@ test.meta("testID", "authentication-003")("Change password", async (t) => {
.click(".action-confirm");
await page.openNav();
await t.click(Selector('div[title="Logout"]'));
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await t.expect(Selector(".input-search input").visible).ok();
await page.openNav();
await t.click(Selector('div[title="Logout"]'));

View file

@ -11,7 +11,7 @@ import Album from "../page-model/album";
import Subject from "../page-model/subject";
import PhotoViewer from "../page-model/photoviewer";
import PhotoEdit from "../page-model/photo-edit";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
fixture`Test member role`.page`${testcafeconfig.url}`;
@ -25,11 +25,11 @@ const album = new Album();
const subject = new Subject();
const photoviewer = new PhotoViewer();
const photoedit = new PhotoEdit();
const newpage = new NewPage();
const page = new Page();
const getLocation = ClientFunction(() => document.location.href);
test.meta("testID", "member-role-001")("No access to settings", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.checkMenuItemAvailability("settings", false);
await t.navigateTo("/settings");
await t
@ -55,7 +55,7 @@ test.meta("testID", "member-role-001")("No access to settings", async (t) => {
});
test.meta("testID", "member-role-002")("No access to archive", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
if (t.browser.platform === "mobile") {
await t.wait(5000);
}
@ -71,7 +71,7 @@ test.meta("testID", "member-role-002")("No access to archive", async (t) => {
});
test.meta("testID", "member-role-003")("No access to review", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
if (t.browser.platform === "mobile") {
await t.wait(5000);
}
@ -87,7 +87,7 @@ test.meta("testID", "member-role-003")("No access to review", async (t) => {
});
test.meta("testID", "member-role-004")("No access to private", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
if (t.browser.platform === "mobile") {
await t.wait(5000);
}
@ -103,7 +103,7 @@ test.meta("testID", "member-role-004")("No access to private", async (t) => {
});
test.meta("testID", "member-role-005")("No access to library", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
if (t.browser.platform === "mobile") {
await t.wait(5000);
}
@ -151,7 +151,7 @@ test.meta("testID", "member-role-005")("No access to library", async (t) => {
test.meta("testID", "member-role-006")(
"No private/archived photos in search results",
async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
if (t.browser.platform === "mobile") {
await t.wait(5000);
}
@ -208,7 +208,7 @@ test.meta("testID", "member-role-006")(
);
test.meta("testID", "member-role-007")("No upload functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await toolbar.checkToolbarActionAvailability("upload", false);
await menu.openPage("albums");
await toolbar.checkToolbarActionAvailability("upload", false);
@ -239,15 +239,15 @@ test.meta("testID", "member-role-007")("No upload functionality", async (t) => {
});
test.meta("testID", "member-role-008")("Member cannot like photos", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await t.wait(5000);
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
const SecondPhoto = await photo.getNthPhotoUid("all", 1);
await menu.openPage("favorites");
const FirstFavorite = await photo.getNthPhotoUid("image", 0);
await photoviews.checkHoverActionState("uid", FirstFavorite, "favorite", true);
await photoviews.triggerHoverAction("uid", FirstFavorite, "favorite");
await photoviews.checkHoverActionState("uid", FirstFavorite, "favorite", true);
await photo.checkHoverActionState("uid", FirstFavorite, "favorite", true);
await photo.triggerHoverAction("uid", FirstFavorite, "favorite");
await photo.checkHoverActionState("uid", FirstFavorite, "favorite", true);
await t
.expect(Selector("div").withAttribute("data-uid", FirstPhoto).exists, { timeout: 5000 })
.notOk()
@ -261,9 +261,9 @@ test.meta("testID", "member-role-008")("Member cannot like photos", async (t) =>
await photoviewer.triggerPhotoViewerAction("close");
await t.wait(5000).click(Selector(".p-expand-search", { timeout: 10000 }));
await toolbar.setFilter("view", "Cards");
await photoviews.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photoviews.triggerHoverAction("uid", FirstPhoto, "favorite");
await photoviews.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.triggerHoverAction("uid", FirstPhoto, "favorite");
await photo.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.selectPhotoFromUID(SecondPhoto);
await contextmenu.triggerContextMenuAction("edit", "", "");
await t
@ -273,30 +273,30 @@ test.meta("testID", "member-role-008")("Member cannot like photos", async (t) =>
await photoedit.turnSwitchOn("favorite");
await t.click(Selector(".action-close"));
await contextmenu.clearSelection();
await photoviews.checkHoverActionState("uid", SecondPhoto, "favorite", false);
await photo.checkHoverActionState("uid", SecondPhoto, "favorite", false);
await menu.openPage("browse");
await toolbar.setFilter("view", "Mosaic");
await photoviews.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photoviews.triggerHoverAction("uid", FirstPhoto, "favorite");
await photoviews.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.triggerHoverAction("uid", FirstPhoto, "favorite");
await photo.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await toolbar.setFilter("view", "List");
await photoviews.checkListViewActionAvailability("like", true);
await photoviews.triggerListViewActions("nth", 0, "like");
await photo.checkListViewActionAvailability("like", true);
await photo.triggerListViewActions("nth", 0, "like");
await toolbar.setFilter("view", "Cards");
await photoviews.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await photo.checkHoverActionState("uid", FirstPhoto, "favorite", false);
await menu.openPage("albums");
await t.click(Selector("a.is-album").nth(0));
await toolbar.triggerToolbarAction("list-view", "");
if (t.browser.platform === "mobile") {
await toolbar.triggerToolbarAction("list-view", "");
}
await photoviews.checkListViewActionAvailability("like", true);
await photo.checkListViewActionAvailability("like", true);
});
test.meta("testID", "member-role-009")(
"Member cannot private, archive, share, add/remove to album",
async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
await photo.selectPhotoFromUID(FirstPhoto);
await contextmenu.checkContextMenuActionAvailability("private", false);
@ -307,7 +307,7 @@ test.meta("testID", "member-role-009")(
await contextmenu.checkContextMenuActionAvailability("edit", true);
await contextmenu.clearSelection();
await toolbar.setFilter("view", "List");
await photoviews.checkListViewActionAvailability("private", true);
await photo.checkListViewActionAvailability("private", true);
await menu.openPage("albums");
await album.openNthAlbum(0);
await toolbar.checkToolbarActionAvailability("share", false);
@ -321,12 +321,12 @@ test.meta("testID", "member-role-009")(
if (t.browser.platform === "mobile") {
await toolbar.triggerToolbarAction("list-view", "");
}
await photoviews.checkListViewActionAvailability("private", true);
await photo.checkListViewActionAvailability("private", true);
}
);
test.meta("testID", "member-role-010")("Member cannot approve low quality photos", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await toolbar.search('quality:0 name:"photos-013_1"');
await photo.toggleSelectNthPhoto(0, "all");
await contextmenu.triggerContextMenuAction("edit", "", "");
@ -334,7 +334,7 @@ test.meta("testID", "member-role-010")("Member cannot approve low quality photos
});
test.meta("testID", "member-role-011")("Edit dialog is read only for member", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await toolbar.search("faces:new");
//details
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
@ -429,7 +429,7 @@ test.meta("testID", "member-role-011")("Edit dialog is read only for member", as
});
test.meta("testID", "member-role-012")("No edit album functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("albums");
await toolbar.checkToolbarActionAvailability("add", false);
await t.expect(Selector("a.is-album button.action-share").visible).notOk();
@ -443,7 +443,7 @@ test.meta("testID", "member-role-012")("No edit album functionality", async (t)
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.notOk();
if (await Selector(`a.uid-${FirstAlbum}`).hasClass("is-favorite")) {
@ -467,7 +467,7 @@ test.meta("testID", "member-role-012")("No edit album functionality", async (t)
});
test.meta("testID", "member-role-013")("No edit moment functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("moments");
await t.expect(Selector("a.is-album button.action-share").visible).notOk();
const FirstAlbum = await album.getNthAlbumUid("all", 0);
@ -480,7 +480,7 @@ test.meta("testID", "member-role-013")("No edit moment functionality", async (t)
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.notOk();
if (await Selector(`a.uid-${FirstAlbum}`).hasClass("is-favorite")) {
@ -504,7 +504,7 @@ test.meta("testID", "member-role-013")("No edit moment functionality", async (t)
});
test.meta("testID", "member-role-014")("No edit state functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("states");
await t.expect(Selector("a.is-album button.action-share").visible).notOk();
const FirstAlbum = await album.getNthAlbumUid("all", 0);
@ -517,7 +517,7 @@ test.meta("testID", "member-role-014")("No edit state functionality", async (t)
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.notOk();
if (await Selector(`a.uid-${FirstAlbum}`).hasClass("is-favorite")) {
@ -541,7 +541,7 @@ test.meta("testID", "member-role-014")("No edit state functionality", async (t)
});
test.meta("testID", "member-role-015")("No edit calendar functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("calendar");
await t.expect(Selector("a.is-album button.action-share").visible).notOk();
const FirstAlbum = await album.getNthAlbumUid("all", 0);
@ -554,7 +554,7 @@ test.meta("testID", "member-role-015")("No edit calendar functionality", async (
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.notOk();
if (await Selector(`a.uid-${FirstAlbum}`).hasClass("is-favorite")) {
@ -578,7 +578,7 @@ test.meta("testID", "member-role-015")("No edit calendar functionality", async (
});
test.meta("testID", "member-role-016")("No edit folder functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("folders");
await t.expect(Selector("a.is-album button.action-share").visible).notOk();
const FirstAlbum = await album.getNthAlbumUid("all", 0);
@ -591,7 +591,7 @@ test.meta("testID", "member-role-016")("No edit folder functionality", async (t)
await contextmenu.clearSelection();
await t
.click(newpage.cardTitle)
.click(page.cardTitle)
.expect(Selector(".input-description textarea").visible)
.notOk();
if (await Selector(`a.uid-${FirstAlbum}`).hasClass("is-favorite")) {
@ -615,7 +615,7 @@ test.meta("testID", "member-role-016")("No edit folder functionality", async (t)
});
test.meta("testID", "member-role-017")("No edit labels functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("labels");
const FirstLabel = await label.getNthLabeltUid(0);
await label.checkHoverActionState("uid", FirstLabel, "favorite", false);
@ -631,7 +631,7 @@ test.meta("testID", "member-role-017")("No edit labels functionality", async (t)
});
test.meta("testID", "member-role-018")("No unstack, change primary actions", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await toolbar.search("stack:true");
//details
const FirstPhoto = await photo.getNthPhotoUid("image", 0);
@ -657,7 +657,7 @@ test.meta("testID", "member-role-018")("No unstack, change primary actions", asy
});
test.meta("testID", "member-role-019")("No edit people functionality", async (t) => {
await newpage.login("member", "passwdmember");
await page.login("member", "passwdmember");
await menu.openPage("people");
await toolbar.checkToolbarActionAvailability("show-hidden", false);
await toolbar.checkToolbarActionAvailability("upload", false);

View file

@ -1,7 +1,7 @@
import { Selector } from "testcafe";
import { Role } from "testcafe";
import testcafeconfig from "../acceptance/testcafeconfig";
import NewPage from "../page-model/page";
import Page from "../page-model/page";
import Menu from "../page-model/menu";
import Toolbar from "../page-model/toolbar";
import ContextMenu from "../page-model/context-menu";
@ -12,7 +12,7 @@ import ShareDialog from "../page-model/dialog-share";
fixture`Test link sharing`.page`${testcafeconfig.url}`.skip("Urls are not working anymore");
const newpage = new NewPage();
const page = new Page();
const menu = new Menu();
const toolbar = new Toolbar();
const contextmenu = new ContextMenu();
@ -30,7 +30,7 @@ test.skip.meta("testID", "authentication-000")(
);
test.skip.meta("testID", "sharing-001")("View shared albums", async (t) => {
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("albums");
const FirstAlbum = await album.getNthAlbumUid("all", 0);
await album.triggerHoverAction("uid", FirstAlbum, "select");
@ -80,7 +80,7 @@ test.skip.meta("testID", "sharing-001")("View shared albums", async (t) => {
const countAlbumsAnonymous = await Selector("a.is-album").count;
await t.expect(countAlbumsAnonymous).eql(2);
await t.navigateTo("http://localhost:2343/browse");
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("albums");
await album.openAlbumWithUid(FirstAlbum);
await toolbar.triggerToolbarAction("share", "");
@ -95,7 +95,7 @@ test.skip.meta("testID", "sharing-001")("View shared albums", async (t) => {
const countAlbumsAnonymousAfterDelete = await album.getAlbumCount("all");
await t.expect(countAlbumsAnonymousAfterDelete).eql(1);
await t.navigateTo("http://localhost:2343/browse");
await newpage.login("admin", "photoprism");
await page.login("admin", "photoprism");
await menu.openPage("folders");
await album.openAlbumWithUid(FirstFolder);
await toolbar.triggerToolbarAction("share", "");
@ -123,7 +123,7 @@ test.skip.meta("testID", "sharing-002")("Verify anonymous user has limited optio
await toolbar.checkToolbarActionAvailability("upload", false);
await toolbar.checkToolbarActionAvailability("reload", true);
await toolbar.checkToolbarActionAvailability("download", true);
await photoviews.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);
@ -131,7 +131,7 @@ test.skip.meta("testID", "sharing-002")("Verify anonymous user has limited optio
await contextmenu.checkContextMenuActionAvailability("share", false);
await contextmenu.checkContextMenuActionAvailability("album", false);
await contextmenu.clearSelection();
await t.expect(newpage.cardTitle.visible).notOk();
await t.expect(page.cardTitle.visible).notOk();
await photoviewer.openPhotoViewer("nth", 0);
await photoviewer.checkPhotoViewerActionAvailability("download", true);
await photoviewer.checkPhotoViewerActionAvailability("select", true);
@ -140,8 +140,8 @@ test.skip.meta("testID", "sharing-002")("Verify anonymous user has limited optio
await photoviewer.checkPhotoViewerActionAvailability("like", false);
await photoviewer.checkPhotoViewerActionAvailability("edit", false);
await photoviewer.triggerPhotoViewerAction("close");
await photoviews.checkHoverActionAvailability("nth", 0, "favorite", false);
await photoviews.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 t
.expect(Selector(`td button.input-private`).visible)

View file

@ -50,4 +50,81 @@ export default class Page {
await t.expect(Selector("div.is-photo").withAttribute("data-uid", uid).exists).notOk();
}
}
async checkHoverActionAvailability(mode, uidOrNth, action, visible) {
if (mode === "uid") {
await t.hover(Selector("div.is-photo").withAttribute("data-uid", uidOrNth));
if (visible) {
await t.expect(Selector(`.uid-${uidOrNth} .input-` + action).visible).ok();
} else {
await t.expect(Selector(`.uid-${uidOrNth} .input-` + action).visible).notOk();
}
}
if (mode === "nth") {
await t.hover(Selector("div.is-photo").nth(uidOrNth));
if (visible) {
await t.expect(Selector(`div.is-photo .input-` + action).visible).ok();
} else {
await t.expect(Selector(`div.is-photo .input-` + action).visible).notOk();
}
}
}
async triggerHoverAction(mode, uidOrNth, action) {
if (mode === "uid") {
await t.hover(Selector("div.is-photo").withAttribute("data-uid", uidOrNth));
await t.click(Selector(`div.uid-${uidOrNth} .input-` + action));
}
if (mode === "nth") {
await t.hover(Selector("div.is-photo").nth(uidOrNth));
await t.click(Selector(`div.is-photo .input-` + action).nth(uidOrNth));
}
}
async checkHoverActionState(mode, uidOrNth, action, set) {
if (mode === "uid") {
await t.hover(Selector("div.is-photo").withAttribute("data-uid", uidOrNth));
if (set) {
await t.expect(Selector(`div.uid-${uidOrNth}`).hasClass("is-" + action)).ok();
} else {
await t.expect(Selector(`div.uid-${uidOrNth}`).hasClass("is-" + action)).notOk();
}
}
if (mode === "nth") {
await t.hover(Selector("div.is-photo").nth(uidOrNth));
if (set) {
await t
.expect(
Selector("div.is-photo")
.nth(uidOrNth)
.hasClass("is-" + action)
)
.ok();
} else {
await t
.expect(
Selector("div.is-photo")
.nth(uidOrNth)
.hasClass("is-" + action)
)
.notOk();
}
}
}
async triggerListViewActions(mode, uidOrnth, action) {
if (mode === "nth") {
await t.click(Selector(`td button.input-` + action).nth(uidOrnth));
} else if (mode === "uid") {
await t.click(Selector(`td button.input-` + action).withAttribute("data-uid", uidOrnth));
}
}
async checkListViewActionAvailability(action, disabled) {
if (disabled) {
await t.expect(Selector(`td button.input-` + action).hasAttribute("disabled")).ok();
} else {
await t.expect(Selector(`td button.input-` + action).hasAttribute("disabled")).notOk();
}
}
}