Skip to content

Commit

Permalink
Merge branch 'trunk' into enhance-testing-types
Browse files Browse the repository at this point in the history
  • Loading branch information
shbenzer authored Nov 3, 2024
2 parents 68211ed + 42cd60b commit f7e3805
Show file tree
Hide file tree
Showing 95 changed files with 2,054 additions and 1,035 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Link check
continue-on-error: true # <- If set to false, run fails with broken links
uses: untitaker/hyperlink@0.1.32
uses: untitaker/hyperlink@0.1.43
with:
args: website_and_docs/public/ --check-anchors

Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Contributing to the Selenium site and docs

Please follow this [link](https://selenium.dev/documentation/about/contributing/)
for all the contribution details.
Please follow this [link](https://selenium.dev/documentation/about/contributing/) for all the contribution details.
2 changes: 1 addition & 1 deletion GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Governance

Content moved to https://www.selenium.dev/governance/
Content moved to <https://www.selenium.dev/governance/>
25 changes: 9 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This is the repository used to build and publish the official Selenium [website]
We use [Hugo](https://gohugo.io/) and the [Docsy theme](https://www.docsy.dev/)
to build and render the site. You will need the **extended**
Sass/SCSS version of the Hugo binary to work on this site. We recommend
to use Hugo 0.125.4
to use **[Hugo 0.125.4](https://github.com/gohugoio/hugo/releases/tag/v0.125.4)**

Steps needed to have this working locally and work on it:

Expand All @@ -25,31 +25,26 @@ A full contribution guideline can be seen at [contributing](https://selenium.dev

## How to get involved?

Please check all the information available at https://selenium.dev/getinvolved/
Please check all the information available at <https://selenium.dev/getinvolved/>

### Do not want to clone the repository to contribute? Use GitPod.
### Do not want to clone the repository to contribute? Use GitPod

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/SeleniumHQ/seleniumhq.github.io)


## For Selenium Site and Documentation maintainers

### How does the site and docs get build?

GitHub actions runs for every commit on each PR and protected branch. The regular CI execution will
build the site with Hugo to verify that the commit works. The description of these steps can be seen
at the actions configuration file, [one for testing a PR](./.github/workflows/test.yml), and
[one for deploying the site](./.github/workflows/deploy.yml)
at the actions configuration file, [one for testing a PR](./.github/workflows/test.yml), and [one for deploying the site](./.github/workflows/deploy.yml)

### How are the site and docs deployed?

After each CI execution that happens in the `trunk` branch, the script [build-site.sh](./build-site.sh)
is executed for deployment. This script checks for the string `[deploy site]` in the commit message.
After each CI execution that happens in the `trunk` branch, the script [build-site.sh](./build-site.sh) is executed for deployment. This script checks for the string `[deploy site]` in the commit message.

If the commit message contains that string, and the commit is in `trunk`, a
[GitHub action](./.github/workflows/deploy.yml) is triggered to build and deploy the site.
The site and docs will be built, and the changes will be committed to the branch `publish`
by the user [Selenium-CI](https://github.com/selenium-ci/).
If the commit message contains that string, and the commit is in `trunk`, a [GitHub action](./.github/workflows/deploy.yml) is triggered to build and deploy the site.
The site and docs will be built, and the changes will be committed to the branch `publish` by the user [Selenium-CI](https://github.com/selenium-ci/).

*What is important to take into account is that the source files for the site are in the `trunk`
branch, and the files that get deployed are pushed to the `publish` branch.*
Expand All @@ -59,11 +54,9 @@ repo [settings](https://github.com/SeleniumHQ/seleniumhq.github.io/settings) (if
you should be able to access the link).

The selenium.
domain is managed at https://www.gandi.net/en, if you need access to it, reach out to
any of the [PLC](https://www.selenium.dev/project/structure/#plc) or [TLC](https://www.selenium.dev/project/structure/#tlc)
domain is managed at <https://www.gandi.net/en>, if you need access to it, reach out to any of the [PLC](https://www.selenium.dev/project/structure/#plc) or [TLC](https://www.selenium.dev/project/structure/#tlc)
members, who can help you with that.

If for any reason, you need to setup the domain redirection again,
we followed this [guide](http://spector.io/how-to-set-up-github-pages-with-a-custom-domain-on-gandi/),
but any tutorial/guide showing how to redirect a domain to GitHub pages should do.

but any tutorial/guide showing how to redirect a domain to GitHub pages should do.
2 changes: 1 addition & 1 deletion examples/dotnet/SeleniumDocs/BaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BaseTest
protected IWebDriver driver;
protected Uri GridUrl;
private Process _webserverProcess;
private const string ServerJarName = "selenium-server-4.25.0.jar";
private const string ServerJarName = "selenium-server-4.26.0.jar";
private static readonly string BaseDirectory = AppContext.BaseDirectory;
private const string RelativePathToGrid = "../../../../../";
private readonly string _examplesDirectory = Path.GetFullPath(Path.Combine(BaseDirectory, RelativePathToGrid));
Expand Down
14 changes: 7 additions & 7 deletions examples/dotnet/SeleniumDocs/BiDi/CDP/NetworkTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
using OpenQA.Selenium;
using OpenQA.Selenium.DevTools;
using System.Linq;
using OpenQA.Selenium.DevTools.V129.Network;
using OpenQA.Selenium.DevTools.V129.Performance;
using OpenQA.Selenium.DevTools.V130.Network;
using OpenQA.Selenium.DevTools.V130.Performance;


namespace SeleniumDocs.BiDi.CDP
Expand All @@ -16,7 +16,7 @@ public class NetworkTest : BaseTest
[TestInitialize]
public void Startup()
{
StartDriver("129");
StartDriver("130");
}

[TestMethod]
Expand Down Expand Up @@ -109,9 +109,9 @@ public async Task PerformanceMetrics()
driver.Url = "https://www.selenium.dev/selenium/web/frameset.html";

var session = ((IDevTools)driver).GetDevToolsSession();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V130.DevToolsSessionDomains>();

await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V129.Performance.EnableCommandSettings());
await domains.Performance.Enable(new OpenQA.Selenium.DevTools.V13.Performance.EnableCommandSettings());
var metricsResponse =
await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
new GetMetricsCommandSettings()
Expand All @@ -130,8 +130,8 @@ await session.SendCommand<GetMetricsCommandSettings, GetMetricsCommandResponse>(
public async Task SetCookie()
{
var session = ((IDevTools)driver).GetDevToolsSession();
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V129.DevToolsSessionDomains>();
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V129.Network.EnableCommandSettings());
var domains = session.GetVersionSpecificDomains<OpenQA.Selenium.DevTools.V130.DevToolsSessionDomains>();
await domains.Network.Enable(new OpenQA.Selenium.DevTools.V130.Network.EnableCommandSettings());

var cookieCommandSettings = new SetCookieCommandSettings
{
Expand Down
81 changes: 81 additions & 0 deletions examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

namespace SeleniumDocumentation.SeleniumInteractions
{
[TestClass]
public class PrintOptionsTest
{
[TestMethod]
public void TestOrientation()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://selenium.dev");
PrintOptions printOptions = new PrintOptions();
printOptions.Orientation = PrintOrientation.Landscape;
PrintOrientation currentOrientation = printOptions.Orientation;
}

[TestMethod]
public void TestRange()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://selenium.dev");
PrintOptions printOptions = new PrintOptions();
printOptions.AddPageRangeToPrint("1-3"); // add range of pages
printOptions.AddPageToPrint(5); // add individual page
}

[TestMethod]
public void TestSize()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
PrintOptions.PageSize currentDimensions = printOptions.PageDimensions;
}

[TestMethod]
public void TestBackgrounds()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
printOptions.OutputBackgroundImages = true;
bool currentBackgrounds = printOptions.OutputBackgroundImages;
}

[TestMethod]
public void TestMargins()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
PrintOptions.Margins currentMargins = printOptions.PageMargins;
}


[TestMethod]
public void TestScale()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
printOptions.ScaleFactor = 0.5;
double currentScale = printOptions.ScaleFactor;
}

[TestMethod]
public void TestShrinkToFit()
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.selenium.dev/");
PrintOptions printOptions = new PrintOptions();
printOptions.ShrinkToFit = true;
bool currentShrinkToFit = printOptions.ShrinkToFit;
}
}

}
4 changes: 2 additions & 2 deletions examples/java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ repositories {
}

dependencies {
testImplementation 'org.seleniumhq.selenium:selenium-java:4.25.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.2'
testImplementation 'org.seleniumhq.selenium:selenium-java:4.26.0'
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.11.3'
}

test {
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.25.0</selenium.version>
<selenium.version>4.26.0</selenium.version>
</properties>

<repositories>
Expand All @@ -40,7 +40,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.11.2</version>
<version>5.11.3</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package dev.selenium.interactions;

import org.openqa.selenium.Pdf;
import org.openqa.selenium.bidi.browsingcontext.BrowsingContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
import org.openqa.selenium.print.PageMargin;
import org.openqa.selenium.print.PrintOptions;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.PrintsPage;
import dev.selenium.BaseTest;

public class PrintsPageTest extends BaseTest{

@BeforeEach
public void setup() {
ChromeOptions options = new ChromeOptions();
options.setCapability("webSocketUrl", true);
driver = new ChromeDriver(options);
}

@Test
public void PrintWithPrintsPageTest()
{
driver.get("https://www.selenium.dev/");
PrintsPage printer = (PrintsPage) driver;
PrintOptions printOptions = new PrintOptions();
Pdf printedPage = printer.print(printOptions);
Assertions.assertNotNull(printedPage);
}

@Test
public void PrintWithBrowsingContextTest()
{
BrowsingContext browsingContext = new BrowsingContext(driver, driver.getWindowHandle());
driver.get("https://www.selenium.dev/selenium/web/formPage.html");
PrintOptions printOptions = new PrintOptions();
String printPage = browsingContext.print(printOptions);
Assertions.assertTrue(printPage.length() > 0);
}
}
46 changes: 24 additions & 22 deletions examples/javascript/package-lock.json

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

4 changes: 2 additions & 2 deletions examples/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"license": "Apache-2.0",
"dependencies": {
"assert": "2.1.0",
"selenium-webdriver": "4.25.0"
"selenium-webdriver": "4.26.0"
},
"devDependencies": {
"mocha": "10.7.3"
"mocha": "10.8.2"
}
}
Loading

0 comments on commit f7e3805

Please sign in to comment.