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
|
2020-07-03 14:48:43 +02:00
|
|
|
.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
|
|
|
});
|