Skip to content

Commit aa88b5c

Browse files
committed
[javascript] Improving two tests for Chrome
1 parent 60f158d commit aa88b5c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

javascript/node/selenium-webdriver/test/actions_test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const fileServer = require('../lib/test/fileserver')
2323
const { ignore, Pages, suite } = require('../lib/test')
2424
const { Key, Origin } = require('../lib/input')
2525
const { Browser, By, until } = require('..')
26+
const io = require('../io')
2627

2728
suite(function (env) {
2829
describe('WebDriver.actions()', function () {
@@ -98,6 +99,8 @@ suite(function (env) {
9899
assert.strictEqual(await box.getAttribute('class'), '')
99100

100101
await driver.actions().doubleClick(box).perform()
102+
await driver.wait(
103+
async () => await box.getAttribute('class') === 'blue', 5000)
101104
assert.strictEqual(await box.getAttribute('class'), 'blue')
102105
})
103106

javascript/node/selenium-webdriver/test/chrome/devtools_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ test.suite(
3232
function (env) {
3333
let driver
3434

35-
before(async function () {
35+
beforeEach(async function () {
3636
driver = await env
3737
.builder()
3838
.setChromeOptions(new chrome.Options().headless())
3939
.build()
4040
})
41-
after(async () => await driver.quit())
41+
afterEach(async () => await driver.quit())
4242

4343
it('can send commands to devtools', async function () {
4444
await driver.get(test.Pages.ajaxyPage)

0 commit comments

Comments
 (0)