Skip to content

Commit

Permalink
Merge branch 'trunk' into update-python-browsers-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartinez1 authored Sep 6, 2024
2 parents 1e0dc7b + a2c0c84 commit 68b325f
Show file tree
Hide file tree
Showing 32 changed files with 352 additions and 192 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/calibreapp-image-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
if: |
github.event_name != 'pull_request' &&
steps.calibre.outputs.markdown != ''
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
title: Auto Compress Images
branch-suffix: timestamp
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/java-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ jobs:
command: |
pip install yq
xml_content=$(curl -sf https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/)
latest_snapshot=$(echo $xml_content | xq '.content.data."content-item"' | jq -r .text)
echo $latest_snapshot
latest_snapshot=$(echo "$xml_content" | xq '.content.data."content-item"' | jq -r 'sort_by(.lastModified) | last | .text')
echo "Latest Selenium Snapshot: $latest_snapshot"
cd examples/java
mvn -B -U test -Dselenium.version="$latest_snapshot"
Expand All @@ -81,7 +81,7 @@ jobs:
command: |
pip install yq
$xml_content = Invoke-WebRequest -Uri "https://oss.sonatype.org/service/local/repositories/snapshots/content/org/seleniumhq/selenium/selenium-java/"
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r .text
Write-Output $latest_snapshot
$latest_snapshot = $xml_content.Content | xq '.content.data.\"content-item\"' | jq -r 'sort_by(.lastModified) | last | .text'
Write-Output "Latest Selenium Snapshot: $latest_snapshot"
cd examples/java
mvn -B -U test "-Dselenium.version=$latest_snapshot"
4 changes: 2 additions & 2 deletions examples/dotnet/SeleniumDocs/SeleniumDocs.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
<PackageReference Include="Selenium.Support" Version="4.23.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.23.0" />
<PackageReference Include="Selenium.Support" Version="4.24.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.24.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

dependencies {
testImplementation 'org.seleniumhq.selenium:selenium-java:4.23.1'
testImplementation 'org.seleniumhq.selenium:selenium-java:4.24.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.0'
}

Expand Down
4 changes: 2 additions & 2 deletions examples/java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<selenium.version>4.23.1</selenium.version>
<selenium.version>4.24.0</selenium.version>
</properties>

<repositories>
Expand Down Expand Up @@ -55,7 +55,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.4.0</version>
<version>3.5.0</version>
<configuration>
<properties>
<configurationParameters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.v125.browser.Browser;
import org.openqa.selenium.devtools.v125.network.Network;
import org.openqa.selenium.devtools.v125.network.model.Headers;
import org.openqa.selenium.devtools.v128.browser.Browser;
import org.openqa.selenium.devtools.v128.network.Network;
import org.openqa.selenium.devtools.v128.network.model.Headers;
import org.openqa.selenium.support.ui.WebDriverWait;

