Tests: Update acceptance tests to run on mobile

This commit is contained in:
theresa 2021-01-18 20:43:01 +01:00
parent 1c13087302
commit afca678d80
2 changed files with 15 additions and 7 deletions

View file

@ -7,6 +7,7 @@ fixture`Test albums`.page`${testcafeconfig.url}`;
const page = new Page();
test.meta("testID", "albums-001")("Create/delete album", async (t) => {
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbums = await Selector("a.is-album").count;
await t.click(Selector("button.action-add"));
@ -20,6 +21,7 @@ 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")
@ -44,7 +46,9 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
.expect(Selector(".v-card__text").nth(0).innerText)
.contains("All my animals")
.expect(Selector("div").withText("Animals").exists)
.ok()
.ok();
await page.openNav();
await t
.click(Selector(".nav-browse"));
await page.search("photo:true");
const FirstPhotoUid = await Selector("div.is-photo.type-image").nth(0).getAttribute("data-uid");
@ -52,13 +56,16 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
await page.selectFromUIDInFullscreen(FirstPhotoUid);
await page.selectPhotoFromUID(SecondPhotoUid);
await page.addSelectedToAlbum("Animals");
await page.openNav();
await t.click(Selector(".nav-albums"));
await t
.click(Selector(".input-category i"))
.click(Selector('div[role="listitem"]').withText("Family"));
await t
.expect(Selector("button.action-title-edit").nth(0).innerText)
.contains("Christmas")
.contains("Christmas");
await page.openNav();
await t
.click(Selector(".nav-albums"))
.click(".action-reload")
.click(Selector(".input-category i"))
@ -87,7 +94,9 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
.pressKey("ctrl+a delete")
.pressKey("enter")
.click(".action-confirm")
.click(".action-reload")
.click(".action-reload");
await page.openNav();
await t
.click(Selector(".nav-albums"))
.expect(Selector("div").withText("Holiday").visible)
.ok()
@ -96,6 +105,7 @@ test.meta("testID", "albums-002")("Update album", async (t) => {
});
test.meta("testID", "albums-003")("Download album", async (t) => {
await page.openNav();
await t.click(Selector(".nav-albums"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
@ -121,6 +131,7 @@ test.meta("testID", "albums-004")("View folders", async (t) => {
});
test.meta("testID", "albums-005")("View calendar", async (t) => {
await page.openNav();
await t
.click(Selector(".nav-calendar"))
.expect(Selector("a").withText("May 2019").visible)
@ -131,6 +142,7 @@ test.meta("testID", "albums-005")("View calendar", async (t) => {
//TODO test that sharing link works as expected
test.meta("testID", "albums-006")("Create, Edit, delete sharing link", async (t) => {
await page.openNav();
await t.click(Selector(".nav-albums"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);

View file

@ -8,7 +8,6 @@ const page = new Page();
test.meta("testID", "components-001")("Test filter options", async (t) => {
await t
.click("button.p-expand-search")
.expect(Selector("body").withText("object Object").exists)
.notOk();
});
@ -23,7 +22,6 @@ test.meta("testID", "components-002")("Fullscreen mode", async (t) => {
});
test.meta("testID", "components-003")("Mosaic view", async (t) => {
await t.click("button.p-expand-search");
await page.setFilter("view", "Mosaic");
await t
.expect(Selector("div.v-image__image").visible)
@ -37,7 +35,6 @@ test.meta("testID", "components-003")("Mosaic view", async (t) => {
});
test.meta("testID", "components-004")("List view", async (t) => {
await t.click("button.p-expand-search");
await page.setFilter("view", "List");
await t
.expect(Selector("table.v-datatable").visible)
@ -47,7 +44,6 @@ test.meta("testID", "components-004")("List view", async (t) => {
});
test.meta("testID", "components-005")("#Card view", async (t) => {
await t.click("button.p-expand-search");
await page.setFilter("view", "Cards");
await t
.expect(Selector("div.v-image__image").visible)