mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Tests: Refactor acceptance tests
This commit is contained in:
@@ -58,7 +58,7 @@ test.meta("testID", "settings-content-002").meta({ mode: "auth" })("Common: Hide
|
||||
.typeText(photoedit.description, "A cute cat in the sun", {
|
||||
replace: true,
|
||||
})
|
||||
.click(Selector("button.action-apply"))
|
||||
.click(photoedit.detailsApply)
|
||||
.click(Selector("button.action-close"));
|
||||
|
||||
await t.expect(page.cardCaption.withText("A cute cat in the sun").visible).ok();
|
||||
|
||||
@@ -84,7 +84,7 @@ export default class Page {
|
||||
.contains("After 1 day")
|
||||
.typeText(sharedialog.linkSecretInput, InitialSecret, { replace: true })
|
||||
.click(sharedialog.linkExpireInput)
|
||||
.scroll(Selector("div.input-expires div.v-input__control"), "top")
|
||||
.pressKey("down")
|
||||
.click(Selector("div").withText("Never").parent('div[role="option"]'))
|
||||
.click(sharedialog.dialogSave)
|
||||
.click(sharedialog.expandLink);
|
||||
|
||||
@@ -251,7 +251,7 @@ export default class Page {
|
||||
|
||||
.click(Selector("button.action-approve"));
|
||||
await t.expect(this.latitude.visible, { timeout: 5000 }).ok();
|
||||
await t.click(Selector("button.action-apply")).click(Selector("button.action-close"));
|
||||
await t.click(this.detailsApply).click(Selector("button.action-close"));
|
||||
}
|
||||
|
||||
async undoPhotoEdit(
|
||||
@@ -407,6 +407,6 @@ export default class Page {
|
||||
} else {
|
||||
await t.typeText(Selector(".input-notes textarea"), notes, { replace: true });
|
||||
}
|
||||
await t.click(Selector("button.action-apply")).click(Selector("button.action-close"));
|
||||
await t.click(this.detailsApply).click(Selector("button.action-close"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export default class Page {
|
||||
this.countries = Selector("div.p-countries-select", { timeout: 15000 });
|
||||
this.time = Selector("div.p-time-select", { timeout: 15000 });
|
||||
this.search1 = Selector("div.input-search input", { timeout: 15000 });
|
||||
this.menuButton = Selector("button.action-menu__btn", { timeout: 15000 });
|
||||
this.menuButton = Selector("button.pswp__button--menu-button", { timeout: 15000 });
|
||||
this.viewer = Selector("div.p-lightbox__pswp", { timeout: 15000 });
|
||||
this.caption = Selector("div.pswp__caption__center", { timeout: 5000 });
|
||||
this.muteButton = Selector("button.pswp__button--mute", { timeout: 5000 });
|
||||
@@ -37,14 +37,14 @@ export default class Page {
|
||||
|
||||
async checkPhotoViewerActionAvailability(action, visible) {
|
||||
if (action === "cover") {
|
||||
await t.hover(Selector("button.action-menu__btn"));
|
||||
await t.hover(this.menuButton);
|
||||
if (visible) {
|
||||
await t.expect(Selector("div.action-" + action).visible).ok();
|
||||
} else {
|
||||
await t.expect(Selector("div.action-" + action).visible).notOk();
|
||||
}
|
||||
} else if (action === "download") {
|
||||
await t.hover(Selector("button.action-menu__btn"));
|
||||
await t.hover(this.menuButton);
|
||||
if (visible) {
|
||||
await t.expect(Selector("div.action-" + action).visible).ok();
|
||||
} else {
|
||||
@@ -61,10 +61,10 @@ export default class Page {
|
||||
|
||||
async triggerPhotoViewerAction(action) {
|
||||
if (action === "cover") {
|
||||
await t.hover(Selector("button.action-menu__btn"));
|
||||
await t.hover(this.menuButton);
|
||||
await t.click(Selector("div.action-" + action));
|
||||
} else if (action === "download") {
|
||||
await t.hover(Selector("button.action-menu__btn"));
|
||||
await t.hover(this.menuButton);
|
||||
await t.click(Selector("div.action-" + action));
|
||||
} else {
|
||||
await t.hover(Selector("button.pswp__button--" + action));
|
||||
|
||||
Reference in New Issue
Block a user