X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/c0d1fb859fee050373df1fa77d03cb2c1a8cde91..307bdf7ed25af2ff5cb340398ce069ddb0d81b16:/test/status.js diff --git a/test/status.js b/test/status.js index 7226bf2..cf58885 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,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')); }); });