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
namespace Applitools | |
{ | |
[TestFixture] | |
[Category("Examples of different baselines")] | |
[Parallelizable] | |
public class BaselinesExamples : BaseClass |
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
public class BaselinesExamples : BaseClass | |
{ | |
//These have been moved to BaseClass | |
//public const string AppName = "sample app 1"; | |
//public string TestCaseName => "Test1"; | |
[Test] | |
public void SetBaselineUsingAppName() | |
{ |
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
GoToPricingPage(); | |
//Here we are initializing the test in Applitools and passing in 4 parameters | |
// the IWebDriver, application name, test name, viewport size to open our app in | |
Eyes.Open(Driver, AppName, TestCaseName, Resolution1080P); | |
//Use the Applitools algorithm to check the whole page for visual validity | |
Eyes.CheckWindow(); |
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
Eyes.Open(Driver, AppName, TestCaseName, Resolution1080P); | |
Eyes.CheckWindow("FullPageScreenshot"); |
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
[Test] | |
public void SetBaselineUsingDifferentAppName() | |
{ | |
GoToPricingPage(); | |
Eyes.Open(Driver, "app 2", TestCaseName, Resolution1080P); | |
Eyes.CheckWindow(); |
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
[Test] | |
public void SetBaselineUsingTestName() | |
{ | |
GoToPricingPage(); | |
//all the parameters are the same, except we provided a new test name | |
Eyes.Open(Driver, AppName, "new test name", Resolution1080P); | |
Eyes.CheckWindow(); |
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
[Test] | |
public void SetBaselineUsingViewportSize() | |
{ | |
GoToPricingPage(); | |
//all the parameters are the same, except we provided a new viewport size | |
Eyes.Open(Driver, AppName, TestCaseName, Resolution720P); | |
Eyes.CheckWindow(); | |
} |
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
[SetUp] | |
public void SetupForEverySingleTestMethod() | |
{ | |
Driver = new ChromeDriver(); | |
Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); | |
Eyes = new Eyes | |
{ | |
//This sets the Applitools API key so that you can access the account | |
//ApiKey = "vDPsWHm9wt7dIAvfQRH79HF105is4Lhc9710rH1xW7BUl0146"; | |
ApiKey = Environment.GetEnvironmentVariable("APPLITOOLS_API_KEY", |
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
[TearDown] | |
public void TearDownForEverySingleTestMethod() | |
{ | |
//Close your Selenium browser | |
Driver.Quit(); | |
//Close applitools eyes so that your test run is saved | |
Eyes.Close(); | |
//Quit applitools if it is not already closed | |
Eyes.AbortIfNotClosed(); | |
} |
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
[Test] | |
public void SetBaselineUsingDifferentAppName() | |
{ | |
GoToPricingPage(); | |
Eyes.Open(Driver, "app 2", TestCaseName, Resolution1080P); | |
Eyes.CheckWindow(); | |
} | |
[Test] | |
public void SetBaselineUsingTestName() |
OlderNewer