public class CdpApiTest extends BaseTest {
Expand All @@ -27,7 +27,7 @@ public class CdpApiTest extends BaseTest {
@BeforeEach
public void createSession() {
ChromeOptions options = new ChromeOptions();
options.setBrowserVersion("125");
options.setBrowserVersion("128");
driver = new ChromeDriver(options);
wait = new WebDriverWait(driver, Duration.ofSeconds(10));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.HasDevTools;
import org.openqa.selenium.devtools.NetworkInterceptor;
import org.openqa.selenium.devtools.v125.browser.Browser;
import org.openqa.selenium.devtools.v125.network.Network;
import org.openqa.selenium.devtools.v125.performance.Performance;
import org.openqa.selenium.devtools.v125.performance.model.Metric;
import org.openqa.selenium.devtools.v128.browser.Browser;
import org.openqa.selenium.devtools.v128.network.Network;
import org.openqa.selenium.devtools.v128.performance.Performance;
import org.openqa.selenium.devtools.v128.performance.model.Metric;
import org.openqa.selenium.remote.http.*;
import org.openqa.selenium.support.ui.WebDriverWait;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,74 @@
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

package dev.selenium.interactions;

import dev.selenium.BaseTest;
import org.junit.jupiter.api.Test;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import java.time.Duration;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class FramesTest{

public class FramesTest extends BaseTest {
@Test
public void informationWithElements() {

WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(Duration.ofMillis(500));

// Navigate to Url
driver.get("https://www.selenium.dev/selenium/web/iframes.html");


//switch To IFrame using Web Element
WebElement iframe = driver.findElement(By.id("iframe1"));
//Switch to the frame
driver.switchTo().frame(iframe);
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
//Now we can type text into email field
WebElement emailE= driver.findElement(By.id("email"));
emailE.sendKeys("admin@selenium.dev");
emailE.clear();
driver.switchTo().defaultContent();


//switch To IFrame using name or id
driver.findElement(By.name("iframe1-name"));
//Switch to the frame
driver.switchTo().frame(iframe);
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
WebElement email=driver.findElement(By.id("email"));
//Now we can type text into email field
email.sendKeys("admin@selenium.dev");
email.clear();
driver.switchTo().defaultContent();


//switch To IFrame using index
driver.switchTo().frame(0);
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));

//leave frame
driver.switchTo().defaultContent();
assertEquals(true, driver.getPageSource().contains("This page has iframes"));

//quit the browser
driver.quit();
}

}
}
31 changes: 15 additions & 16 deletions examples/javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "Apache-2.0",
"dependencies": {
"assert": "2.1.0",
"selenium-webdriver": "4.23.0"
"selenium-webdriver": "4.24.0"
},
"devDependencies": {
"mocha": "10.7.3"
Expand Down
4 changes: 2 additions & 2 deletions examples/kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<junit5.version>5.11.0</junit5.version>
<wdm.version>5.2.3</wdm.version>

<maven-surefire-plugin.version>3.4.0</maven-surefire-plugin.version>
<maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>

<java.version>1.8</java.version>
<selenium.version>4.23.1</selenium.version>
<selenium.version>4.24.0</selenium.version>

<maven.compiler.target>${java.version}</maven.compiler.target>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
2 changes: 1 addition & 1 deletion examples/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
selenium==4.23.1
selenium==4.24.0
pytest
trio
pytest-trio
Expand Down
2 changes: 1 addition & 1 deletion examples/python/tests/bidi/cdp/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from selenium.webdriver.common.by import By
from selenium.webdriver.common.devtools.v125.network import Headers
from selenium.webdriver.common.devtools.v128.network import Headers


@pytest.mark.trio
Expand Down
4 changes: 2 additions & 2 deletions examples/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.35'
gem 'rubocop-rspec', '~> 3.0'
gem 'selenium-devtools', '= 0.127.0'
gem 'selenium-webdriver', '= 4.23.0'
gem 'selenium-devtools', '= 0.128.0'
gem 'selenium-webdriver', '= 4.24.0'
19 changes: 9 additions & 10 deletions examples/ruby/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ GEM
json (2.7.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
parallel (1.25.1)
parser (3.3.4.0)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
racc (1.8.1)
Expand All @@ -30,26 +30,25 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.0)
rubocop (1.65.1)
rubocop (1.66.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-ast (>= 1.32.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-rspec (3.0.4)
rubocop (~> 1.61)
ruby-progressbar (1.13.0)
rubyzip (2.3.2)
selenium-devtools (0.127.0)
selenium-devtools (0.128.0)
selenium-webdriver (~> 4.2)
selenium-webdriver (4.23.0)
selenium-webdriver (4.24.0)
base64 (~> 0.2)
logger (~> 1.4)
rexml (~> 3.2, >= 3.2.5)
Expand All @@ -73,8 +72,8 @@ DEPENDENCIES
rspec (~> 3.0)
rubocop (~> 1.35)
rubocop-rspec (~> 3.0)
selenium-devtools (= 0.127.0)
selenium-webdriver (= 4.23.0)
selenium-devtools (= 0.128.0)
selenium-webdriver (= 4.24.0)

BUNDLED WITH
2.5.6
Loading

0 comments on commit 68b325f

Please sign in to comment.