From ffed466b09da78acf4fbb8471c70370e78685acb Mon Sep 17 00:00:00 2001 From: theresa Date: Tue, 19 Jan 2021 16:26:03 +0100 Subject: [PATCH] Tests: Update acceptance tests to run on mobile --- frontend/tests/acceptance/albums.js | 2 -- frontend/tests/acceptance/labels.js | 8 ++++---- frontend/tests/acceptance/originals.js | 11 +++++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/frontend/tests/acceptance/albums.js b/frontend/tests/acceptance/albums.js index 71bae70ec..fdda922ba 100644 --- a/frontend/tests/acceptance/albums.js +++ b/frontend/tests/acceptance/albums.js @@ -27,8 +27,6 @@ test.meta("testID", "albums-002")("Update album", async (t) => { if (t.browser.platform === "mobile") { await t.navigateTo("/albums?q=Holiday"); } else { await page.search("Holiday");} - //.typeText(Selector(".p-albums-search input"), "Holiday") - //.pressKey("enter"); const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid"); await t .expect(Selector("button.action-title-edit").nth(0).innerText) diff --git a/frontend/tests/acceptance/labels.js b/frontend/tests/acceptance/labels.js index f2e3c7ce0..75a5ba78a 100644 --- a/frontend/tests/acceptance/labels.js +++ b/frontend/tests/acceptance/labels.js @@ -131,9 +131,10 @@ test.meta("testID", "labels-002")("Rename Label", async (t) => { test.meta("testID", "labels-003")("Add label to album", async (t) => { await page.openNav(); await t - .click(Selector(".nav-albums")) - .typeText(Selector(".p-albums-search input"), "Christmas") - .pressKey("enter"); + .click(Selector(".nav-albums")); + if (t.browser.platform === "mobile") { + await t.navigateTo("/albums?q=Christmas"); + } else { await page.search("Christmas");} const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid"); await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid)); const PhotoCount = await Selector("div.is-photo").count; @@ -162,7 +163,6 @@ test.meta("testID", "labels-003")("Add label to album", async (t) => { await page.selectPhotoFromUID(SecondPhotoLandscape); await page.selectPhotoFromUID(ThirdPhotoLandscape); await page.removeSelected(); - await t.click(".action-reload"); const PhotoCountAfterDelete = await Selector("div.is-photo", { timeout: 5000 }).count; await t.expect(PhotoCountAfterDelete).eql(PhotoCountAfterAdd - 3); }); diff --git a/frontend/tests/acceptance/originals.js b/frontend/tests/acceptance/originals.js index 0be8f8377..7111a0ca8 100644 --- a/frontend/tests/acceptance/originals.js +++ b/frontend/tests/acceptance/originals.js @@ -9,7 +9,9 @@ const page = new Page(); test.meta("testID", "originals-001")("Add original files to album", async (t) => { await page.openNav(); await t.click(Selector(".nav-albums")); - await t.typeText(Selector(".p-albums-search input"), "KanadaVacation").pressKey("enter"); + if (t.browser.platform === "mobile") { + await t.navigateTo("/albums?q=KanadaVacation"); + } else { await page.search("KanadaVacation");} await t.expect(Selector("h3").innerText).eql("Couldn't find anything"); await page.openNav(); await t @@ -41,9 +43,10 @@ test.meta("testID", "originals-001")("Add original files to album", async (t) => await page.addSelectedToAlbum("KanadaVacation"); await page.openNav(); await t - .click(Selector(".nav-albums")) - .typeText(Selector(".p-albums-search input"), "KanadaVacation") - .pressKey("enter"); + .click(Selector(".nav-albums")); + if (t.browser.platform === "mobile") { + await t.navigateTo("/albums?q=KanadaVacation"); + } else { await page.search("KanadaVacation");} const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid"); await t.click(Selector("a.is-album").nth(0)); const PhotoCountAfterAdd = await Selector("div.is-photo", { timeout: 5000 }).count;