Skip to content

Commit 0cfbcf4

Browse files
authored
Merge branch 'trunk' into renovate/selenium-4.x
2 parents 39a2798 + 4794acc commit 0cfbcf4

File tree

28 files changed

+192
-228
lines changed

28 files changed

+192
-228
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717
- name: Setup Hugo
18-
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
18+
uses: peaceiris/actions-hugo@v3
1919
with:
2020
hugo-version: ' 0.125.4'
2121
extended: true

.github/workflows/link-check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
uses: actions/checkout@v4
2020

2121
- name: Set up Hugo
22-
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
22+
uses: peaceiris/actions-hugo@v3
2323
with:
24-
hugo-version: "0.110.0"
24+
hugo-version: ' 0.125.4'
2525
extended: true
2626

2727
- name: Setup Node
@@ -51,4 +51,4 @@ jobs:
5151
with:
5252
name: hyperlink-report
5353
path: website_and_docs/tmp/.hyperlink/hyperlink.log
54-
retention-days: 7 # default is 90 days
54+
retention-days: 7 # default is 90 days

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Checkout repo
1616
uses: actions/checkout@v4
1717
- name: Setup Hugo
18-
uses: peaceiris/actions-hugo@75d2e84710de30f6ff7268e08f310b60ef14033f
18+
uses: peaceiris/actions-hugo@v3
1919
with:
2020
hugo-version: '0.125.4'
2121
extended: true
Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,52 @@
1+
using System;
12
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using OpenQA.Selenium;
4+
using OpenQA.Selenium.Chrome;
25

36
namespace SeleniumDocs.Elements
47
{
58
[TestClass]
6-
public class InteractionTest : BaseTest
9+
public class InteractionTest
710
{
11+
[TestMethod]
12+
public void TestInteractionCommands()
13+
{
14+
IWebDriver driver = new ChromeDriver();
15+
driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromMilliseconds(500);
16+
17+
// Navigate to Url
18+
driver.Navigate().GoToUrl("https://www.selenium.dev/selenium/web/inputs.html");
19+
// Click on the element
20+
IWebElement checkInput = driver.FindElement(By.Name("checkbox_input"));
21+
checkInput.Click();
22+
23+
//Verify
24+
Boolean isChecked = checkInput.Selected;
25+
Assert.AreEqual(isChecked, false);
26+
27+
//SendKeys
28+
// Clear field to empty it from any previous data
29+
IWebElement emailInput = driver.FindElement(By.Name("email_input"));
30+
emailInput.Clear();
31+
//Enter Text
32+
String email = "admin@localhost.dev";
33+
emailInput.SendKeys(email);
34+
35+
//Verify
36+
String data = emailInput.GetAttribute("value");
37+
Assert.AreEqual(data, email);
38+
39+
40+
//Clear Element
41+
// Clear field to empty it from any previous data
42+
emailInput.Clear();
43+
data = emailInput.GetAttribute("value");
44+
45+
//Verify
46+
Assert.AreEqual(data, "");
47+
48+
//Quit the browser
49+
driver.Quit();
50+
}
851
}
952
}

examples/dotnet/SeleniumDocs/SeleniumDocs.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
10-
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.2" />
11-
<PackageReference Include="MSTest.TestAdapter" Version="3.3.1" />
12-
<PackageReference Include="MSTest.TestFramework" Version="3.3.1" />
9+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
10+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.6.0" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
12+
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
1313
<PackageReference Include="Selenium.Support" Version="4.21.0" />
1414
<PackageReference Include="Selenium.WebDriver" Version="4.21.0" />
1515
</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.20.0'
13+
testImplementation 'org.seleniumhq.selenium:selenium-java:4.21.0'
1414
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.2'
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>11</maven.compiler.source>
1414
<maven.compiler.target>11</maven.compiler.target>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<selenium.version>4.20.0</selenium.version>
16+
<selenium.version>4.21.0</selenium.version>
1717
</properties>
1818

1919
<repositories>

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

