1 const assert = require('assert');
3 describe('Reverse Page', function () {
6 describe('No search', function () {
7 before(async function () {
8 page = await browser.newPage();
9 await page.goto('http://localhost:9999/reverse.html');
12 after(async function () {
16 it('should allow switching coordinates', async function () {
17 let lat_handle = await page.$('input[name=lat]');
18 let lon_handle = await page.$('input[name=lon]');
20 assert.equal(await lat_handle.evaluate(node => node.value), '');
21 assert.equal(await lon_handle.evaluate(node => node.value), '');
23 await page.click('#switch-coords');
25 assert.equal(await lat_handle.evaluate(node => node.value), '');
26 assert.equal(await lon_handle.evaluate(node => node.value), '');
28 await page.type('input[name=lat]', '5');
29 await page.type('input[name=lon]', '10');
30 await page.click('#switch-coords');
32 assert.equal(await lat_handle.evaluate(node => node.value), 10);
33 assert.equal(await lon_handle.evaluate(node => node.value), 5);