Skip to content

Commit 95e6b3d

Browse files
authored
Merge branch 'trunk' into enable_ff_driver_tests
2 parents 6cfbb90 + 77c3bf3 commit 95e6b3d

File tree

9 files changed

+31
-47
lines changed

9 files changed

+31
-47
lines changed

examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package dev.selenium.bidirectional.webdriver_bidi;
22

33
import dev.selenium.BaseTest;
4+
5+
import java.time.Duration;
46
import java.util.List;
57
import org.junit.jupiter.api.Assertions;
68
import org.junit.jupiter.api.BeforeEach;
@@ -20,6 +22,7 @@
2022
import org.openqa.selenium.firefox.FirefoxOptions;
2123
import org.openqa.selenium.print.PrintOptions;
2224
import org.openqa.selenium.remote.RemoteWebElement;
25+
import org.openqa.selenium.support.ui.WebDriverWait;
2326

2427
import static org.openqa.selenium.support.ui.ExpectedConditions.titleIs;
2528
import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated;
@@ -31,6 +34,7 @@ public void setup() {
3134
FirefoxOptions options = new FirefoxOptions();
3235
options.setCapability("webSocketUrl", true);
3336
driver = new FirefoxDriver(options);
37+
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
3438
}
3539

3640
@Test
@@ -235,7 +239,7 @@ void textCaptureScreenshot() {
235239

236240
String screenshot = browsingContext.captureScreenshot();
237241

238-
Assertions.assertTrue(screenshot.length() > 0);
242+
Assertions.assertFalse(screenshot.isEmpty());
239243
}
240244

241245
@Test
@@ -251,7 +255,7 @@ void textCaptureViewportScreenshot() {
251255
browsingContext.captureBoxScreenshot(
252256
elementRectangle.getX(), elementRectangle.getY(), 5, 5);
253257

254-
Assertions.assertTrue(screenshot.length() > 0);
258+
Assertions.assertFalse(screenshot.isEmpty());
255259
}
256260

257261
@Test
@@ -263,7 +267,7 @@ void textCaptureElementScreenshot() {
263267

264268
String screenshot = browsingContext.captureElementScreenshot(((RemoteWebElement) element).getId());
265269

266-
Assertions.assertTrue(screenshot.length() > 0);
270+
Assertions.assertFalse(screenshot.isEmpty());
267271
}
268272

269273
@Test
@@ -283,7 +287,6 @@ void textSetViewport() {
283287
}
284288

