-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 syber911911-feature-branch
- Loading branch information
Showing
80 changed files
with
6,240 additions
and
2,027 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
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
Binary file not shown.
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 |
---|---|---|
|
@@ -14,6 +14,14 @@ | |
] | ||
} | ||
], | ||
"permissions": [ | ||
"storage", | ||
"scripting" | ||
], | ||
"host_permissions": [ | ||
"https://*/*", | ||
"http://*/*" | ||
], | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
|
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
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
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,74 @@ | ||
using NUnit.Framework; | ||
using System; | ||
|
||
namespace OpenQA.Selenium | ||
{ | ||
[TestFixture] | ||
public class PrintTest : DriverTestFixture | ||
{ | ||
private const string MagicString = "JVBER"; | ||
private ISupportsPrint printer; | ||
|
||
[SetUp] | ||
public void LocalSetUp() | ||
{ | ||
Assert.That(driver, Is.InstanceOf<ISupportsPrint>(), $"Driver does not support {nameof(ISupportsPrint)}."); | ||
|
||
printer = driver as ISupportsPrint; | ||
|
||
driver.Navigate().GoToUrl(this.printPage); | ||
} | ||
|
||
[Test] | ||
public void CanPrintPage() | ||
{ | ||
var pdf = printer.Print(new PrintOptions()); | ||
|
||
Assert.That(pdf.AsBase64EncodedString, Does.Contain(MagicString)); | ||
} | ||
|
||
[Test] | ||
public void CanPrintTwoPages() | ||
{ | ||
var options = new PrintOptions(); | ||
|
||
options.AddPageRangeToPrint("1-2"); | ||
|
||
var pdf = printer.Print(options); | ||
|
||
Assert.That(pdf.AsBase64EncodedString, Does.Contain(MagicString)); | ||
} | ||
|
||
[Test] | ||
public void CanPrintWithMostParams() | ||
{ | ||
var options = new PrintOptions() | ||
{ | ||
Orientation = PrintOrientation.Landscape, | ||
ScaleFactor = 0.5, | ||
PageDimensions = new PrintOptions.PageSize { Width = 200, Height = 100 }, | ||
PageMargins = new PrintOptions.Margins { Top = 1, Bottom = 1, Left = 2, Right = 2 }, | ||
OutputBackgroundImages = true, | ||
ShrinkToFit = false | ||
}; | ||
|
||
options.AddPageRangeToPrint("1-3"); | ||
|
||
var pdf = printer.Print(options); | ||
|
||
Assert.That(pdf.AsBase64EncodedString, Does.Contain(MagicString)); | ||
} | ||
|
||
[Test] | ||
public void PageSizeCannotBeNull() | ||
{ | ||
Assert.That(() => new PrintOptions { PageDimensions = null }, Throws.InstanceOf<ArgumentNullException>()); | ||
} | ||
|
||
[Test] | ||
public void MarginsCannotBeNull() | ||
{ | ||
Assert.That(() => new PrintOptions { PageMargins = null }, Throws.InstanceOf<ArgumentNullException>()); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.