photoprism/frontend/tests/acceptance/acceptance-public/places.js

44 lines
1.2 KiB
JavaScript
Raw Normal View History

2021-01-15 16:02:39 +00:00
import { Selector } from "testcafe";
import { ClientFunction } from "testcafe";
import testcafeconfig from "../../testcafeconfig.json";
2022-04-15 13:46:25 +00:00
import Menu from "../page-model/menu";
2022-10-26 17:29:34 +00:00
import Places from "../page-model/places";
2020-05-31 17:32:02 +00:00
const getLocation = ClientFunction(() => document.location.href);
2022-09-05 13:20:28 +00:00
fixture`Search and open photo from places`.page`${testcafeconfig.url}`;
2022-04-15 13:46:25 +00:00
const menu = new Menu();
2022-10-26 17:29:34 +00:00
const places = new Places();
2020-05-31 17:32:02 +00:00
2022-07-14 08:19:04 +00:00
test.meta("testID", "places-001").meta({ mode: "public" })("Common: Test places", async (t) => {
2022-04-15 13:46:25 +00:00
await menu.openPage("places");
2021-01-15 16:02:39 +00:00
await t
.expect(Selector("#map").exists, { timeout: 15000 })
.ok()
2022-09-05 13:20:28 +00:00
.expect(Selector("div.map-control").visible)
2021-01-15 16:02:39 +00:00
.ok();
2022-04-15 13:46:25 +00:00
await menu.openPage("browse");
await t.expect(Selector("div.is-photo").exists).ok();
await menu.openPage("places");
await t
2021-09-20 18:09:41 +00:00
.expect(Selector("#map").exists, { timeout: 15000 })
.ok()
2022-09-05 13:20:28 +00:00
.expect(Selector("div.map-control").visible)
2021-09-20 18:09:41 +00:00
.ok();
2020-07-15 10:23:04 +00:00
2022-10-26 17:29:34 +00:00
await places.search("canada");
await t.wait(8000);
2022-04-15 13:46:25 +00:00
await t.expect(Selector('div[title="Cape / Bowen Island / 2019"]').visible).ok();
await t.click(Selector('div[title="Cape / Bowen Island / 2019"]'));
await t.expect(Selector("#photo-viewer").visible).ok();
2021-01-15 16:02:39 +00:00
});