X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c0d1fb859fee050373df1fa77d03cb2c1a8cde91..3fdeee714c2075bbc5ba5f091ec3436def62c035:/test/status.js diff --git a/test/status.js b/test/status.js index 7226bf2..b9fcea7 100644 --- a/test/status.js +++ b/test/status.js @@ -5,7 +5,7 @@ describe('Status Page', function () { 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,9 @@ 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_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); + let status_details = await page.$eval('body', + el => el.textContent.match(/Software version.*\d+\.\d+/)); - assert.deepStrictEqual(status_name, 'Software version'); - assert.ok(version !== 'undefined' && version.length > 1); + assert.ok(!status_details[0].includes('undefined')); }); });