From ac1df4d43f3442e183dfbe08c9eb3ca0698439a6 Mon Sep 17 00:00:00 2001 From: theresa Date: Mon, 20 Sep 2021 20:10:37 +0200 Subject: [PATCH] Tests: Adapt acceptance tests to changes --- frontend/tests/acceptance/albums.js | 6 +++--- frontend/tests/acceptance/calendar.js | 2 +- frontend/tests/acceptance/folders.js | 2 +- frontend/tests/acceptance/moment.js | 2 +- frontend/tests/acceptance/page-model.js | 9 +++++++-- frontend/tests/acceptance/states.js | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/frontend/tests/acceptance/albums.js b/frontend/tests/acceptance/albums.js index d05da2902..d2c2b8da0 100644 --- a/frontend/tests/acceptance/albums.js +++ b/frontend/tests/acceptance/albums.js @@ -31,7 +31,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => { await page.openNav(); await t.click(Selector(".nav-albums")); 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 .expect(Selector("button.action-title-edit").nth(0).innerText) .contains("Holiday") @@ -66,7 +66,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => { await page.search("category:Family"); } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("Family")); } 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") { } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("All Categories"), { timeout: 55000 }); } await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid)); diff --git a/frontend/tests/acceptance/calendar.js b/frontend/tests/acceptance/calendar.js index 44b67de63..2c5b6fb31 100644 --- a/frontend/tests/acceptance/calendar.js +++ b/frontend/tests/acceptance/calendar.js @@ -48,7 +48,7 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => { await page.search("category:Mountains"); } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("Mountains")); } await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("March 2014"); diff --git a/frontend/tests/acceptance/folders.js b/frontend/tests/acceptance/folders.js index 7f18c5861..96ff2e0bc 100644 --- a/frontend/tests/acceptance/folders.js +++ b/frontend/tests/acceptance/folders.js @@ -47,7 +47,7 @@ test.meta("testID", "folders-001")("Update folders", async (t) => { await page.search("category:Mountains"); } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("Mountains")); } await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("MyFolder"); diff --git a/frontend/tests/acceptance/moment.js b/frontend/tests/acceptance/moment.js index 724717ea1..40a8952cc 100644 --- a/frontend/tests/acceptance/moment.js +++ b/frontend/tests/acceptance/moment.js @@ -47,7 +47,7 @@ test.meta("testID", "moments-001")("Update moment", async (t) => { await page.search("category:Mountains"); } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("Mountains")); } await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Winter"); diff --git a/frontend/tests/acceptance/page-model.js b/frontend/tests/acceptance/page-model.js index 9d40d5107..1641465ba 100644 --- a/frontend/tests/acceptance/page-model.js +++ b/frontend/tests/acceptance/page-model.js @@ -47,7 +47,12 @@ export default class Page { } 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() { @@ -152,7 +157,7 @@ export default class Page { async addSelectedToAlbum(name, type) { await t .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 }) .pressKey("enter"); } diff --git a/frontend/tests/acceptance/states.js b/frontend/tests/acceptance/states.js index f501572df..e449a82b6 100644 --- a/frontend/tests/acceptance/states.js +++ b/frontend/tests/acceptance/states.js @@ -49,7 +49,7 @@ test.meta("testID", "states-001")("Update state", async (t) => { await page.search("category:Mountains"); } else { await t - .click(Selector(".input-category i")) + .click(Selector(".input-category")) .click(Selector('div[role="listitem"]').withText("Mountains")); } await t.expect(Selector("button.action-title-edit").nth(0).innerText).contains("Wonderland");