1 const assert = require('assert');
3 describe('Search Page', function () {
6 describe('No search', function () {
7 before(async function () {
8 page = await browser.newPage();
9 await page.goto('http://localhost:9999/search.html');
12 after(async function () {
16 it('should have a HTML page title', async function () {
17 assert.equal(await page.title(), 'Nominatim Demo');
21 describe('Search for City of London', function () {
22 before(async function () {
23 page = await browser.newPage();
24 await page.goto('http://localhost:9999/search.html');
25 await page.type('input[name=q]', 'City of London');
26 await page.click('button[type=submit]');
27 await page.waitForSelector('#searchresults');
28 // await page.screenshot({ path: "./screen.png", fullPage: true });
31 after(async function () {
35 it('should have a HTML page title', async function () {
36 assert.equal(await page.title(), 'Result for City of London | Nominatim Demo');
39 it('should display a map', async function () {
40 await page.waitForSelector('#map');
41 assert.equal((await page.$$('#map')).length, 1);