photoprism/frontend/tests/acceptance/places.js

34 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-05-31 19:32:02 +02:00
import { Selector } from 'testcafe';
import { ClientFunction } from 'testcafe';
import testcafeconfig from "./testcafeconfig.json";
const getLocation = ClientFunction(() => document.location.href);
fixture`Test places page`
.page`${testcafeconfig.url}`
2020-07-21 13:57:16 +02:00
test('#1 Test places', async t => {
2020-05-31 19:32:02 +02:00
await t
.click(Selector('.nav-places'))
2020-05-31 19:32:02 +02:00
.expect(Selector('#map').exists, {timeout: 15000}).ok()
.expect(Selector('div.p-map-control').visible).ok();
await t
.typeText(Selector('input[aria-label="Search"]'), 'Berlin')
.pressKey('enter');
await t
.expect(Selector('div.p-map-control').visible).ok()
.expect(getLocation()).contains('Berlin');
2020-07-21 13:57:16 +02:00
});
2020-07-15 12:23:04 +02:00
test('#2 Open photo from places', async t => {
2020-07-16 14:42:09 +02:00
//TODO replace wait
2020-07-15 12:23:04 +02:00
await t
.click(Selector('.nav-places'))
.expect(Selector('#p-photo-viewer').visible).notOk()
2020-07-16 14:42:09 +02:00
.expect(Selector('#map').exists, {timeout: 15000}).ok()
.typeText(Selector('input[aria-label="Search"]'), 'Berlin')
.pressKey('enter')
.wait(30000)
.click(Selector('div.marker').nth(0), {timeout: 9000})
2020-07-15 12:23:04 +02:00
.expect(Selector('#p-photo-viewer').visible).ok();
2020-05-31 19:32:02 +02:00
});