photoprism/frontend/tests/acceptance/places.js
2020-06-01 17:04:54 +02:00

21 lines
No EOL
713 B
JavaScript

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}`
test('Test places', async t => {
await t
.click(Selector('.p-navigation-places'))
.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');
});