Tests: Update acceptance tests to run on mobile

This commit is contained in:
theresa 2021-01-19 16:02:22 +01:00
parent 4837a5e517
commit 20fe4b032d
3 changed files with 41 additions and 18 deletions

View file

@ -23,9 +23,12 @@ test.meta("testID", "albums-001")("Create/delete album", async (t) => {
test.meta("testID", "albums-002")("Update album", async (t) => {
await page.openNav();
await t
.click(Selector(".nav-albums"))
.typeText(Selector(".p-albums-search input"), "Holiday")
.pressKey("enter");
.click(Selector(".nav-albums"));
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)
@ -53,8 +56,8 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
await page.search("photo:true");
const FirstPhotoUid = await Selector("div.is-photo.type-image").nth(0).getAttribute("data-uid");
const SecondPhotoUid = await Selector("div.is-photo.type-image").nth(1).getAttribute("data-uid");
await page.selectFromUIDInFullscreen(FirstPhotoUid);
await page.selectPhotoFromUID(SecondPhotoUid);
await page.selectFromUIDInFullscreen(FirstPhotoUid);
await page.addSelectedToAlbum("Animals");
await page.openNav();
await t.click(Selector(".nav-albums"));
@ -76,7 +79,6 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
await page.selectPhotoFromUID(FirstPhotoUid);
await page.selectPhotoFromUID(SecondPhotoUid);
await page.removeSelected();
await t.click(".action-reload");
const PhotoCountAfterDelete = await Selector("div.is-photo").count;
await t
.expect(PhotoCountAfterDelete)
@ -93,8 +95,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
.click(Selector(".input-category input"))
.pressKey("ctrl+a delete")
.pressKey("enter")
.click(".action-confirm")
.click(".action-reload");
.click(".action-confirm");
await page.openNav();
await t
.click(Selector(".nav-albums"))
@ -160,7 +161,7 @@ test.meta("testID", "albums-006")("Create, Edit, delete sharing link", async (t)
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.eql("Never")
.contains("Never")
.typeText(Selector(".input-secret input"), "secretForTesting", { replace: true })
.click(Selector(".input-expires input"))
.click(Selector("div").withText("After 1 day").parent('div[role="listitem"]'))
@ -174,7 +175,7 @@ test.meta("testID", "albums-006")("Create, Edit, delete sharing link", async (t)
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.eql("After 1 day")
.contains("After 1 day")
.typeText(Selector(".input-secret input"), InitialSecret, { replace: true })
.click(Selector(".input-expires input"))
.click(Selector("div").withText("Never").parent('div[role="listitem"]'))

View file

@ -20,18 +20,27 @@ test.meta("testID", "library-index-001")("Index files from folder", async (t) =>
await page.openNav();
await t
.click(Selector(".nav-calendar"));
await page.search("December 2013");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/calendar?q=December%202013");
} else { await page.search("December 2013");}
await t
.expect(Selector("h3").withText("Couldn't find anything").visible)
.ok();
await page.openNav();
await t
.click(Selector(".nav-folders"));
await page.search("Moment");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/folders?q=moment");
} else { await page.search("Moment");}
await t.expect(Selector("h3").withText("Couldn't find anything").visible).ok();
await page.openNav();
await t.click(Selector(".nav-places + div > i")).click(Selector(".nav-states"));
await page.search("KwaZulu");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/states?q=KwaZulu");
} else { await page.search("KwaZulu");}
await t.expect(Selector("h3").withText("Couldn't find anything").visible).ok();
await page.openNav();
await t
@ -69,7 +78,10 @@ test.meta("testID", "library-index-001")("Index files from folder", async (t) =>
await t
.click(Selector(".nav-calendar"))
.click(Selector(".action-reload"));
await page.search("December 2013");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/calendar?q=December%202013");
} else { await page.search("December 2013");}
await t
.expect(Selector(".is-album").visible)
.ok();
@ -77,14 +89,20 @@ test.meta("testID", "library-index-001")("Index files from folder", async (t) =>
await t
.click(Selector(".nav-folders"))
.click(Selector(".action-reload"));
await page.search("Moment");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/folders?q=moment");
} else { await page.search("Moment");}
await t.expect(Selector(".is-album").visible).ok();
await page.openNav();
await t
.click(Selector(".nav-places+div>i"))
.click(Selector(".nav-states"))
.click(Selector(".action-reload"));
await page.search("KwaZulu");
if (t.browser.platform === "mobile") {
console.log(t.browser.platform);
await t.navigateTo("/states?q=KwaZulu");
} else { await page.search("KwaZulu");}
await t.expect(Selector(".is-album").visible).ok();
await page.openNav();
await t

View file

@ -113,15 +113,19 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.notOk()
.expect(Selector("button.action-private").exists)
.notOk();
await page.toggleSelectNthPhoto(0);
await t.click(Selector("div.is-photo").nth(0));
//
await t
.expect(Selector("#p-photo-viewer").visible)
.hover(Selector(".is-photo.type-image").nth(0))
.click(Selector(".is-photo.type-image .action-fullscreen").nth(0));
await t
.expect(Selector("#p-photo-viewer", { timeout: 5000 }).visible)
.ok()
.expect(Selector(".action-download").exists)
.notOk()
.click(Selector(".action-close"))
.click(Selector(".action-close"))
await page.toggleSelectNthPhoto(0);
await t
.expect(Selector("button.action-location").exists)
.notOk()
.click(Selector("button.action-title-edit").nth(0))