2019-05-21 15:00:46 +00:00
|
|
|
import { Selector } from 'testcafe';
|
2020-01-20 11:36:12 +00:00
|
|
|
import { ClientFunction } from 'testcafe';
|
2019-06-22 13:14:32 +00:00
|
|
|
|
2020-01-20 11:36:12 +00:00
|
|
|
const getLocation = ClientFunction(() => document.location.href);
|
2019-05-21 15:00:46 +00:00
|
|
|
|
|
|
|
fixture`Test places page`
|
2020-01-20 11:36:12 +00:00
|
|
|
.page `localhost:2342/places`;
|
2019-05-21 15:00:46 +00:00
|
|
|
|
|
|
|
test('Test places', async t => {
|
|
|
|
await t
|
2020-01-20 11:36:12 +00:00
|
|
|
.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
|
2020-01-20 11:36:12 +00:00
|
|
|
.expect(Selector('div.p-map-control').visible).ok()
|
|
|
|
.expect(getLocation()).contains('Berlin');
|
|
|
|
});
|