photoprism/frontend/tests/acceptance/places.js

20 lines
615 B
JavaScript
Raw Normal View History

2019-05-21 15:00:46 +00:00
import { Selector } from 'testcafe';
import { ClientFunction } from 'testcafe';
2019-06-22 13:14:32 +00:00
const getLocation = ClientFunction(() => document.location.href);
2019-05-21 15:00:46 +00:00
fixture`Test places page`
.page `localhost:2342/places`;
2019-05-21 15:00:46 +00:00
test('Test places', async t => {
await t
.expect(Selector('#map').exists, {timeout: 15000}).ok()
.expect(Selector('div.p-map-control').visible).ok();
2019-06-22 13:14:32 +00:00
await t
2019-05-21 15:00:46 +00:00
.typeText(Selector('input[aria-label="Search"]'), 'Berlin')
2019-06-22 13:14:32 +00:00
.pressKey('enter');
await t
.expect(Selector('div.p-map-control').visible).ok()
.expect(getLocation()).contains('Berlin');
});