From 2adf5fe32b31b1a4b9d4592a1196e83f276fe6f6 Mon Sep 17 00:00:00 2001 From: Theresa Gresch Date: Sun, 31 May 2020 19:32:02 +0200 Subject: [PATCH] Frontend: Add acceptance tests --- frontend/tests/acceptance/places.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/frontend/tests/acceptance/places.js b/frontend/tests/acceptance/places.js index 24feb6ef2..7e0b6de0e 100644 --- a/frontend/tests/acceptance/places.js +++ b/frontend/tests/acceptance/places.js @@ -1 +1,21 @@ -// see places on map \ No newline at end of file +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'); +}); \ No newline at end of file