Tests: Adapt acceptance tests to changes

This commit is contained in:
theresa 2021-09-20 20:10:37 +02:00
parent be84507c3e
commit ac1df4d43f
6 changed files with 14 additions and 9 deletions

View file

@ -31,7 +31,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
await page.openNav(); await page.openNav();
await t.click(Selector(".nav-albums")); await t.click(Selector(".nav-albums"));
await page.search("Holiday"); await page.search("Holiday");
const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid"); const AlbumUid = await Selector("a.is-album", { timeout: 55000 }).nth(0).getAttribute("data-uid");
await t await t
.expect(Selector("button.action-title-edit").nth(0).innerText) .expect(Selector("button.action-title-edit").nth(0).innerText)
.contains("Holiday") .contains("Holiday")
@ -66,7 +66,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
await page.search("category:Family"); await page.search("category:Family");
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("Family")); .click(Selector('div[role="listitem"]').withText("Family"));
} }
await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Christmas"); await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Christmas");
@ -75,7 +75,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
if (t.browser.platform === "mobile") { if (t.browser.platform === "mobile") {
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("All Categories"), { timeout: 55000 }); .click(Selector('div[role="listitem"]').withText("All Categories"), { timeout: 55000 });
} }
await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid)); await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid));

View file

@ -48,7 +48,7 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
await page.search("category:Mountains"); await page.search("category:Mountains");
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("Mountains")); .click(Selector('div[role="listitem"]').withText("Mountains"));
} }
await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("March 2014"); await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("March 2014");

View file

@ -47,7 +47,7 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
await page.search("category:Mountains"); await page.search("category:Mountains");
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("Mountains")); .click(Selector('div[role="listitem"]').withText("Mountains"));
} }
await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("MyFolder"); await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("MyFolder");

View file

@ -47,7 +47,7 @@ test.meta("testID", "moments-001")("Update moment", async (t) => {
await page.search("category:Mountains"); await page.search("category:Mountains");
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("Mountains")); .click(Selector('div[role="listitem"]').withText("Mountains"));
} }
await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Winter"); await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Winter");

View file

@ -47,7 +47,12 @@ export default class Page {
} }
async search(term) { async search(term) {
await t.typeText(this.search1, term, { replace: true }).pressKey("enter"); await t
.typeText(this.search1, term, { replace: true })
.pressKey("enter")
.wait(10000)
.expect(this.search1.value)
.contains(term);
} }
async openNav() { async openNav() {
@ -152,7 +157,7 @@ export default class Page {
async addSelectedToAlbum(name, type) { async addSelectedToAlbum(name, type) {
await t await t
.click(Selector("button.action-menu")) .click(Selector("button.action-menu"))
.click(Selector("button.action-" + type)) .click(Selector("button.action-" + type, { timeout: 15000 }))
.typeText(Selector(".input-album input"), name, { replace: true }) .typeText(Selector(".input-album input"), name, { replace: true })
.pressKey("enter"); .pressKey("enter");
} }

View file

@ -49,7 +49,7 @@ test.meta("testID", "states-001")("Update state", async (t) => {
await page.search("category:Mountains"); await page.search("category:Mountains");
} else { } else {
await t await t
.click(Selector(".input-category i")) .click(Selector(".input-category"))
.click(Selector('div[role="listitem"]').withText("Mountains")); .click(Selector('div[role="listitem"]').withText("Mountains"));
} }
await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Wonderland"); await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Wonderland");