diff --git a/package-lock.json b/package-lock.json index 05b940d9..4a2ea89c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1923,12 +1923,6 @@ "@types/send": "*" } }, - "@types/fibers": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/fibers/-/fibers-3.1.4.tgz", - "integrity": "sha512-b/SCgk2zhaSC3+wTVrh61b9SdJ5A5Iq2HbKW56cUJ7nBh7vcXJLx/BTDuA1WoL55/OGYwhhXXj0kHavfwQEakQ==", - "dev": true - }, "@types/fs-extra": { "version": "11.0.4", "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", @@ -2108,15 +2102,6 @@ "integrity": "sha512-2yh72JxmDney1h7LQvkyO8p8FOmNMQXGs8HjuXS3SXvE/dLydLLjBqKCdHqcTUo66CQVHfn7yFR680bvi9jlVw==", "dev": true }, - "@types/puppeteer": { - "version": "5.4.7", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.7.tgz", - "integrity": "sha512-JdGWZZYL0vKapXF4oQTC5hLVNfOgdPrqeZ1BiQnGk5cB7HeE91EWUiTdVSdQPobRN8rIcdffjiOgCYJ/S8QrnQ==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/qs": { "version": "6.9.10", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", @@ -3310,207 +3295,6 @@ "morgan": "^1.7.0" } }, - "@wdio/sync": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/@wdio/sync/-/sync-7.27.0.tgz", - "integrity": "sha512-ZWfuVvE2nfmfvlaEWBmpm3EWId3F1bKb6W5DCRQ8y0l/qoy7/AC3iSXvLK6VPHyLhIyYeYXYUrGxmMNTGqyI/g==", - "dev": true, - "requires": { - "@types/fibers": "^3.1.0", - "@types/puppeteer": "^5.4.0", - "@wdio/logger": "7.26.0", - "@wdio/types": "7.26.0", - "fibers": "5.0.3", - "webdriverio": "7.27.0" - }, - "dependencies": { - "@types/node": { - "version": "18.18.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.18.10.tgz", - "integrity": "sha512-luANqZxPmjTll8bduz4ACs/lNTCLuWssCyjqTY9yLdsv1xnViQp3ISKwsEWOIecO13JWUqjVdig/Vjjc09o8uA==", - "dev": true, - "requires": { - "undici-types": "~5.26.4" - } - }, - "@wdio/config": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@wdio/config/-/config-7.26.0.tgz", - "integrity": "sha512-GO6kFGgFrx2Hiq+Ww6V9I7cZfShPjfPVhPy3uXnKN2B4FilX8ilLAp5cIFuMuHPeOQq0crYX9cnLYXka6dCGgg==", - "dev": true, - "requires": { - "@wdio/logger": "7.26.0", - "@wdio/types": "7.26.0", - "@wdio/utils": "7.26.0", - "deepmerge": "^4.0.0", - "glob": "^8.0.3" - } - }, - "@wdio/repl": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@wdio/repl/-/repl-7.26.0.tgz", - "integrity": "sha512-2YxbXNfYVGVLrffUJzl/l5s8FziDPl917eLP62gkEH/H5IV27Pnwx3Iyu0KOEaBzgntnURANlwhCZFXQ4OPq8Q==", - "dev": true, - "requires": { - "@wdio/utils": "7.26.0" - } - }, - "@wdio/types": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.26.0.tgz", - "integrity": "sha512-mOTfWAGQ+iT58iaZhJMwlUkdEn3XEWE4jthysMLXFnSuZ2eaODVAiK31SmlS/eUqgSIaupeGqYUrtCuSNbLefg==", - "dev": true, - "requires": { - "@types/node": "^18.0.0", - "got": "^11.8.1" - } - }, - "@wdio/utils": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@wdio/utils/-/utils-7.26.0.tgz", - "integrity": "sha512-pVq2MPXZAYLkKGKIIHktHejnHqg4TYKoNYSi2EDv+I3GlT8VZKXHazKhci82ov0tD+GdF27+s4DWNDCfGYfBdQ==", - "dev": true, - "requires": { - "@wdio/logger": "7.26.0", - "@wdio/types": "7.26.0", - "p-iteration": "^1.1.8" - } - }, - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - }, - "devtools": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/devtools/-/devtools-7.27.0.tgz", - "integrity": "sha512-3zKwVXtmKjewqXF1rwkuBaRNKexEpAIvAp2K5sXTuF5YsIo9GqOrEDYNskQ0DMM0bQzxE0mxRle9ZVjlpghr3A==", - "dev": true, - "requires": { - "@types/node": "^18.0.0", - "@types/ua-parser-js": "^0.7.33", - "@wdio/config": "7.26.0", - "@wdio/logger": "7.26.0", - "@wdio/protocols": "7.27.0", - "@wdio/types": "7.26.0", - "@wdio/utils": "7.26.0", - "chrome-launcher": "^0.15.0", - "edge-paths": "^2.1.0", - "puppeteer-core": "^13.1.3", - "query-selector-shadow-dom": "^1.0.0", - "ua-parser-js": "^1.0.1", - "uuid": "^9.0.0" - } - }, - "devtools-protocol": { - "version": "0.0.1075032", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1075032.tgz", - "integrity": "sha512-Np2EaEFlSOev03f5ySurGi3/z8YWOwsfSPPSDTbf7zlBY77SxBWfkFf41IUmkvfkeckX8XVW9hes1jVwALNAaA==", - "dev": true - }, - "fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - } - }, - "graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true - }, - "minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - } - }, - "uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "dev": true - }, - "webdriver": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/webdriver/-/webdriver-7.27.0.tgz", - "integrity": "sha512-870uIBnrGJ86g3DdYjM+PHhqdWf6NxysSme1KIs6irWxK+LqcaWKWhN75PldE+04xJB2mVWt1tKn0NBBFTWeMg==", - "dev": true, - "requires": { - "@types/node": "^18.0.0", - "@wdio/config": "7.26.0", - "@wdio/logger": "7.26.0", - "@wdio/protocols": "7.27.0", - "@wdio/types": "7.26.0", - "@wdio/utils": "7.26.0", - "got": "^11.0.2", - "ky": "0.30.0", - "lodash.merge": "^4.6.1" - } - }, - "webdriverio": { - "version": "7.27.0", - "resolved": "https://registry.npmjs.org/webdriverio/-/webdriverio-7.27.0.tgz", - "integrity": "sha512-xEcpWdbDLTFVP57kxEVniXWL6SNq2hxEMwaXbRck9EiFlhNvVca00oMzYjCVm8jmlL6JYnbfv/u7XyhvkktMIg==", - "dev": true, - "requires": { - "@types/aria-query": "^5.0.0", - "@types/node": "^18.0.0", - "@wdio/config": "7.26.0", - "@wdio/logger": "7.26.0", - "@wdio/protocols": "7.27.0", - "@wdio/repl": "7.26.0", - "@wdio/types": "7.26.0", - "@wdio/utils": "7.26.0", - "archiver": "^5.0.0", - "aria-query": "^5.0.0", - "css-shorthand-properties": "^1.1.1", - "css-value": "^0.0.1", - "devtools": "7.27.0", - "devtools-protocol": "^0.0.1075032", - "fs-extra": "^10.0.0", - "grapheme-splitter": "^1.0.2", - "lodash.clonedeep": "^4.5.0", - "lodash.isobject": "^3.0.2", - "lodash.isplainobject": "^4.0.6", - "lodash.zip": "^4.2.0", - "minimatch": "^5.0.0", - "puppeteer-core": "^13.1.3", - "query-selector-shadow-dom": "^1.0.0", - "resq": "^1.9.1", - "rgb2hex": "0.2.5", - "serialize-error": "^8.0.0", - "webdriver": "7.27.0" - } - } - } - }, "@wdio/types": { "version": "7.33.0", "resolved": "https://registry.npmjs.org/@wdio/types/-/types-7.33.0.tgz", @@ -7620,12 +7404,6 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "dev": true - }, "detect-node": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.1.0.tgz", @@ -9764,15 +9542,6 @@ "pend": "~1.2.0" } }, - "fibers": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/fibers/-/fibers-5.0.3.tgz", - "integrity": "sha512-/qYTSoZydQkM21qZpGLDLuCq8c+B8KhuCQ1kLPvnRNhxhVbvrpmH9l2+Lblf5neDuEsY4bfT7LeO553TXQDvJw==", - "dev": true, - "requires": { - "detect-libc": "^1.0.3" - } - }, "figgy-pudding": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.2.tgz", diff --git a/package.json b/package.json index 17561c60..c595b35a 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,6 @@ "@wdio/sauce-service": "^7.33.0", "@wdio/spec-reporter": "^7.33.0", "@wdio/static-server-service": "^7.33.0", - "@wdio/sync": "^7.27.0", "babel-loader": "^8.3.0", "babel-plugin-istanbul": "^5.2.0", "chai": "^4.3.10", diff --git a/test/integration/index.js b/test/integration/index.js index 97fb2bb6..41d459dc 100644 --- a/test/integration/index.js +++ b/test/integration/index.js @@ -14,71 +14,76 @@ const liveRegionWaitTimeMillis = 10000 const basicExample = () => { describe('basic example', function () { const input = 'input#autocomplete-default' - const menu = `${input} + ul` - const firstOption = `${menu} > li:first-child` - const secondOption = `${menu} > li:nth-child(2)` - it('should show the input', () => { - $(input).waitForExist() - expect($(input).isDisplayed()).to.equal(true) + let $input + let $menu + + beforeEach(async () => { + $input = await $(input) + $menu = await $(`${input} + ul`) + }) + + it('should show the input', async () => { + await $input.waitForExist() + expect(await $input.isDisplayed()).to.equal(true) }) - it('should allow focusing the input', () => { - $(input).click() - expect($(input).isFocused()).to.equal(true) + it('should allow focusing the input', async () => { + await $input.click() + expect(await $input.isFocused()).to.equal(true) }) - it('should display suggestions', () => { - $(input).click() - $(input).setValue('ita') - $(menu).waitForDisplayed() - expect($(menu).isDisplayed()).to.equal(true) + it('should display suggestions', async () => { + await $input.click() + await $input.setValue('ita') + await $menu.waitForDisplayed() + expect(await $menu.isDisplayed()).to.equal(true) }) // These tests are flakey when run through Saucelabs so we only run them // in Chrome if (isChrome) { - it('should announce status changes using two alternately updated aria live regions', () => { - const regionA = $('#autocomplete-default__status--A') - const regionB = $('#autocomplete-default__status--B') + it('should announce status changes using two alternately updated aria live regions', async () => { + const $regionA = await $('#autocomplete-default__status--A') + const $regionB = await $('#autocomplete-default__status--B') - expect(regionA.getText()).to.equal('') - expect(regionB.getText()).to.equal('') + expect(await $regionA.getText()).to.equal('') + expect(await $regionB.getText()).to.equal('') - $(input).click() - $(input).setValue('a') + await $input.click() + await $input.setValue('a') // We can't tell which region will be used first, so we have to allow for // either region changing - browser.waitUntil(() => { return regionA.getText() !== '' || regionB.getText() !== '' }, + await browser.waitUntil(async () => { return await $regionA.getText() !== '' || await $regionB.getText() !== '' }, liveRegionWaitTimeMillis, 'expected the first aria live region to be populated within ' + liveRegionWaitTimeMillis + ' milliseconds' ) - if (regionA.getText()) { - $(input).addValue('s') - browser.waitUntil(() => { return (regionA.getText() === '' && regionB.getText() !== '') }, + if (await $regionA.getText()) { + await $input.addValue('s') + await browser.waitUntil(async () => { return (await $regionA.getText() === '' && await $regionB.getText() !== '') }, liveRegionWaitTimeMillis, 'expected the first aria live region to be cleared, and the second to be populated within ' + liveRegionWaitTimeMillis + ' milliseconds' ) - $(input).addValue('h') - browser.waitUntil(() => { return (regionA.getText() !== '' && regionB.getText() === '') }, + await $input.addValue('h') + await browser.waitUntil(async () => { return (await $regionA.getText() !== '' && await $regionB.getText() === '') }, liveRegionWaitTimeMillis, 'expected the first aria live region to be populated, and the second to be cleared within ' + liveRegionWaitTimeMillis + ' milliseconds' ) } else { - $(input).addValue('s') - browser.waitUntil(() => { return (regionA.getText() !== '' && regionB.getText() === '') }, + await $input.addValue('s') + await browser.waitUntil(async () => { return (await $regionA.getText() !== '' && await $regionB.getText() === '') }, liveRegionWaitTimeMillis, 'expected the first aria live region to be populated, and the second to be cleared within ' + liveRegionWaitTimeMillis + ' milliseconds' ) - $(input).addValue('h') - browser.waitUntil(() => { return (regionA.getText() === '' && regionB.getText() !== '') }, + await $input.addValue('h') + await browser.waitUntil(async () => { return (await $regionA.getText() === '' && await $regionB.getText() !== '') }, liveRegionWaitTimeMillis, 'expected the first aria live region to be cleared, and the second to be populated within ' + liveRegionWaitTimeMillis + ' milliseconds' @@ -87,56 +92,67 @@ const basicExample = () => { }) } - it('should set aria-selected to true on selected option and false on other options', () => { - $(input).click() - $(input).setValue('ita') - browser.keys(['ArrowDown']) - expect($(firstOption).getAttribute('aria-selected')).to.equal('true') - expect($(secondOption).getAttribute('aria-selected')).to.equal('false') - browser.keys(['ArrowDown']) - expect($(firstOption).getAttribute('aria-selected')).to.equal('false') - expect($(secondOption).getAttribute('aria-selected')).to.equal('true') + it('should set aria-selected to true on selected option and false on other options', async () => { + await $input.click() + await $input.setValue('ita') + + const $option1 = await $(`${input} + ul li:nth-child(1)`) + const $option2 = await $(`${input} + ul li:nth-child(2)`) + + await browser.keys(['ArrowDown']) + expect(await $option1.getAttribute('aria-selected')).to.equal('true') + expect(await $option2.getAttribute('aria-selected')).to.equal('false') + await browser.keys(['ArrowDown']) + expect(await $option1.getAttribute('aria-selected')).to.equal('false') + expect(await $option2.getAttribute('aria-selected')).to.equal('true') }) describe('keyboard use', () => { - it('should allow typing', () => { - $(input).click() - $(input).addValue('ita') - expect($(input).getValue()).to.equal('ita') + it('should allow typing', async () => { + await $input.click() + await $input.addValue('ita') + expect(await $input.getValue()).to.equal('ita') }) - it('should allow selecting an option', () => { - $(input).click() - $(input).setValue('ita') - browser.keys(['ArrowDown']) - expect($(input).isFocused()).to.equal(false) - expect($(firstOption).isFocused()).to.equal(true) - browser.keys(['ArrowDown']) - expect($(menu).isDisplayed()).to.equal(true) - expect($(input).getValue()).to.equal('ita') - expect($(firstOption).isFocused()).to.equal(false) - expect($(secondOption).isFocused()).to.equal(true) + it('should allow selecting an option', async () => { + await $input.click() + await $input.setValue('ita') + + const $option1 = await $(`${input} + ul li:nth-child(1)`) + const $option2 = await $(`${input} + ul li:nth-child(2)`) + + await browser.keys(['ArrowDown']) + expect(await $input.isFocused()).to.equal(false) + expect(await $option1.isFocused()).to.equal(true) + await browser.keys(['ArrowDown']) + expect(await $menu.isDisplayed()).to.equal(true) + expect(await $input.getValue()).to.equal('ita') + expect(await $option1.isFocused()).to.equal(false) + expect(await $option2.isFocused()).to.equal(true) }) - it('should allow confirming an option', () => { - $(input).click() - $(input).setValue('ita') - browser.keys(['ArrowDown', 'Enter']) - browser.waitUntil(() => $(input).getValue() !== 'ita') - expect($(input).isFocused()).to.equal(true) - expect($(input).getValue()).to.equal('Italy') + it('should allow confirming an option', async () => { + await $input.click() + await $input.setValue('ita') + await browser.keys(['ArrowDown', 'Enter']) + await browser.waitUntil(async () => await $input.getValue() !== 'ita') + expect(await $input.isFocused()).to.equal(true) + expect(await $input.getValue()).to.equal('Italy') }) - it('should redirect keypresses on an option to input', () => { + it('should redirect keypresses on an option to input', async () => { if (!isIE) { - $(input).click() - $(input).setValue('ita') - browser.keys(['ArrowDown']) - expect($(input).isFocused()).to.equal(false) - expect($(firstOption).isFocused()).to.equal(true) - $(firstOption).addValue(['l']) - expect($(input).isFocused()).to.equal(true) - expect($(input).getValue()).to.equal('ital') + await $input.click() + await $input.setValue('ita') + + const $option1 = await $(`${input} + ul li:nth-child(1)`) + + await browser.keys(['ArrowDown']) + expect(await $input.isFocused()).to.equal(false) + expect(await $option1.isFocused()).to.equal(true) + await $option1.addValue('l') + expect(await $input.isFocused()).to.equal(true) + expect(await $input.getValue()).to.equal('ital') } else { // FIXME: This feature does not work correctly on IE 11 } @@ -144,12 +160,15 @@ const basicExample = () => { }) describe('mouse use', () => { - it('should allow confirming an option', () => { - $(input).click() - $(input).setValue('ita') - $(firstOption).click() - expect($(input).isFocused()).to.equal(true) - expect($(input).getValue()).to.equal('Italy') + it('should allow confirming an option', async () => { + await $input.click() + await $input.setValue('ita') + + const $option1 = await $(`${input} + ul li:nth-child(1)`) + await $option1.click() + + expect(await $input.isFocused()).to.equal(true) + expect(await $input.getValue()).to.equal('Italy') }) }) }) @@ -158,17 +177,20 @@ const basicExample = () => { const customTemplatesExample = () => { describe('custom templates example', function () { const input = 'input#autocomplete-customTemplates' - const menu = `${input} + ul` - const firstOption = `${menu} > li:first-child` - const firstOptionInnerElement = `${firstOption} > strong` - beforeEach(() => { - $(input).setValue('') // Prevent autofilling, IE likes to do this. + let $input + + beforeEach(async () => { + $input = await $(input) + + await $input.setValue('') // Prevent autofilling, IE likes to do this. }) describe('mouse use', () => { - it('should allow confirming an option by clicking on child elements', () => { - $(input).setValue('uni') + it('should allow confirming an option by clicking on child elements', async () => { + await $input.setValue('uni') + + const $option1InnerElement = await $(`${input} + ul li:nth-child(1) strong`) if (isIE) { // FIXME: This feature works correctly on IE but testing it doesn't seem to work. @@ -176,7 +198,7 @@ const customTemplatesExample = () => { } try { - $(firstOptionInnerElement).click() + await $option1InnerElement.click() } catch (error) { // In some cases (mainly ChromeDriver) the automation protocol won't // allow clicking span elements. In this case we just skip the test. @@ -187,8 +209,8 @@ const customTemplatesExample = () => { } } - expect($(input).isFocused()).to.equal(true) - expect($(input).getValue()).to.equal('United Kingdom') + expect(await $input.isFocused()).to.equal(true) + expect(await $input.getValue()).to.equal('United Kingdom') }) }) }) @@ -203,19 +225,19 @@ const takeScreenshotsIfFail = () => { const testTitle = this.currentTest.title.replace(/\W/g, '-') const filename = join(cwd(), `screenshots/${timestamp}-${browserVariant}-${testTitle}.png`) await mkdir(dirname(filename), { recursive: true }) - browser.saveScreenshot(filename) + await browser.saveScreenshot(filename) console.log(`Test failed, created: ${filename}`) } }) } describe('Accessible Autocomplete', () => { - beforeEach(() => { - browser.url('/') + beforeEach(async () => { + await browser.url('/') }) - it('should have the right title', () => { - expect(browser.getTitle()).to.equal('Accessible Autocomplete examples') + it('should have the right title', async () => { + expect(await browser.getTitle()).to.equal('Accessible Autocomplete examples') }) basicExample() @@ -225,12 +247,12 @@ describe('Accessible Autocomplete', () => { }) describe('Accessible Autocomplete Preact', () => { - beforeEach(() => { - browser.url('/preact') + beforeEach(async () => { + await browser.url('/preact') }) - it('should have the right title', () => { - expect(browser.getTitle()).to.equal('Accessible Autocomplete Preact examples') + it('should have the right title', async () => { + expect(await browser.getTitle()).to.equal('Accessible Autocomplete Preact examples') }) basicExample() @@ -239,12 +261,12 @@ describe('Accessible Autocomplete Preact', () => { }) describe('Accessible Autocomplete React', () => { - beforeEach(() => { - browser.url('/react') + beforeEach(async () => { + await browser.url('/react') }) - it('should have the right title', () => { - expect(browser.getTitle()).to.equal('Accessible Autocomplete React examples') + it('should have the right title', async () => { + expect(await browser.getTitle()).to.equal('Accessible Autocomplete React examples') }) basicExample()