Skip to content

Commit 091013f

Browse files
authored
Merge branch 'trunk' into renovate/logback-monorepo
2 parents 5d4ca19 + 5216634 commit 091013f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+570
-523
lines changed

examples/dotnet/SeleniumDocs/BaseTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class BaseTest
1717
protected IWebDriver driver;
1818
protected Uri GridUrl;
1919
private Process _webserverProcess;
20-
private const string ServerJarName = "selenium-server-4.29.0.jar";
20+
private const string ServerJarName = "selenium-server-4.30.0.jar";
2121
private static readonly string BaseDirectory = AppContext.BaseDirectory;
2222
private const string RelativePathToGrid = "../../../../../";
2323
private readonly string _examplesDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, RelativePathToGrid));

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
1111
<PackageReference Include="MSTest.TestAdapter" Version="3.6.0" />
1212
<PackageReference Include="MSTest.TestFramework" Version="3.6.0" />
13-
<PackageReference Include="Selenium.Support" Version="4.29.0" />
14-
<PackageReference Include="Selenium.WebDriver" Version="4.29.0" />
13+
<PackageReference Include="Selenium.Support" Version="4.30.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.30.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

examples/java/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repositories {
1010
}
1111

1212
dependencies {
13-
testImplementation 'org.seleniumhq.selenium:selenium-java:4.29.0'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.30.0'
1414
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.12.0'
1515
}
1616

examples/java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<maven.compiler.source>17</maven.compiler.source>
1414
<maven.compiler.target>17</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.29.0</selenium.version>
16+
<selenium.version>4.30.0</selenium.version>
1717
</properties>
1818

1919
<repositories>

examples/java/src/test/java/dev/selenium/bidi/cdp/CdpApiTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import org.openqa.selenium.chrome.ChromeOptions;
1717
import org.openqa.selenium.devtools.DevTools;
1818
import org.openqa.selenium.devtools.HasDevTools;
19-
import org.openqa.selenium.devtools.v131.browser.Browser;
20-
import org.openqa.selenium.devtools.v131.network.Network;
21-
import org.openqa.selenium.devtools.v131.network.model.Headers;
19+
import org.openqa.selenium.devtools.v134.browser.Browser;
20+
import org.openqa.selenium.devtools.v134.network.Network;
21+
import org.openqa.selenium.devtools.v134.network.model.Headers;
2222
import org.openqa.selenium.support.ui.WebDriverWait;
2323

