Tests: Refactor acceptance tests

This commit is contained in:
theresa 2021-01-28 08:26:21 +01:00
parent b55c06dca1
commit bd17b4f3b7
7 changed files with 255 additions and 353 deletions

View file

@ -108,15 +108,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);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-download").visible)
.ok();
await page.checkButtonVisibility("download", true, true);
});
test.meta("testID", "albums-004")("View folders", async (t) => {
@ -143,54 +135,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);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const InitialUrl = await Selector(".action-url").innerText;
const InitialSecret = await Selector(".input-secret input").value;
const InitialExpire = await Selector("div.v-select__selections").innerText;
await t
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("button.action-close"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const UrlAfterChange = await Selector(".action-url").innerText;
const ExpireAfterChange = await Selector("div.v-select__selections").innerText;
await t
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("div.v-expansion-panel__header__icon"));
const LinkCount = await Selector(".action-url").count;
await t.click(".action-add-link");
const LinkCountAfterAdd = await Selector(".action-url").count;
await t
.expect(LinkCountAfterAdd)
.eql(LinkCount + 1)
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
const LinkCountAfterDelete = await Selector(".action-url").count;
await t.expect(LinkCountAfterDelete).eql(LinkCountAfterAdd - 1);
await page.testCreateEditDeleteSharingLink("albums");
});
test.meta("testID", "albums-007")("Create/delete album during add to album", async (t) => {

View file

@ -78,86 +78,12 @@ test.meta("testID", "calendar-001")("Update calendar", async (t) => {
test.meta("testID", "calendar-002")("Download calendar", async (t) => {
await page.openNav();
await t.click(Selector(".nav-calendar"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-download").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-download").visible)
.ok();
}
await page.checkButtonVisibility("download", true, true);
});
//TODO test that sharing link works as expected
test.meta("testID", "calendar-003")("Create, Edit, delete sharing link", async (t) => {
await page.openNav();
await t.click(Selector(".nav-calendar"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const InitialUrl = await Selector(".action-url").innerText;
const InitialSecret = await Selector(".input-secret input").value;
const InitialExpire = await Selector("div.v-select__selections").innerText;
await t
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("button.action-close"));
await page.clearSelection();
await t
.click(Selector("a.is-album").withAttribute("data-uid", FirstAlbum))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const UrlAfterChange = await Selector(".action-url").innerText;
const ExpireAfterChange = await Selector("div.v-select__selections").innerText;
await t
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("div.v-expansion-panel__header__icon"));
const LinkCount = await Selector(".action-url").count;
await t.click(".action-add-link");
const LinkCountAfterAdd = await Selector(".action-url").count;
await t
.expect(LinkCountAfterAdd)
.eql(LinkCount + 1)
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
const LinkCountAfterDelete = await Selector(".action-url").count;
await t
.expect(LinkCountAfterDelete)
.eql(LinkCountAfterAdd - 1)
.click(Selector("button.action-close"));
await page.openNav();
await t
.click(".nav-calendar")
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
await page.testCreateEditDeleteSharingLink("calendar");
});
test.meta("testID", "calendar-004")("Create/delete album during add to album", async (t) => {
@ -210,20 +136,5 @@ test.meta("testID", "calendar-004")("Create/delete album during add to album", a
test.meta("testID", "calendar-005")("No delete calendar functionality", async (t) => {
await page.openNav();
await t.click(Selector(".nav-calendar"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").exists)
.notOk();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-delete").exists)
.notOk();
}
await page.checkButtonVisibility("delete", false, false);
});

View file

@ -86,147 +86,118 @@ test.meta("testID", "folders-001")("Update folders", async (t) => {
test.meta("testID", "folders-002")("Download folders", async (t) => {
await page.openNav();
await t.click(Selector(".nav-folders"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-download").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-download").visible)
.ok();
}
await page.checkButtonVisibility("download", true, true);
});
//TODO test that sharing link works as expected
test.meta("testID", "folders-003")("Create, Edit, delete sharing link", async (t) => {
await page.openNav();
await t.click(Selector(".nav-folders"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const InitialUrl = await Selector(".action-url").innerText;
const InitialSecret = await Selector(".input-secret input").value;
const InitialExpire = await Selector("div.v-select__selections").innerText;
await t
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("button.action-close"));
await page.clearSelection();
await t
.click(Selector("a.is-album").withAttribute("data-uid", FirstAlbum))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const UrlAfterChange = await Selector(".action-url").innerText;
const ExpireAfterChange = await Selector("div.v-select__selections").innerText;
await t
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("div.v-expansion-panel__header__icon"));
const LinkCount = await Selector(".action-url").count;
await t.click(".action-add-link");
const LinkCountAfterAdd = await Selector(".action-url").count;
await t
.expect(LinkCountAfterAdd)
.eql(LinkCount + 1)
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
const LinkCountAfterDelete = await Selector(".action-url").count;
await t
.expect(LinkCountAfterDelete)
.eql(LinkCountAfterAdd - 1)
.click(Selector("button.action-close"));
await page.openNav();
await t
.click(".nav-folders")
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
await page.testCreateEditDeleteSharingLink("folders");
/*await page.openNav();
await t.click(Selector(".nav-folders"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const InitialUrl = await Selector(".action-url").innerText;
const InitialSecret = await Selector(".input-secret input").value;
const InitialExpire = await Selector("div.v-select__selections").innerText;
await t
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("button.action-close"));
await page.clearSelection();
await t
.click(Selector("a.is-album").withAttribute("data-uid", FirstAlbum))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const UrlAfterChange = await Selector(".action-url").innerText;
const ExpireAfterChange = await Selector("div.v-select__selections").innerText;
await t
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("div.v-expansion-panel__header__icon"));
const LinkCount = await Selector(".action-url").count;
await t.click(".action-add-link");
const LinkCountAfterAdd = await Selector(".action-url").count;
await t
.expect(LinkCountAfterAdd)
.eql(LinkCount + 1)
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
const LinkCountAfterDelete = await Selector(".action-url").count;
await t
.expect(LinkCountAfterDelete)
.eql(LinkCountAfterAdd - 1)
.click(Selector("button.action-close"));
await page.openNav();
await t
.click(".nav-folders")
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));*/
});
test.meta("testID", "folders-004")("Create/delete album during add to album", async (t) => {
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbums = await Selector("a.is-album").count;
await page.openNav();
await t.click(Selector(".nav-folders"));
const ThirdFolder = await Selector("a.is-album").nth(2).getAttribute("data-uid");
await t.click(Selector("a.is-album").withAttribute("data-uid", ThirdFolder));
const PhotoCountInFolder = await Selector("div.is-photo").count;
const FirstPhoto = await Selector("div.is-photo.type-image").nth(0).getAttribute("data-uid");
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.selectFromUID(ThirdFolder);
await page.addSelectedToAlbum("NotYetExistingAlbumForFolder", "clone");
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbumsAfterCreation = await Selector("a.is-album").count;
await t.expect(countAlbumsAfterCreation).eql(countAlbums + 1);
await page.search("NotYetExistingAlbumForFolder");
const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid));
const PhotoCountInAlbum = await Selector("div.is-photo").count;
await t
.expect(PhotoCountInAlbum)
.eql(PhotoCountInFolder)
.expect(Selector("div").withAttribute("data-uid", FirstPhoto).exists, { timeout: 5000 })
.ok();
await page.openNav();
await t.click(Selector(".nav-albums"));
await page.selectFromUID(AlbumUid);
await page.deleteSelected();
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbumsAfterDelete = await Selector("a.is-album").count;
await t.expect(countAlbumsAfterDelete).eql(countAlbums);
await t
.click(Selector(".nav-folders"))
.click(Selector("a.is-album").withAttribute("data-uid", ThirdFolder))
.expect(Selector("div").withAttribute("data-uid", FirstPhoto).exists, { timeout: 5000 })
.ok();
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbums = await Selector("a.is-album").count;
await page.openNav();
await t.click(Selector(".nav-folders"));
const ThirdFolder = await Selector("a.is-album").nth(2).getAttribute("data-uid");
await t.click(Selector("a.is-album").withAttribute("data-uid", ThirdFolder));
const PhotoCountInFolder = await Selector("div.is-photo").count;
const FirstPhoto = await Selector("div.is-photo.type-image").nth(0).getAttribute("data-uid");
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.selectFromUID(ThirdFolder);
await page.addSelectedToAlbum("NotYetExistingAlbumForFolder", "clone");
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbumsAfterCreation = await Selector("a.is-album").count;
await t.expect(countAlbumsAfterCreation).eql(countAlbums + 1);
await page.search("NotYetExistingAlbumForFolder");
const AlbumUid = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await t.click(Selector("a.is-album").withAttribute("data-uid", AlbumUid));
const PhotoCountInAlbum = await Selector("div.is-photo").count;
await t
.expect(PhotoCountInAlbum)
.eql(PhotoCountInFolder)
.expect(Selector("div").withAttribute("data-uid", FirstPhoto).exists, { timeout: 5000 })
.ok();
await page.openNav();
await t.click(Selector(".nav-albums"));
await page.selectFromUID(AlbumUid);
await page.deleteSelected();
await page.openNav();
await t.click(Selector(".nav-albums"));
const countAlbumsAfterDelete = await Selector("a.is-album").count;
await t.expect(countAlbumsAfterDelete).eql(countAlbums);
await t
.click(Selector(".nav-folders"))
.click(Selector("a.is-album").withAttribute("data-uid", ThirdFolder))
.expect(Selector("div").withAttribute("data-uid", FirstPhoto).exists, { timeout: 5000 })
.ok();
});
test.meta("testID", "folders-005")("No delete folder functionality", async (t) => {
await page.openNav();
await t.click(Selector(".nav-folders"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").exists)
.notOk();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-delete").exists)
.notOk();
}
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.checkButtonVisibility("delete", false, false);
});

View file

@ -86,27 +86,13 @@ test.meta("testID", "moments-001")("Update moment", async (t) => {
test.meta("testID", "moments-002")("Download moments", async (t) => {
await page.openNav();
await t.click(Selector(".nav-moments"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-download").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-download").visible)
.ok();
}
await page.checkButtonVisibility("download", true, true);
});
//TODO test that sharing link works as expected
test.meta("testID", "moments-003")("Create, Edit, delete sharing link", async (t) => {
await page.openNav();
await page.testCreateEditDeleteSharingLink("moments");
/*await page.openNav();
await t.click(Selector(".nav-moments"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
@ -165,7 +151,7 @@ test.meta("testID", "moments-003")("Create, Edit, delete sharing link", async (t
.click(".nav-moments")
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
.click(Selector(".action-delete"));*/
});
test.meta("testID", "moments-004")("Create/delete album during add to album", async (t) => {
@ -218,20 +204,5 @@ test.meta("testID", "moments-004")("Create/delete album during add to album", as
test.meta("testID", "moments-005")("Delete moments button visible", async (t) => {
await page.openNav();
await t.click(Selector(".nav-moments"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-delete").exists)
.notOk();
}
await page.checkButtonVisibility("delete", true, false);
});

View file

@ -102,8 +102,7 @@ export default class Page {
}
}
await t
.click(Selector("button.action-archive", { timeout: 5000 }))
.click(Selector("button.action-confirm", { timeout: 5000 }));
.click(Selector("button.action-archive", { timeout: 5000 }));
}
async privateSelected() {
@ -148,7 +147,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))
.typeText(Selector(".input-album input"), name, { replace: true })
.pressKey("enter");
if (await Selector('div[role="listitem"]').withText(name).visible) {
@ -212,4 +211,90 @@ export default class Page {
async logout() {
await t.click(Selector("div.nav-logout"));
}
async testCreateEditDeleteSharingLink(type) {
await this.openNav();
if (type === "states") {
await t.click(Selector(".nav-places + div"));
}
await t.click(Selector(".nav-" + type));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await this.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const InitialUrl = await Selector(".action-url").innerText;
const InitialSecret = await Selector(".input-secret input").value;
const InitialExpire = await Selector("div.v-select__selections").innerText;
await t
.expect(InitialUrl)
.notContains("secretfortesting")
.expect(InitialExpire)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("button.action-close"));
await this.clearSelection();
await t
.click(Selector("a.is-album").withAttribute("data-uid", FirstAlbum))
.click(Selector("button.action-share"))
.click(Selector("div.v-expansion-panel__header__icon").nth(0));
const UrlAfterChange = await Selector(".action-url").innerText;
const ExpireAfterChange = await Selector("div.v-select__selections").innerText;
await t
.expect(UrlAfterChange)
.contains("secretfortesting")
.expect(ExpireAfterChange)
.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"]'))
.click(Selector("button.action-save"))
.click(Selector("div.v-expansion-panel__header__icon"));
const LinkCount = await Selector(".action-url").count;
await t.click(".action-add-link");
const LinkCountAfterAdd = await Selector(".action-url").count;
await t
.expect(LinkCountAfterAdd)
.eql(LinkCount + 1)
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
const LinkCountAfterDelete = await Selector(".action-url").count;
await t
.expect(LinkCountAfterDelete)
.eql(LinkCountAfterAdd - 1)
.click(Selector("button.action-close"));
await this.openNav();
await t
.click(".nav-" + type)
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
}
async checkButtonVisibility(button, inContextMenu, inAlbum) {
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await this.selectFromUID(FirstAlbum);
await t.click(Selector("button.action-menu"));
if (inContextMenu) {
await t.expect(Selector("button.action-" + button).visible).ok();
} else {
await t.expect(Selector("button.action-" + button).visible).notOk();
}
await this.clearSelection();
if (t.browser.platform !== "mobile") {
await t.click(Selector("a.is-album").nth(0));
if (inAlbum) {
await t.expect(Selector("button.action-" + button).visible).ok();
} else {
await t.expect(Selector("button.action-" + button).visible).notOk();
}
}
}
}

View file

@ -54,6 +54,14 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.expect(Selector("#tab-library-logs a").visible)
.ok();
await page.openNav();
await t.click(Selector("div.nav-browse + div")).click(Selector(".nav-archive"));
await page.toggleSelectNthPhoto(0);
await t
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").exists)
.ok();
await page.clearSelection();
await page.openNav();
await t
.click(Selector("div.nav-browse + div"))
.expect(Selector(".nav-archive").visible)
@ -89,13 +97,42 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.click(Selector(".input-logs input"))
.click(Selector(".input-share input"))
.click(Selector(".input-places input"))
.click(Selector(".input-delete input"))
.click(Selector(".input-private input"))
.click(Selector("#tab-settings-library"))
.click(Selector(".input-review input"));
await page.openNav();
await t.eval(() => location.reload());
await page.openNav();
await t.click(Selector(".nav-calendar"));
await page.checkButtonVisibility("download", false, false);
await page.openNav();
await t.click(Selector(".nav-calendar"));
await page.checkButtonVisibility("share", false, false);
await page.openNav();
await t.click(Selector(".nav-calendar"));
await page.checkButtonVisibility("upload", false, false);
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.checkButtonVisibility("download", false, false);
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.checkButtonVisibility("share", false, false);
await page.openNav();
await t.click(Selector(".nav-folders"));
await page.checkButtonVisibility("upload", false, false);
await page.openNav();
await t.click(Selector(".nav-albums"));
await page.checkButtonVisibility("download", false, false);
await page.openNav();
await t.click(Selector(".nav-albums"));
await page.checkButtonVisibility("share", false, false);
await page.openNav();
await t.click(Selector(".nav-albums"));
await page.checkButtonVisibility("upload", false, false);
await page.openNav();
await t
.click(Selector(".nav-browse"))
.expect(Selector("button.action-upload").exists)
.notOk()
.expect(Selector(".nav-browse").innerText)
@ -190,4 +227,14 @@ test.meta("testID", "settings-general-001")("General Settings", async (t) => {
.click(Selector(".input-private input"))
.click(Selector("#tab-settings-library"))
.click(Selector(".input-review input"));
await page.openNav();
await t.click(Selector("div.nav-browse + div")).click(Selector(".nav-archive"));
await page.toggleSelectNthPhoto(0);
await t
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").exists)
.notOk();
await page.clearSelection();
await page.openNav();
await t.click(Selector(".nav-settings")).click(Selector(".input-delete input"));
});

View file

@ -90,27 +90,14 @@ test.meta("testID", "states-002")("Download states", async (t) => {
await t
.click(Selector(".nav-places + div"))
.click(Selector(".nav-states"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-download").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-download").visible)
.ok();
}
await page.checkButtonVisibility("download", true, true);
});
//TODO test that sharing link works as expected
test.meta("testID", "states-003")("Create, Edit, delete sharing link", async (t) => {
await page.openNav();
await page.testCreateEditDeleteSharingLink("states");
/* await page.openNav();
await t
.click(Selector(".nav-places + div"))
.click(Selector(".nav-states"));
@ -171,7 +158,7 @@ test.meta("testID", "states-003")("Create, Edit, delete sharing link", async (t)
.click(".nav-states")
.click("a.uid-" + FirstAlbum + " .action-share")
.click(Selector("div.v-expansion-panel__header__icon"))
.click(Selector(".action-delete"));
.click(Selector(".action-delete"));*/
});
test.meta("testID", "states-004")("Create/delete album during add to album", async (t) => {
@ -228,20 +215,5 @@ test.meta("testID", "states-005")("Delete states button visible", async (t) => {
await t
.click(Selector(".nav-places + div"))
.click(Selector(".nav-states"));
const FirstAlbum = await Selector("a.is-album").nth(0).getAttribute("data-uid");
await page.selectFromUID(FirstAlbum);
const clipboardCount = await Selector("span.count-clipboard");
await t
.expect(clipboardCount.textContent)
.eql("1")
.click(Selector("button.action-menu"))
.expect(Selector("button.action-delete").visible)
.ok();
if (t.browser.platform !== "mobile") {
await page.clearSelection();
await t
.click(Selector("a.is-album").nth(0))
.expect(Selector("button.action-delete").exists)
.notOk();
}
await page.checkButtonVisibility("delete", true, false);
});