X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c0d1fb859fee050373df1fa77d03cb2c1a8cde91..5bbe331d6aff4d3aeca2006fa3d0d8dafe8be674:/test/status.js diff --git a/test/status.js b/test/status.js index 7226bf2..78dc020 100644 --- a/test/status.js +++ b/test/status.js @@ -1,11 +1,11 @@ -const assert = require('assert'); +import assert from 'assert'; describe('Status Page', function () { let page; before(async function () { page = await browser.newPage(); - await page.goto('http://localhost:9999/status.html'); + await page.goto('http://localhost:9999/status.html', { waitUntil: 'networkidle0' }); }); after(async function () { @@ -13,14 +13,11 @@ describe('Status Page', function () { }); it('should have software version', async function () { - // waits for fetching status details - await page.waitForFunction( - 'document.querySelector(".col-sm-12 dl dd:nth-child(4)").textContent !== "undefined"' + let status_details = await page.$eval( + 'body', + el => el.textContent.match(/Software version.*\d+\.\d+/) ); - let status_name = await page.$$eval('.col-sm-12 dl dt', elements => elements[1].textContent); - let version = await page.$$eval('.col-sm-12 dl dd', elements => elements[1].textContent); - assert.deepStrictEqual(status_name, 'Software version'); - assert.ok(version !== 'undefined' && version.length > 1); + assert.ok(!status_details[0].includes('undefined')); }); });