285289
@Test
286-
@Disabled("Supported by Firefox Nightly 124")
287290
void textSetViewportWithDevicePixelRatio() {
288291
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
289292
driver.get("https://www.selenium.dev/selenium/web/formPage.html");
@@ -305,11 +308,10 @@ void testPrintPage() {
305308

306309
String printPage = browsingContext.print(printOptions);
307310

308-
Assertions.assertTrue(printPage.length() > 0);
311+
Assertions.assertFalse(printPage.isEmpty());
309312
}
310313

311314
@Test
312-
@Disabled("Supported by Firefox Nightly 124")
313315
void testNavigateBackInTheBrowserHistory() {
314316
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
315317
browsingContext.navigate("https://www.selenium.dev/selenium/web/formPage.html", ReadinessState.COMPLETE);
@@ -322,7 +324,6 @@ void testNavigateBackInTheBrowserHistory() {
322324
}
323325

324326
@Test
325-
@Disabled("Supported by Firefox Nightly 124")
326327
void canNavigateForwardInTheBrowserHistory() {
327328
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
328329
browsingContext.navigate("https://www.selenium.dev/selenium/web/formPage.html", ReadinessState.COMPLETE);
@@ -338,7 +339,6 @@ void canNavigateForwardInTheBrowserHistory() {
338339
}
339340

340341
@Test
341-
@Disabled("Supported by Firefox Nightly 124")
342342
void canTraverseBrowserHistory() {
343343
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
344344
browsingContext.navigate("https://www.selenium.dev/selenium/web/formPage.html", ReadinessState.COMPLETE);

examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LocateNodesTest.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,13 @@ public void setup() {
3434
}
3535

3636
@Test
37-
@Disabled
3837
void testCreateABrowsingContextForGivenId() {
3938
String id = driver.getWindowHandle();
4039
BrowsingContext browsingContext = new BrowsingContext(driver, id);
4140
Assertions.assertEquals(id, browsingContext.getId());
4241
}
4342

4443
@Test
45-
@Disabled
4644
void canLocateNodes() {
4745
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
4846
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
@@ -54,7 +52,6 @@ void canLocateNodes() {
5452
}
5553

5654
@Test
57-
@Disabled
5855
void canLocateNodesWithJustLocator() {
5956
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
6057
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
@@ -64,7 +61,6 @@ void canLocateNodesWithJustLocator() {
6461
}
6562

6663
@Test
67-
@Disabled
6864
void canLocateNode() {
6965
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
7066
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
@@ -74,7 +70,6 @@ void canLocateNode() {
7470
}
7571

7672
@Test
77-
@Disabled
7873
void canLocateNodesWithCSSLocator() {
7974
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
8075

@@ -93,7 +88,6 @@ void canLocateNodesWithCSSLocator() {
9388
}
9489

9590
@Test
96-
@Disabled
9791
void canLocateNodesWithXPathLocator() {
9892
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
9993

@@ -127,7 +121,6 @@ void canLocateNodesWithInnerText() {
127121
}
128122

129123
@Test
130-
@Disabled
131124
void canLocateNodesWithMaxNodeCount() {
132125
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
133126

@@ -141,7 +134,6 @@ void canLocateNodesWithMaxNodeCount() {
141134
}
142135

143136
@Test
144-
@Disabled
145137
void canLocateNodesGivenStartNodes() {
146138
String handle = driver.getWindowHandle();
147139
BrowsingContext browsingContext = new BrowsingContext(driver, handle);
@@ -177,7 +169,6 @@ void canLocateNodesGivenStartNodes() {
177169
}
178170

179171
@Test
180-
@Disabled
181172
void canLocateNodesInAGivenSandbox() {
182173
String sandbox = "sandbox";
183174
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());

examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/NetworkCommandsTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public void setup() {
3131
}
3232

3333
@Test
34-
@Disabled
3534
void canAddIntercept() {
3635
try (Network network = new Network(driver)) {
3736
String intercept =
@@ -41,7 +40,6 @@ void canAddIntercept() {
4140
}
4241

4342
@Test
44-
@Disabled
4543
void canRemoveIntercept() {
4644
try (Network network = new Network(driver)) {
4745
String intercept =
@@ -52,7 +50,6 @@ void canRemoveIntercept() {
5250
}
5351

5452
@Test
55-
@Disabled
5653
void canContinueWithAuthCredentials() {
5754
try (Network network = new Network(driver)) {
5855
network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
@@ -69,7 +66,6 @@ void canContinueWithAuthCredentials() {
6966
}
7067

7168
@Test
72-
@Disabled
7369
void canContinueWithoutAuthCredentials() {
7470
try (Network network = new Network(driver)) {
7571
network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
@@ -85,7 +81,6 @@ void canContinueWithoutAuthCredentials() {
8581
}
8682

8783
@Test
88-
@Disabled
8984
void canCancelAuth() {
9085
try (Network network = new Network(driver)) {
9186
network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED));
@@ -99,7 +94,6 @@ void canCancelAuth() {
9994
}
10095

10196
@Test
102-
@Disabled
10397
void canFailRequest() {
10498
try (Network network = new Network(driver)) {
10599
network.addIntercept(new AddInterceptParameters(InterceptPhase.BEFORE_REQUEST_SENT));

examples/java/src/test/java/dev/selenium/interactions/VirtualAuthenticatorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ public void testAddResidentCredentialNotSupportedWhenAuthenticatorUsesU2FProtoco
134134

135135

136136
@Test
137-
@Disabled("A fix was implemented and will be available in Selenium 4.34.")
138137
public void testCreateAndAddNonResidentialKey() {
139138
VirtualAuthenticatorOptions options = new VirtualAuthenticatorOptions()
140139
.setProtocol(VirtualAuthenticatorOptions.Protocol.U2F)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ describe('Browsing Context', function () {
422422
await driver.wait(until.titleIs('We Arrive Here'), 2500)
423423
});
424424

425-
it.skip('Get All Top level browsing contexts', async () => {
425+
it('Get All Top level browsing contexts', async () => {
426426
const id = await driver.getWindowHandle()
427427
const window1 = await BrowsingContext(driver, {
428428
browsingContextId: id,

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)