Lines changed: 10 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void canLocateNodes() {
4747
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
4848
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
4949

50-
LocateNodeParameters parameters = new LocateNodeParameters.Builder(Locator.css("div")).build();
50+
LocateNodeParameters parameters = new LocateNodeParameters(Locator.css("div"));
5151

5252
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
5353
Assertions.assertEquals(13, elements.size());
@@ -81,9 +81,8 @@ void canLocateNodesWithCSSLocator() {
8181
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
8282

8383
LocateNodeParameters parameters =
84-
new LocateNodeParameters.Builder(Locator.css("div.extraDiv, div.content"))
85-
.setMaxNodeCount(1)
86-
.build();
84+
new LocateNodeParameters(Locator.css("div.extraDiv, div.content"))
85+
.setMaxNodeCount(1);
8786

8887
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
8988

@@ -101,9 +100,7 @@ void canLocateNodesWithXPathLocator() {
101100
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
102101

103102
LocateNodeParameters parameters =
104-
new LocateNodeParameters.Builder(Locator.xpath("/html/body/div[2]"))
105-
.setMaxNodeCount(1)
106-
.build();
103+
new LocateNodeParameters(Locator.xpath("/html/body/div[2]")).setMaxNodeCount(1);
107104

108105
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
109106

@@ -121,9 +118,7 @@ void canLocateNodesWithInnerText() {
121118
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
122119

123120
LocateNodeParameters parameters =
124-
new LocateNodeParameters.Builder(Locator.innerText("Spaced out"))
125-
.setMaxNodeCount(1)
126-
.build();
121+
new LocateNodeParameters(Locator.innerText("Spaced out")).setMaxNodeCount(1);
127122

128123
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
129124

@@ -139,44 +134,12 @@ void canLocateNodesWithMaxNodeCount() {
139134
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
140135

141136
LocateNodeParameters parameters =
142-
new LocateNodeParameters.Builder(Locator.css("div")).setMaxNodeCount(4).build();
137+
new LocateNodeParameters(Locator.css("div")).setMaxNodeCount(4);
143138

144139
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
145140
Assertions.assertEquals(4, elements.size());
146141
}
147142

148-
@Test
149-
@Disabled
150-
void canLocateNodesWithNoneOwnershipParameter() {
151-
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
152-
153-
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
154-
155-
LocateNodeParameters parameters =
156-
new LocateNodeParameters.Builder(Locator.css("div"))
157-
.setOwnership(ResultOwnership.NONE)
158-
.build();
159-
160-
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
161-
Assertions.assertFalse(elements.get(0).getHandle().isPresent());
162-
}
163-
164-
@Test
165-
@Disabled
166-
void canLocateNodesWithRootOwnershipParameter() {
167-
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
168-
169-
driver.get("https://www.selenium.dev/selenium/web/xhtmlTest.html");
170-
171-
LocateNodeParameters parameters =
172-
new LocateNodeParameters.Builder(Locator.css("div"))
173-
.setOwnership(ResultOwnership.ROOT)
174-
.build();
175-
176-
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
177-
Assertions.assertTrue(elements.get(0).getHandle().isPresent());
178-
}
179-
180143
@Test
181144
@Disabled
182145
void canLocateNodesGivenStartNodes() {
@@ -205,10 +168,9 @@ void canLocateNodesGivenStartNodes() {
205168
new RemoteReference(RemoteReference.Type.SHARED_ID, value.getSharedId().get())));
206169

207170
LocateNodeParameters parameters =
208-
new LocateNodeParameters.Builder(Locator.css("input"))
171+
new LocateNodeParameters(Locator.css("input"))
209172
.setStartNodes(startNodes)
210-
.setMaxNodeCount(50)
211-
.build();
173+
.setMaxNodeCount(50);
212174

213175
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
214176
Assertions.assertEquals(35, elements.size());
@@ -223,10 +185,9 @@ void canLocateNodesInAGivenSandbox() {
223185
browsingContext.navigate("https://www.selenium.dev/selenium/web/xhtmlTest.html", ReadinessState.COMPLETE);
224186

225187
LocateNodeParameters parameters =
226-
new LocateNodeParameters.Builder(Locator.css("div"))
188+
new LocateNodeParameters(Locator.css("div"))
227189
.setSandbox(sandbox)
228-
.setMaxNodeCount(1)
229-
.build();
190+
.setMaxNodeCount(1);
230191

231192
List<RemoteValue> elements = browsingContext.locateNodes(parameters);
232193

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import org.junit.jupiter.api.BeforeEach;
1212
import org.junit.jupiter.api.Disabled;
1313
import org.junit.jupiter.api.Test;
14+
import org.junit.jupiter.api.condition.DisabledOnOs;
15+
import org.junit.jupiter.api.condition.OS;
1416
import org.openqa.selenium.bidi.module.Script;
1517
import org.openqa.selenium.bidi.browsingcontext.BrowsingContext;
1618
import org.openqa.selenium.bidi.script.LocalValue;
@@ -28,7 +30,7 @@ public void setup() {
2830
options.setCapability("webSocketUrl", true);
2931
driver = new FirefoxDriver(options);
3032
}
31-
33+
3234
@Test
3335
void canListenToChannelMessage()
3436
throws ExecutionException, InterruptedException, TimeoutException {
@@ -50,6 +52,7 @@ void canListenToChannelMessage()
5052
}
5153

5254
@Test
55+
@DisabledOnOs(value = OS.MAC, disabledReason = "Works locally, times out on CI")
5356
void canListenToRealmCreatedEvent()
5457
throws ExecutionException, InterruptedException, TimeoutException {
5558
try (Script script = new Script(driver)) {

examples/javascript/test/virtual_authenticator/virtualAuthenticator.spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,9 @@ suite(function(env) {
193193
assert.equal(0, credentialList.length);
194194
});
195195

196+
it('Set is user verified', async function() {
197+
options.setIsUserVerified(true);
198+
assert.equal(options.getIsUserVerified(), true);
199+
});
196200
});
197201
}, { browsers: [Browser.CHROME]});

0 commit comments

Comments
 (0)