2424
public class CdpApiTest extends BaseTest {
@@ -27,7 +27,7 @@ public class CdpApiTest extends BaseTest {
2727
@BeforeEach
2828
public void createSession() {
2929
ChromeOptions options = getDefaultChromeOptions();
30-
options.setBrowserVersion("131");
30+
options.setBrowserVersion("134");
3131
driver = new ChromeDriver(options);
3232
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
3333
}

examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
import org.openqa.selenium.devtools.DevTools;
2222
import org.openqa.selenium.devtools.HasDevTools;
2323
import org.openqa.selenium.devtools.NetworkInterceptor;
24-
import org.openqa.selenium.devtools.v131.browser.Browser;
25-
import org.openqa.selenium.devtools.v131.network.Network;
26-
import org.openqa.selenium.devtools.v131.performance.Performance;
27-
import org.openqa.selenium.devtools.v131.performance.model.Metric;
24+
import org.openqa.selenium.devtools.v134.browser.Browser;
25+
import org.openqa.selenium.devtools.v134.network.Network;
26+
import org.openqa.selenium.devtools.v134.performance.Performance;
27+
import org.openqa.selenium.devtools.v134.performance.model.Metric;
2828
import org.openqa.selenium.remote.http.*;
2929
import org.openqa.selenium.support.ui.WebDriverWait;
3030

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
package dev.selenium.bidirectional.webdriver_bidi.user_context;
2+
3+
import org.junit.jupiter.api.AfterEach;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.BeforeEach;
6+
import org.junit.jupiter.api.Test;
7+
import org.openqa.selenium.By;
8+
import org.openqa.selenium.WebDriver;
9+
import org.openqa.selenium.WebElement;
10+
import org.openqa.selenium.firefox.FirefoxDriver;
11+
import org.openqa.selenium.firefox.FirefoxOptions;
12+
13+
class MultipleInstanceParallelTest {
14+
15+
private WebDriver driver;
16+
17+
@BeforeEach
18+
public void setup() {
19+
FirefoxOptions options = new FirefoxOptions();
20+
options.setCapability("webSocketUrl", true);
21+
options.addArguments("-private");
22+
driver = new FirefoxDriver(options);
23+
}
24+
25+
@Test
26+
void canSwitchToBlue() {
27+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
28+
29+
WebElement body = driver.findElement(By.tagName("body"));
30+
String bgColor = body.getCssValue("background-color");
31+
32+
String expectedColor = "rgb(255, 255, 255)";
33+
// Background color is white
34+
Assertions.assertEquals(bgColor, expectedColor);
35+
36+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
37+
38+
driver.findElement(By.id("blue-btn")).click();
39+
body = driver.findElement(By.tagName("body"));
40+
bgColor = body.getCssValue("background-color");
41+
42+
expectedColor = "rgb(173, 216, 230)";
43+
// Background color is blue
44+
Assertions.assertEquals(bgColor, expectedColor);
45+
46+
System.out.println(
47+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
48+
.getMethodName() + " => executed successfully");
49+
}
50+
51+
@Test
52+
void canSwitchToGreen() {
53+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
54+
55+
WebElement body = driver.findElement(By.tagName("body"));
56+
String bgColor = body.getCssValue("background-color");
57+
58+
String expectedColor = "rgb(255, 255, 255)";
59+
Assertions.assertEquals(bgColor, expectedColor);
60+
61+
driver.findElement(By.id("green-btn")).click();
62+
body = driver.findElement(By.tagName("body"));
63+
bgColor = body.getCssValue("background-color");
64+
65+
expectedColor = "rgb(144, 238, 144)";
66+
Assertions.assertEquals(bgColor, expectedColor);
67+
68+
System.out.println(
69+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
70+
.getMethodName() + " => executed successfully");
71+
}
72+
73+
@Test
74+
void canHaveTheDefaultBackgroundColor() {
75+
driver.get("https://www.selenium.dev/selenium/web/cookie-background.html");
76+
77+
WebElement body = driver.findElement(By.tagName("body"));
78+
String bgColor = body.getCssValue("background-color");
79+
80+
String expectedColor = "rgb(255, 255, 255)";
81+
Assertions.assertEquals(bgColor, expectedColor);
82+
83+
System.out.println(
84+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
85+
.getMethodName() + " => executed successfully");
86+
}
87+
88+
@AfterEach
89+
public void cleanup() {
90+
driver.quit();
91+
}
92+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
package dev.selenium.bidirectional.webdriver_bidi.user_context;
2+
3+
import org.junit.jupiter.api.AfterAll;
4+
import org.junit.jupiter.api.Assertions;
5+
import org.junit.jupiter.api.BeforeAll;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.Test;
8+
import org.openqa.selenium.WebDriver;
9+
import org.openqa.selenium.WindowType;
10+
import org.openqa.selenium.bidi.browsingcontext.BrowsingContext;
11+
import org.openqa.selenium.bidi.browsingcontext.CreateContextParameters;
12+
import org.openqa.selenium.bidi.browsingcontext.Locator;
13+
import org.openqa.selenium.bidi.browsingcontext.ReadinessState;
14+
import org.openqa.selenium.bidi.module.Browser;
15+
import org.openqa.selenium.bidi.module.Input;
16+
import org.openqa.selenium.bidi.script.NodeProperties;
17+
import org.openqa.selenium.bidi.script.RemoteValue;
18+
import org.openqa.selenium.firefox.FirefoxDriver;
19+
import org.openqa.selenium.firefox.FirefoxOptions;
20+
import org.openqa.selenium.interactions.Actions;
21+
import org.openqa.selenium.remote.RemoteWebElement;
22+
23+
class SingleInstanceCookieParallelTest {
24+
25+
private static WebDriver driver;
26+
BrowsingContext context;
27+
28+
@BeforeAll
29+
public static void beforeAll() {
30+
FirefoxOptions options = new FirefoxOptions();
31+
options.setCapability("webSocketUrl", true);
32+
driver = new FirefoxDriver(options);
33+
34+
// To use Grid uncomment the lines below
35+
36+
// driver = new RemoteWebDriver(
37+
// new URL("http://localhost:4444"),
38+
// options, false);
39+
//
40+
// Augmenter augmenter = new Augmenter();
41+
// driver = augmenter.augment(driver);
42+
}
43+
44+
@BeforeEach
45+
public void setup() {
46+
Browser browser = new Browser(driver);
47+
String userContext = browser.createUserContext();
48+
49+
CreateContextParameters parameters = new CreateContextParameters(WindowType.TAB);
50+
parameters.userContext(userContext);
51+
52+
context = new BrowsingContext(driver, parameters);
53+
}
54+
55+
@Test
56+
void canSwitchToBlue() {
57+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
58+
59+
RemoteValue value = context.locateNode(Locator.xpath("/html/body/button[1]"));
60+
61+
Input inputModule = new Input(driver);
62+
Actions actions = new Actions(driver);
63+
64+
RemoteWebElement element = new RemoteWebElement();
65+
element.setId(value.getSharedId().get());
66+
actions.moveToElement(element).click();
67+
68+
inputModule.perform(context.getId(), actions.getSequences());
69+
70+
value = context.locateNode(Locator.xpath("/html/body"));
71+
72+
NodeProperties properties = (NodeProperties) value.getValue().get();
73+
String bgColor = properties.getAttributes().get().get("style");
74+
75+
Assertions.assertEquals(bgColor, "background-color: lightblue;");
76+
System.out.println(
77+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
78+
.getMethodName() + " => executed successfully");
79+
}
80+
81+
@Test
82+
void canSwitchToGreen() {
83+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
84+
85+
RemoteValue value = context.locateNode(Locator.xpath("/html/body"));
86+
87+
NodeProperties properties = (NodeProperties) value.getValue().get();
88+
String bgColor = properties.getAttributes().get().get("style");
89+
90+
Assertions.assertEquals(bgColor, "background-color: white;");
91+
92+
value = context.locateNode(Locator.xpath("/html/body/button[2]"));
93+
94+
Input inputModule = new Input(driver);
95+
Actions actions = new Actions(driver);
96+
97+
RemoteWebElement element = new RemoteWebElement();
98+
element.setId(value.getSharedId().get());
99+
actions.moveToElement(element).click();
100+
101+
inputModule.perform(context.getId(), actions.getSequences());
102+
103+
value = context.locateNode(Locator.xpath("/html/body"));
104+
105+
properties = (NodeProperties) value.getValue().get();
106+
bgColor = properties.getAttributes().get().get("style");
107+
108+
Assertions.assertEquals(bgColor, "background-color: lightgreen;");
109+
System.out.println(
110+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
111+
.getMethodName() + " => executed successfully");
112+
}
113+
114+
@Test
115+
void canHaveTheDefaultBackgroundColor() {
116+
context.navigate("https://www.selenium.dev/selenium/web/cookie-background.html", ReadinessState.COMPLETE);
117+
118+
RemoteValue value = context.locateNode(Locator.xpath("/html/body"));
119+
120+
NodeProperties properties = (NodeProperties) value.getValue().get();
121+
String bgColor = properties.getAttributes().get().get("style");
122+
123+
Assertions.assertEquals(bgColor, "background-color: white;");
124+
System.out.println(
125+
Thread.currentThread().getName() + " " + Thread.currentThread().getStackTrace()[1]
126+
.getMethodName() + " => executed successfully");
127+
}
128+
129+
@AfterAll
130+
public static void cleanup() {
131+
driver.quit();
132+
}
133+
}

examples/javascript/package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"license": "Apache-2.0",
99
"dependencies": {
1010
"assert": "2.1.0",
11-
"selenium-webdriver": "4.29.0"
11+
"selenium-webdriver": "4.30.0"
1212
},
1313
"devDependencies": {
1414
"mocha": "11.1.0"

examples/kotlin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<maven-surefire-plugin.version>3.5.2</maven-surefire-plugin.version>
2121

2222
<java.version>1.8</java.version>
23-
<selenium.version>4.29.0</selenium.version>
23+
<selenium.version>4.30.0</selenium.version>
2424

2525
<maven.compiler.target>${java.version}</maven.compiler.target>
2626
<maven.compiler.source>${java.version}</maven.compiler.source>

examples/kotlin/src/test/kotlin/dev/selenium/actions_api/ActionsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ActionsTest : BaseTest() {
4747
(driver as RemoteWebDriver).resetInputState()
4848

4949
actions.sendKeys("a").perform()
50-
Assertions.assertEquals("A", clickable.getAttribute("value").get(0).toString())
51-
Assertions.assertEquals("a", clickable.getAttribute("value").get(1).toString())
50+
Assertions.assertEquals("A", clickable.getAttribute("value")!!.get(0).toString())
51+
Assertions.assertEquals("a", clickable.getAttribute("value")!!.get(1).toString())
5252
}
5353
}

examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class MouseTest : BaseTest() {
3737
.click(clickable)
3838
.perform()
3939

40-
Assertions.assertTrue(driver.getCurrentUrl().contains("resultPage.html"))
40+
Assertions.assertTrue(driver.getCurrentUrl()!!.contains("resultPage.html"))
4141
}
4242

4343
@Test

examples/python/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
selenium==4.29.0
1+
selenium==4.30.0
22
pytest==8.3.5
33
trio==0.29.0
44
pytest-trio==0.8.0

examples/python/tests/bidi/cdp/test_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44
from selenium.webdriver.common.by import By
5-
from selenium.webdriver.common.devtools.v131.network import Headers
5+
from selenium.webdriver.common.devtools.v134.network import Headers
66

77

88
@pytest.mark.trio

0 commit comments

Comments
 (0)