-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into enhance-testing-types
- Loading branch information
Showing
95 changed files
with
2,054 additions
and
1,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.