2021-01-15 17:02:39 +01:00
|
|
|
import { Selector } from "testcafe";
|
|
|
|
import testcafeconfig from "../testcafeconfig";
|
2020-06-04 15:38:46 +02:00
|
|
|
import Page from "../page-model";
|
|
|
|
|
2021-01-15 17:02:39 +01:00
|
|
|
fixture`Test index`.page`${testcafeconfig.url}`;
|
2020-06-04 15:38:46 +02:00
|
|
|
|
|
|
|
const page = new Page();
|
2021-01-15 17:02:39 +01:00
|
|
|
test.meta("testID", "library-index-001")("Index files from folder", async (t) => {
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
2021-01-15 17:02:39 +01:00
|
|
|
await t.click(Selector(".nav-labels"));
|
|
|
|
await page.search("cheetah");
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.expect(Selector("h3").withText("Couldn't find anything").visible).ok();
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".nav-moments"))
|
|
|
|
.expect(Selector("h3").withText("Couldn't find anything").visible)
|
2021-01-18 20:43:14 +01:00
|
|
|
.ok();
|
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.click(Selector(".nav-calendar"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/calendar?q=December%202013");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("December 2013");
|
|
|
|
}
|
|
|
|
await t.expect(Selector("h3").withText("Couldn't find anything").visible).ok();
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.click(Selector(".nav-folders"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/folders?q=moment");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("Moment");
|
|
|
|
}
|
2021-01-15 17:02:39 +01:00
|
|
|
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"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/states?q=KwaZulu");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("KwaZulu");
|
|
|
|
}
|
2021-01-15 17:02:39 +01:00
|
|
|
await t.expect(Selector("h3").withText("Couldn't find anything").visible).ok();
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.click(Selector(".nav-library+div>i"))
|
|
|
|
.click(Selector(".nav-originals"))
|
|
|
|
.click(Selector(".is-folder").withText("moment"))
|
|
|
|
.expect(Selector("h3").withText("Couldn't find anything").visible)
|
|
|
|
.ok();
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t
|
|
|
|
.click(Selector(".nav-browse + div"))
|
|
|
|
.click(Selector(".nav-monochrome"))
|
|
|
|
.expect(Selector("h3").withText("Couldn't find anything").visible)
|
|
|
|
.ok();
|
|
|
|
await page.openNav();
|
2021-01-15 17:02:39 +01:00
|
|
|
await t
|
|
|
|
.click(Selector(".nav-library"))
|
|
|
|
.click(Selector("#tab-library-index"))
|
|
|
|
.click(Selector(".input-index-folder input"))
|
|
|
|
.click(Selector("div.v-list__tile__title").withText("/moment"))
|
|
|
|
.click(Selector(".action-index"))
|
|
|
|
//TODO replace wait
|
|
|
|
.wait(50000)
|
|
|
|
.expect(Selector("span").withText("Done.").visible, { timeout: 60000 })
|
2021-01-18 20:43:14 +01:00
|
|
|
.ok();
|
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.click(Selector(".nav-labels")).click(Selector(".action-reload"));
|
2021-01-15 17:02:39 +01:00
|
|
|
await page.search("cheetah");
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.expect(Selector(".is-label").visible).ok();
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
|
|
|
await t
|
2021-01-15 17:02:39 +01:00
|
|
|
.click(Selector(".nav-moments"))
|
|
|
|
.click(Selector("a").withText("South Africa 2013"))
|
|
|
|
.expect(Selector(".is-photo").visible)
|
2021-01-18 20:43:14 +01:00
|
|
|
.ok();
|
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.click(Selector(".nav-calendar")).click(Selector(".action-reload"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/calendar?q=December%202013");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("December 2013");
|
|
|
|
}
|
|
|
|
await t.expect(Selector(".is-album").visible).ok();
|
2021-01-18 20:43:14 +01:00
|
|
|
await page.openNav();
|
2021-01-20 17:14:12 +01:00
|
|
|
await t.click(Selector(".nav-folders")).click(Selector(".action-reload"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/folders?q=moment");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("Moment");
|
|
|
|
}
|
2021-01-15 17:02:39 +01:00
|
|
|
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"));
|
2021-01-19 16:02:22 +01:00
|
|
|
if (t.browser.platform === "mobile") {
|
|
|
|
console.log(t.browser.platform);
|
|
|
|
await t.navigateTo("/states?q=KwaZulu");
|
2021-01-20 17:14:12 +01:00
|
|
|
} else {
|
|
|
|
await page.search("KwaZulu");
|
|
|
|
}
|
2021-01-15 17:02:39 +01:00
|
|
|
await t.expect(Selector(".is-album").visible).ok();
|
|
|
|
await page.openNav();
|
|
|
|
await t
|
|
|
|
.click(Selector(".nav-library+div>i"))
|
|
|
|
.click(Selector(".nav-originals"))
|
|
|
|
.click(Selector(".action-reload"))
|
|
|
|
.expect(Selector(".is-folder").withText("moment").visible, { timeout: 60000 })
|
|
|
|
.ok();
|
2021-01-20 17:14:12 +01:00
|
|
|
await page.openNav();
|
|
|
|
await t.click(Selector(".nav-browse + div")).click(Selector(".nav-monochrome"));
|
|
|
|
const PhotoCount = await Selector(".is-photo.type-image", { timeout: 5000 }).count;
|
|
|
|
await t.expect(PhotoCount).gt(0);
|
2021-01-15 17:02:39 +01:00
|
|
|
});
|