Skip to content

Commit 13005ec

Browse files
authored
Merge branch 'trunk' into trunk
2 parents 61431b9 + 27ef6ff commit 13005ec

File tree

85 files changed

+1652
-1129
lines changed

Some content is hidden

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

85 files changed

+1652
-1129
lines changed

Diff for: .github/workflows/deploy.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
push:
55
branches:
66
- trunk
7+
workflow_dispatch:
78

89
jobs:
910
deploy:
10-
if: contains(toJson(github.event.commits), '[deploy site]') == true
11+
if: contains(toJson(github.event.commits), '[deploy site]') == true || github.event_name == 'workflow_dispatch'
1112
runs-on: ubuntu-24.04
1213
steps:
1314
- name: Checkout repo

Diff for: .github/workflows/link-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Setup Node
2828
uses: actions/setup-node@v4
2929
with:
30-
node-version: '18.14.2'
30+
node-version: '18.20.8'
3131
cache: 'npm'
3232
# The action defaults to search for the dependency file (package-lock.json,
3333
# npm-shrinkwrap.json or yarn.lock) in the repository root, and uses its

Diff for: .github/workflows/ruby-examples.yml

+25-6
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ jobs:
4141
if: matrix.os != 'windows'
4242
run: |
4343
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
44-
- name: Start Xvfb
45-
if: matrix.os == 'ubuntu'
46-
run: Xvfb :99 &
44+
- name: Setup Fluxbox and Xvfb
45+
if: inputs.os == 'ubuntu'
46+
run: |
47+
sudo apt-get -y install fluxbox libxss1 libappindicator3-1 libindicator7
48+
Xvfb :99 &
49+
fluxbox -display :99 &
50+
echo "DISPLAY=:99" >> "$GITHUB_ENV"
4751
- name: Set up Ruby
4852
uses: ruby/setup-ruby@v1
4953
with:
50-
ruby-version: 3.0
54+
ruby-version: 3.1
5155
bundler-cache: true
5256
- name: Install Gems Nightly non-Windows
5357
if: matrix.release == 'nightly' && matrix.os != 'windows'
@@ -83,11 +87,26 @@ jobs:
8387
with:
8488
distribution: 'temurin'
8589
java-version: 11
86-
- name: Run tests
90+
- name: Run tests on Windows
91+
if: matrix.os == 'windows'
92+
uses: nick-invision/[email protected]
93+
with:
94+
timeout_minutes: 20
95+
max_attempts: 2
96+
command: |
97+
cd examples/ruby
98+
bundle exec rspec
99+
new_command_on_retry: |
100+
cd examples/ruby; $env:DEBUG="true"; bundle exec rspec --only-failures
101+
- name: Run tests on ${{ matrix.os }}
102+
if: matrix.os != 'windows'
87103
uses: nick-invision/[email protected]
88104
with:
89105
timeout_minutes: 20
90-
max_attempts: 3
106+
max_attempts: 2
91107
command: |
92108
cd examples/ruby
93109
bundle exec rspec
110+
new_command_on_retry: |
111+
cd examples/ruby
112+
DEBUG=true bundle exec rspec --only-failures

Diff for: examples/dotnet/SeleniumDocs/BaseTest.cs

+1-1
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.31.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));

Diff for: examples/dotnet/SeleniumDocs/Elements/InformationTest.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,43 @@ public void TestInformationCommands(){
2222
bool isEmailVisible = driver.FindElement(By.Name("email_input")).Displayed;
2323
Assert.AreEqual(isEmailVisible, true);
2424

25-
//isEnabled
26-
//returns true if element is enabled else returns false
25+
// isEnabled
26+
// returns true if element is enabled else returns false
2727
bool isEnabledButton = driver.FindElement(By.Name("button_input")).Enabled;
2828
Assert.AreEqual(isEnabledButton, true);
2929

30-
//isSelected
31-
//returns true if element is checked else returns false
30+
// isSelected
31+
// returns true if element is checked else returns false
3232
bool isSelectedCheck = driver.FindElement(By.Name("checkbox_input")).Selected;
3333
Assert.AreEqual(isSelectedCheck, true);
3434

35-
//TagName
36-
//returns TagName of the element
35+
// TagName
36+
// returns TagName of the element
3737
string tagNameInp = driver.FindElement(By.Name("email_input")).TagName;
3838
Assert.AreEqual(tagNameInp, "input");
3939

40-
//Get Location and Size
41-
//Get Location
40+
// Get Location and Size
41+
// Get Location
4242
IWebElement rangeElement = driver.FindElement(By.Name("range_input"));
4343
Point point = rangeElement.Location;
4444
Assert.IsNotNull(point.X);
45-
//Get Size
45+
// Get Size
4646
int height=rangeElement.Size.Height;
4747
Assert.IsNotNull(height);
4848

4949
// Retrieves the computed style property 'font-size' of field
5050
string cssValue = driver.FindElement(By.Name("color_input")).GetCssValue("font-size");
5151
Assert.AreEqual(cssValue, "13.3333px");
5252

53-
//GetText
53+
// GetText
5454
// Retrieves the text of the element
5555
string text = driver.FindElement(By.TagName("h1")).Text;
5656
Assert.AreEqual(text, "Testing Inputs");
5757

58-
//FetchAttributes
59-
//identify the email text box
58+
// FetchAttributes
59+
// identify the email text box
6060
IWebElement emailTxt = driver.FindElement(By.Name("email_input"));
61-
//fetch the value property associated with the textbox
61+
// fetch the value property associated with the textbox
6262
string valueInfo = emailTxt.GetAttribute("value");
6363
Assert.AreEqual(valueInfo, "admin@localhost");
6464

Diff for: examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

+2-2
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.31.0" />
14+
<PackageReference Include="Selenium.WebDriver" Version="4.31.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

Diff for: examples/java/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ repositories {
1010
}
1111

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

1717
test {

Diff for: examples/java/pom.xml

+3-3
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.31.0</selenium.version>
1717
</properties>
1818

1919
<repositories>
@@ -40,7 +40,7 @@
4040
<dependency>
4141
<groupId>org.junit.jupiter</groupId>
4242
<artifactId>junit-jupiter-engine</artifactId>
43-
<version>5.12.0</version>
43+
<version>5.12.1</version>
4444
<scope>test</scope>
4545
</dependency>
4646
<dependency>
@@ -55,7 +55,7 @@
5555
<plugin>
5656
<groupId>org.apache.maven.plugins</groupId>
5757
<artifactId>maven-surefire-plugin</artifactId>
58-
<version>3.5.2</version>
58+
<version>3.5.3</version>
5959
<configuration>
6060
<properties>
6161
<configurationParameters>

Diff for: examples/java/src/test/java/dev/selenium/bidi/cdp/CdpApiTest.java

+4-4
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
}

Diff for: examples/java/src/test/java/dev/selenium/bidi/cdp/NetworkTest.java

+4-4
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+
}

0 commit comments

Comments
 (0)