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`
|
2021-01-13 16:56:45 +01:00
|
|
|
.page`${testcafeconfig.url}`;
|
2020-05-31 19:32:02 +02:00
|
|
|
|
2021-01-14 17:57:38 +01:00
|
|
|
test
|
|
|
|
.meta('testID', 'places-001')
|
|
|
|
('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
|
|
|
|
2021-01-14 17:57:38 +01:00
|
|
|
test
|
|
|
|
.meta('testID', 'places-002')
|
|
|
|
('Open photo from places', async t => {
|
2020-07-16 14:42:09 +02:00
|
|
|
//TODO replace wait
|
2021-01-14 10:29:01 +01:00
|
|
|
if (t.browser.name === 'Firefox') {
|
|
|
|
console.log("Test skipped in firefox");
|
|
|
|
} else {
|
|
|
|
await t
|
|
|
|
.click(Selector('.nav-places'))
|
|
|
|
.expect(Selector('#is-photo-viewer').visible).notOk()
|
|
|
|
.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})
|
|
|
|
.expect(Selector('#p-photo-viewer').visible).ok();
|
|
|
|
}
|
2020-05-31 19:32:02 +02:00
|
|
|
});
|