2021-01-15 17:02:39 +01:00
|
|
|
import { Selector } from "testcafe";
|
|
|
|
import testcafeconfig from "../testcafeconfig";
|
2020-06-04 11:11:26 +02:00
|
|
|
import Page from "../page-model";
|
2020-05-28 10:00:09 +02:00
|
|
|
|
2021-01-15 17:02:39 +01:00
|
|
|
fixture`Test settings`.page`${testcafeconfig.url}`;
|
2020-05-28 10:00:09 +02:00
|
|
|
|
2020-06-04 11:11:26 +02:00
|
|
|
const page = new Page();
|
2020-05-28 10:00:09 +02:00
|
|
|
|
2021-01-15 17:02:39 +01:00
|
|
|
test.meta("testID", "settings-general-001")("General Settings", async (t) => {
|
2021-01-18 20:43:48 +01:00
|
|
|
await t.expect(Selector(".action-upload").exists, { timeout: 5000 }).ok();
|
2021-01-15 17:02:39 +01:00
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.expect(Selector(".nav-browse").innerText)
|
2021-01-18 20:43:48 +01:00
|
|
|
.contains("Search")
|
|
|
|
.click(Selector(".nav-browse"));
|
|
|
|
await page.setFilter("view", "Cards");
|
2021-11-17 15:38:23 +01:00
|
|
|
await page.search("photo:true stack:true");
|
2021-01-15 17:02:39 +01:00
|
|
|
await page.toggleSelectNthPhoto(0);
|
|
|
|
await t
|
|
|
|
.click(Selector("button.action-menu"))
|
|
|
|
.expect(Selector("button.action-download").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector("button.action-share").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector("button.action-edit").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector("button.action-private").visible)
|
|
|
|
.ok();
|
2021-11-17 15:38:23 +01:00
|
|
|
await page.editSelected();
|
|
|
|
await t
|
|
|
|
.click(Selector("#tab-files"))
|
|
|
|
.expect(Selector("button.action-download").nth(0).visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("li.v-expansion-panel__container").nth(1))
|
|
|
|
.expect(Selector("button.action-download").nth(1).visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector("button.action-delete").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("button.action-close"));
|
2021-01-26 16:36:39 +01:00
|
|
|
await page.clearSelection();
|
2021-01-15 17:02:39 +01:00
|
|
|
await t.click(Selector("div.is-photo").nth(0));
|
|
|
|
await t
|
2021-02-15 15:57:28 +01:00
|
|
|
.expect(Selector("#photo-viewer").visible)
|
2021-01-15 17:02:39 +01:00
|
|
|
.ok()
|
|
|
|
.expect(Selector(".action-download").exists)
|
|
|
|
.ok()
|
2021-11-17 15:38:23 +01:00
|
|
|
.hover(Selector('button[title="Close"]'))
|
|
|
|
.click(Selector('button[title="Close"]'));
|
2021-03-12 09:59:20 +01:00
|
|
|
if (t.browser.os.name !== "macOS") {
|
2021-11-17 15:38:23 +01:00
|
|
|
if (await Selector('button[title="Close"]').exists) {
|
|
|
|
await t.click(Selector('button[title="Close"]'));
|
2021-03-12 09:59:20 +01:00
|
|
|
}
|
2021-02-28 18:41:11 +01:00
|
|
|
}
|
2021-01-18 20:43:48 +01:00
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector("button.action-location").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("button.action-title-edit").nth(0))
|
2021-01-18 20:43:48 +01:00
|
|
|
.expect(Selector(".input-title input", { timeout: 8000 }).hasAttribute("disabled"))
|
2021-01-15 17:02:39 +01:00
|
|
|
.notOk()
|
|
|
|
.click(Selector("#tab-labels"))
|
|
|
|
.expect(Selector("button.p-photo-label-add").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("#tab-details"))
|
2021-01-18 20:43:48 +01:00
|
|
|
.click(Selector("button.action-close"));
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".nav-library"))
|
|
|
|
.expect(Selector("#tab-library-import a").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector("#tab-library-logs a").visible)
|
2021-01-18 20:43:48 +01:00
|
|
|
.ok();
|
|
|
|
await page.openNav();
|
2021-01-28 08:26:21 +01:00
|
|
|
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();
|
2021-01-18 20:43:48 +01:00
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector(".nav-archive").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".nav-review").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("div.nav-library + div"))
|
|
|
|
.expect(Selector(".nav-originals").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector("div.nav-albums + div"))
|
|
|
|
.expect(Selector(".nav-folders").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".nav-moments").visible)
|
|
|
|
.ok()
|
2021-10-28 10:49:56 +02:00
|
|
|
.expect(Selector(".nav-people").visible)
|
|
|
|
.ok()
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector(".nav-labels").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".nav-places").visible)
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".nav-private").visible)
|
|
|
|
.ok()
|
|
|
|
.click(Selector(".nav-settings"))
|
|
|
|
.click(Selector(".input-language input"))
|
|
|
|
.hover(Selector("div").withText("Deutsch").parent('div[role="listitem"]'))
|
|
|
|
.click(Selector("div").withText("Deutsch").parent('div[role="listitem"]'))
|
|
|
|
.click(Selector(".input-upload input"))
|
|
|
|
.click(Selector(".input-download input"))
|
|
|
|
.click(Selector(".input-import input"))
|
|
|
|
.click(Selector(".input-archive input"))
|
|
|
|
.click(Selector(".input-edit input"))
|
|
|
|
.click(Selector(".input-files input"))
|
2021-10-28 10:49:56 +02:00
|
|
|
.click(Selector(".input-people input"))
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".input-moments input"))
|
|
|
|
.click(Selector(".input-labels input"))
|
|
|
|
.click(Selector(".input-logs input"))
|
|
|
|
.click(Selector(".input-share input"))
|
|
|
|
.click(Selector(".input-places input"))
|
2021-01-28 08:26:21 +01:00
|
|
|
.click(Selector(".input-delete input"))
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".input-private input"))
|
2021-01-26 15:18:33 +01:00
|
|
|
.click(Selector("#tab-settings-library"))
|
2021-01-18 20:43:48 +01:00
|
|
|
.click(Selector(".input-review input"));
|
|
|
|
await page.openNav();
|
2021-01-15 17:02:39 +01:00
|
|
|
await t.eval(() => location.reload());
|
|
|
|
await page.openNav();
|
2021-01-28 08:26:21 +01:00
|
|
|
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();
|
2021-01-15 17:02:39 +01:00
|
|
|
await t
|
2021-01-28 08:26:21 +01:00
|
|
|
.click(Selector(".nav-browse"))
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector("button.action-upload").exists)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector(".nav-browse").innerText)
|
2021-01-18 20:43:48 +01:00
|
|
|
.contains("Suche")
|
|
|
|
.click(Selector(".nav-browse"));
|
2021-11-17 15:38:23 +01:00
|
|
|
await page.search("photo:true stack:true");
|
2021-01-15 17:02:39 +01:00
|
|
|
await page.toggleSelectNthPhoto(0);
|
|
|
|
await t
|
|
|
|
.click(Selector("button.action-menu"))
|
|
|
|
.expect(Selector("button.action-download").exists)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector("button.action-share").exists)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector("button.action-edit").visible)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector("button.action-private").exists)
|
2021-11-17 15:38:23 +01:00
|
|
|
.notOk()
|
|
|
|
.click(Selector("button.action-title-edit").nth(0))
|
|
|
|
.click(Selector("#tab-files"))
|
|
|
|
.expect(Selector("button.action-download").nth(0).visible)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("li.v-expansion-panel__container").nth(1))
|
|
|
|
.expect(Selector("button.action-download").nth(1).visible)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector("button.action-delete").visible)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("button.action-close"));
|
|
|
|
await page.search("photo:true");
|
2021-01-15 17:02:39 +01:00
|
|
|
await t
|
2021-01-26 16:36:39 +01:00
|
|
|
.hover(Selector(".is-photo.type-image").nth(0))
|
|
|
|
.click(Selector(".is-photo.type-image .action-fullscreen").nth(0));
|
2021-01-19 16:02:22 +01:00
|
|
|
await t
|
2021-02-15 15:57:28 +01:00
|
|
|
.expect(Selector("#photo-viewer", { timeout: 5000 }).visible)
|
2021-01-15 17:02:39 +01:00
|
|
|
.ok()
|
|
|
|
.expect(Selector(".action-download").exists)
|
|
|
|
.notOk()
|
2021-11-17 15:38:23 +01:00
|
|
|
.hover(Selector('button[title="Schließen"]'))
|
|
|
|
.click(Selector('button[title="Schließen"]'));
|
|
|
|
if (await Selector('button[title="Schließen"]').visible) {
|
|
|
|
await t.click(Selector('button[title="Schließen"]'));
|
2021-02-28 18:41:11 +01:00
|
|
|
}
|
2021-01-19 16:02:22 +01:00
|
|
|
await page.toggleSelectNthPhoto(0);
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector("button.action-location").exists)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("button.action-title-edit").nth(0))
|
|
|
|
.expect(Selector(".input-title input").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".input-latitude input").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".input-timezone input").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".input-country input").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".input-description textarea").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.expect(Selector(".input-keywords textarea").hasAttribute("disabled"))
|
|
|
|
.ok()
|
|
|
|
.click(Selector("#tab-labels"))
|
|
|
|
.expect(Selector("button.p-photo-label-add").exists)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("#tab-details"))
|
2021-01-18 20:43:48 +01:00
|
|
|
.click(Selector("button.action-close"));
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".nav-library"))
|
|
|
|
.expect(Selector("#tab-library-import a").exists)
|
|
|
|
.notOk()
|
2021-01-18 20:43:48 +01:00
|
|
|
.expect(Selector("#tab-library-logs a").exists)
|
|
|
|
.notOk();
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector("div.nav-browse + div"))
|
|
|
|
.expect(Selector(".nav-archive").visible)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector(".nav-review").exists)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("div.nav-library + div"))
|
|
|
|
.expect(Selector(".nav-originals").visible)
|
|
|
|
.notOk()
|
|
|
|
.click(Selector("div.nav-albums + div"))
|
|
|
|
.expect(Selector(".nav-moments").visible)
|
|
|
|
.notOk()
|
2021-10-28 10:49:56 +02:00
|
|
|
.expect(Selector(".nav-people").visible)
|
|
|
|
.notOk()
|
2021-01-15 17:02:39 +01:00
|
|
|
.expect(Selector(".nav-labels").visible)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector(".nav-places").visible)
|
|
|
|
.notOk()
|
|
|
|
.expect(Selector(".nav-private").visible)
|
|
|
|
.notOk()
|
2020-06-04 11:11:26 +02:00
|
|
|
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".nav-settings"))
|
|
|
|
.click(Selector(".input-language input"))
|
|
|
|
.hover(Selector("div").withText("English").parent('div[role="listitem"]'))
|
|
|
|
.click(Selector("div").withText("English").parent('div[role="listitem"]'))
|
|
|
|
.click(Selector(".input-upload input"))
|
|
|
|
.click(Selector(".input-download input"))
|
|
|
|
.click(Selector(".input-import input"))
|
|
|
|
.click(Selector(".input-archive input"))
|
|
|
|
.click(Selector(".input-edit input"))
|
|
|
|
.click(Selector(".input-files input"))
|
|
|
|
.click(Selector(".input-moments input"))
|
|
|
|
.click(Selector(".input-labels input"))
|
|
|
|
.click(Selector(".input-logs input"))
|
|
|
|
.click(Selector(".input-share input"))
|
|
|
|
.click(Selector(".input-places input"))
|
|
|
|
.click(Selector(".input-private input"))
|
2021-01-26 15:18:33 +01:00
|
|
|
.click(Selector("#tab-settings-library"))
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".input-review input"));
|
2021-01-28 08:26:21 +01:00
|
|
|
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"));
|
2021-01-15 17:02:39 +01:00
|
|
|
});
|