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

44 lines
1.2 KiB
JavaScript
Raw Normal View History

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