Skip to content

Commit 06b715e

Browse files
committed
Enabling more tests in JS
1 parent ac26e4a commit 06b715e

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

examples/javascript/test/bidirectional/locateNodes.spec.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
const assert = require("assert");
22
const firefox = require('selenium-webdriver/firefox');
3-
const {BrowsingContext, Builder} = require("selenium-webdriver");
3+
const {BrowsingContext, ScriptManager, Builder} = require("selenium-webdriver");
44
const {Locator} = require("selenium-webdriver/bidi/browsingContext");
5-
const {LocalValue} = require("selenium-webdriver/bidi/protocolValue");
5+
const {LocalValue, ReferenceValue} = require("selenium-webdriver/bidi/protocolValue");
66
const {ArgumentValue} = require("selenium-webdriver/bidi/argumentValue");
7+
const {EvaluateResultType} = require("selenium-webdriver/bidi/evaluateResult");
78

89
describe('Locate Nodes', function () {
910
let driver
@@ -19,7 +20,7 @@ describe('Locate Nodes', function () {
1920
await driver.quit()
2021
})
2122

22-
xit('can locate nodes', async function () {
23+
it('can locate nodes', async function () {
2324
const id = await driver.getWindowHandle()
2425
const browsingContext = await BrowsingContext(driver, {
2526
browsingContextId: id,
@@ -31,7 +32,7 @@ describe('Locate Nodes', function () {
3132
assert.strictEqual(element.length, 13)
3233
})
3334

34-
xit('can locate node', async function () {
35+
it('can locate node', async function () {
3536
const id = await driver.getWindowHandle()
3637
const browsingContext = await BrowsingContext(driver, {
3738
browsingContextId: id,
@@ -43,7 +44,7 @@ describe('Locate Nodes', function () {
4344
assert.strictEqual(element.type, 'node')
4445
})
4546

46-
xit('can locate node with css locator', async function () {
47+
it('can locate node with css locator', async function () {
4748
const id = await driver.getWindowHandle()
4849
const browsingContext = await BrowsingContext(driver, {
4950
browsingContextId: id,
@@ -60,7 +61,7 @@ describe('Locate Nodes', function () {
6061
assert.notEqual(element.sharedId, undefined)
6162
})
6263

63-
xit('can locate node with xpath locator', async function () {
64+
it('can locate node with xpath locator', async function () {
6465
const id = await driver.getWindowHandle()
6566
const browsingContext = await BrowsingContext(driver, {
6667
browsingContextId: id,
@@ -94,7 +95,7 @@ describe('Locate Nodes', function () {
9495
assert.notEqual(element.sharedId, undefined)
9596
})
9697

97-
xit('can locate node with max node count', async function () {
98+
it('can locate node with max node count', async function () {
9899
const id = await driver.getWindowHandle()
99100
const browsingContext = await BrowsingContext(driver, {
100101
browsingContextId: id,
@@ -106,7 +107,7 @@ describe('Locate Nodes', function () {
106107
assert.strictEqual(elements.length, 4)
107108
})
108109

109-
xit('can locate node with none ownership value', async function () {
110+
it('can locate node with none ownership value', async function () {
110111
const id = await driver.getWindowHandle()
111112
const browsingContext = await BrowsingContext(driver, {
112113
browsingContextId: id,
@@ -132,13 +133,13 @@ describe('Locate Nodes', function () {
132133
assert.notEqual(elements[0].handle, null)
133134
})
134135

135-
xit('can locate node with given start nodes', async function () {
136+
it('can locate node with given start nodes', async function () {
136137
const id = await driver.getWindowHandle()
137138
const browsingContext = await BrowsingContext(driver, {
138139
browsingContextId: id,
139140
})
140141

141-
await driver.get(Pages.formPage)
142+
await driver.get('https://www.selenium.dev/selenium/web/formPage.html')
142143

143144
const script = await ScriptManager(id, driver)
144145

@@ -170,7 +171,7 @@ describe('Locate Nodes', function () {
170171
startNodes,
171172
)
172173

173-
assert.strictEqual(elements.length, 35)
174+
assert.strictEqual(elements.length, 37)
174175
})
175176

176177
xit('can locate nodes in a given sandbox', async function () {
@@ -212,7 +213,7 @@ describe('Locate Nodes', function () {
212213
assert.strictEqual(sharedId.value, nodeId)
213214
})
214215

215-
xit('can find element', async function () {
216+
it('can find element', async function () {
216217
const id = await driver.getWindowHandle()
217218
const browsingContext = await BrowsingContext(driver, {
218219
browsingContextId: id,
@@ -225,7 +226,7 @@ describe('Locate Nodes', function () {
225226
assert.strictEqual(elementText, 'Open new window')
226227
})
227228

228-
xit('can find elements', async function () {
229+
it('can find elements', async function () {
229230
const id = await driver.getWindowHandle()
230231
const browsingContext = await BrowsingContext(driver, {
231232
browsingContextId: id,

examples/javascript/test/bidirectional/network_commands.spec.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
const assert = require("assert")
22
const firefox = require('selenium-webdriver/firefox')
3-
const Network = require('selenium-webdriver/bidi/network')
3+
const { Network } = require('selenium-webdriver/bidi/network')
44
const {until, By, Builder} = require('selenium-webdriver')
55
const {AddInterceptParameters} = require("selenium-webdriver/bidi/addInterceptParameters");
66
const {InterceptPhase} = require("selenium-webdriver/bidi/interceptPhase");
77

8-
98
describe('Network commands', function () {
109
let driver
1110
let network
@@ -25,20 +24,20 @@ describe('Network commands', function () {
2524
await driver.quit()
2625
})
2726

28-
xit('can add intercept', async function () {
27+
it('can add intercept', async function () {
2928
const intercept = await network.addIntercept(new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT))
3029
assert.notEqual(intercept, null)
3130
})
3231

33-
xit('can remove intercept', async function () {
32+
it('can remove intercept', async function () {
3433
const network = await Network(driver)
3534
const intercept = await network.addIntercept(new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT))
3635
assert.notEqual(intercept, null)
3736

3837
await network.removeIntercept(intercept)
3938
})
4039

41-
xit('can continue with auth credentials ', async function () {
40+
it('can continue with auth credentials ', async function () {
4241
await network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED))
4342

4443
await network.authRequired(async (event) => {
@@ -52,7 +51,7 @@ describe('Network commands', function () {
5251
assert.equal(elementMessage, successMessage)
5352
})
5453

55-
xit('can continue without auth credentials ', async function () {
54+
it('can continue without auth credentials ', async function () {
5655
await network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED))
5756

5857
await network.authRequired(async (event) => {
@@ -67,7 +66,7 @@ describe('Network commands', function () {
6766
assert.equal(source.includes('Not authorized'), true)
6867
})
6968

70-
xit('can cancel auth ', async function () {
69+
it('can cancel auth ', async function () {
7170
await network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED))
7271

7372
await network.authRequired(async (event) => {

0 commit comments

Comments
 (0)