People: Add acceptance test #1554

This commit is contained in:
theresa 2021-10-06 18:22:12 +02:00
parent 0bf22f8543
commit 6a2200984c

View file

@ -17,14 +17,14 @@ test.meta("testID", "people-001")("Faces tab preselected when subjects empty", a
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.expect(Selector("#tab-people-faces > a").hasClass("v-tabs__item--active")) .expect(Selector("#tab-people_faces > a").hasClass("v-tabs__item--active"))
.ok() .ok()
.expect(Selector("#tab-people-subjects > a").hasClass("v-tabs__item--active")) .expect(Selector("#tab-people > a").hasClass("v-tabs__item--active"))
.notOk() .notOk()
.click(Selector("#tab-people-subjects > a")) .click(Selector("#tab-people > a"))
.expect(Selector("#tab-people-faces > a").hasClass("v-tabs__item--active")) .expect(Selector("#tab-people_faces > a").hasClass("v-tabs__item--active"))
.notOk() .notOk()
.expect(Selector("#tab-people-subjects > a").hasClass("v-tabs__item--active")) .expect(Selector("#tab-people > a").hasClass("v-tabs__item--active"))
.ok(); .ok();
const countSubjects = await Selector("a.is-subject").count; const countSubjects = await Selector("a.is-subject").count;
await t.expect(countSubjects).eql(0); await t.expect(countSubjects).eql(0);
@ -34,19 +34,19 @@ test.meta("testID", "people-002")("Add + Rename", async (t) => {
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.click(Selector("#tab-people-faces > a")) .click(Selector("#tab-people_faces > a"))
.click(Selector("form.p-faces-search button.action-reload")); .click(Selector("form.p-faces-search button.action-reload"));
const countFaces = await Selector("div.is-face", { timeout: 55000 }).count; const countFaces = await Selector("div.is-face", { timeout: 55000 }).count;
await t.click(Selector("#tab-people-subjects > a")); await t.click(Selector("#tab-people > a"));
const countSubjects = await Selector("a.is-subject").count; const countSubjects = await Selector("a.is-subject").count;
await t.click(Selector("#tab-people-faces > a")); await t.click(Selector("#tab-people_faces > a"));
const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id"); const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id");
await t.click(Selector("div[data-id=" + FirstFaceID + "] div.clickable")); await t.click(Selector("div[data-id=" + FirstFaceID + "] div.clickable"));
const countPhotosFace = await Selector("div.is-photo").count; const countPhotosFace = await Selector("div.is-photo").count;
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.click(Selector("#tab-people-faces > a")) .click(Selector("#tab-people_faces > a"))
.typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Jane Doe") .typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Jane Doe")
.pressKey("enter") .pressKey("enter")
.click(Selector("form.p-faces-search button")); .click(Selector("form.p-faces-search button"));
@ -56,7 +56,7 @@ test.meta("testID", "people-002")("Add + Rename", async (t) => {
.eql(countFaces - 1) .eql(countFaces - 1)
.expect(Selector("div").withAttribute("data-id", FirstFaceID).exists) .expect(Selector("div").withAttribute("data-id", FirstFaceID).exists)
.notOk() .notOk()
.click(Selector("#tab-people-subjects > a")); .click(Selector("#tab-people > a"));
const countSubjectsAfterAdd = await Selector("a.is-subject").count; const countSubjectsAfterAdd = await Selector("a.is-subject").count;
await t await t
.expect(countSubjectsAfterAdd) .expect(countSubjectsAfterAdd)
@ -117,7 +117,7 @@ test.meta("testID", "people-003")("Add + Reject + Star", async (t) => {
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.click(Selector("#tab-people-faces > a")) .click(Selector("#tab-people_faces > a"))
.click(Selector("form.p-faces-search button.action-reload")); .click(Selector("form.p-faces-search button.action-reload"));
const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id"); const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id");
await t await t
@ -128,7 +128,7 @@ test.meta("testID", "people-003")("Add + Reject + Star", async (t) => {
.ok() .ok()
.typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Andrea Doe") .typeText(Selector("div[data-id=" + FirstFaceID + "] div.input-name input"), "Andrea Doe")
.pressKey("enter") .pressKey("enter")
.click(Selector("#tab-people-subjects > a")); .click(Selector("#tab-people > a"));
await t.typeText(Selector("div.input-search input"), "Andrea").pressKey("enter"); await t.typeText(Selector("div.input-search input"), "Andrea").pressKey("enter");
const AndreaUID = await Selector("a.is-subject").nth(0).getAttribute("data-uid"); const AndreaUID = await Selector("a.is-subject").nth(0).getAttribute("data-uid");
await t.click(Selector("a.is-subject").withAttribute("data-uid", AndreaUID)); await t.click(Selector("a.is-subject").withAttribute("data-uid", AndreaUID));
@ -158,13 +158,10 @@ test.meta("testID", "people-003")("Add + Reject + Star", async (t) => {
await t.eval(() => location.reload()); await t.eval(() => location.reload());
await t.wait(6000); await t.wait(6000);
const countPhotosNicole = await Selector("div.is-photo").count; const countPhotosNicole = await Selector("div.is-photo").count;
await t.expect(Diff).eql(countPhotosNicole); await t.expect(Diff).gte(countPhotosNicole);
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.expect(Selector("a.is-subject").nth(0).getAttribute("data-uid"))
.eql(AndreaUID);
await t
.typeText(Selector("div.input-search input"), "Nicole", { replace: true }) .typeText(Selector("div.input-search input"), "Nicole", { replace: true })
.pressKey("enter"); .pressKey("enter");
const NicoleUID = await Selector("a.is-subject").nth(0).getAttribute("data-uid"); const NicoleUID = await Selector("a.is-subject").nth(0).getAttribute("data-uid");
@ -242,13 +239,59 @@ test.meta("testID", "people-005")("Hide face", async (t) => {
await page.openNav(); await page.openNav();
await t await t
.click(Selector(".nav-people")) .click(Selector(".nav-people"))
.click(Selector("#tab-people-faces > a")) .click(Selector("#tab-people_faces > a"))
.click(Selector("form.p-faces-search button.action-reload")); .click(Selector("form.p-faces-search button.action-reload"));
const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id"); const FirstFaceID = await Selector("div.is-face").nth(0).getAttribute("data-id");
await t.click(Selector("div[data-id=" + FirstFaceID + "] button.input-hide")); await t
.hover(Selector("div[data-id=" + FirstFaceID + "]"))
.click(Selector("div[data-id=" + FirstFaceID + "] button.input-hidden"));
await t.eval(() => location.reload()); await t.eval(() => location.reload());
await t await t
.wait(6000) .wait(6000)
.expect(Selector("div[data-id=" + FirstFaceID + "]").visible) .expect(Selector("div[data-id=" + FirstFaceID + "]").visible)
.notOk(); .notOk()
.click(Selector("button.action-show-all"));
await t.eval(() => location.reload());
await t
.wait(6000)
.expect(Selector("div[data-id=" + FirstFaceID + "]").visible)
.ok()
.hover(Selector("div[data-id=" + FirstFaceID + "]"))
.click(Selector("div[data-id=" + FirstFaceID + "] button.input-hidden"))
.click(Selector("button.action-show-default"));
await t.eval(() => location.reload());
await t
.wait(6000)
.expect(Selector("div[data-id=" + FirstFaceID + "]").visible)
.ok();
});
test.meta("testID", "people-006")("Hide person", async (t) => {
await page.openNav();
await t
.click(Selector(".nav-people"))
.click(Selector("#tab-people > a"));
const FirstPerson = await Selector("a.is-subject").nth(0).getAttribute("data-uid");
await t
.hover(Selector("a[data-uid=" + FirstPerson + "]"))
.click(Selector("a[data-uid=" + FirstPerson + "] button.input-hidden"));
await t.eval(() => location.reload());
await t
.wait(6000)
.expect(Selector("a[data-uid=" + FirstPerson + "]").visible)
.notOk()
.click(Selector("button.action-show-all"));
await t.eval(() => location.reload());
await t
.wait(6000)
.expect(Selector("a[data-uid=" + FirstPerson + "]").visible)
.ok()
.hover(Selector("a[data-uid=" + FirstPerson + "]"))
.click(Selector("a[data-uid=" + FirstPerson + "] button.input-hidden"))
.click(Selector("button.action-show-default"));
await t.eval(() => location.reload());
await t
.wait(6000)
.expect(Selector("a[data-uid=" + FirstPerson + "]").visible)
.ok();
}); });