Tests: Update photoview page-model

This commit is contained in:
theresa 2022-01-18 18:29:44 +01:00
parent e3ecfb5a94
commit 3dff2efbb0

View file

@ -45,6 +45,37 @@ export default class Page {
}
}
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(nth, action) {
await t.click(Selector(`td button.input-` + action).nth(nth));
}