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 TestBaseline() | |
{ | |
GoToPricingPage(); | |
UpdateElements(); | |
Eyes.Open(Driver, AppName, 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
public void IgnoreRegionUsingFindElements() | |
{ | |
Eyes.Open(Driver, AppName, "IgnoreRegionUsingFindElements", Resolution1080P); | |
//Ignoring with FindElement() | |
Eyes.Check("IgnoreRegionUsingFindElements", Target.Window(). | |
Ignore(Driver.FindElements(PriceLocator)[1])); | |
} |
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 void IgnoreRegionUsingBy() | |
{ | |
Eyes.Open(Driver, AppName, "IgnoreRegionUsingBy", Resolution1080P); | |
//Ignoring an element with By | |
Eyes.Check("IgnoreRegionUsingBy", Target.Window().Ignore(PriceLocator)); | |
} |
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 void IgnoreMultipleElements() | |
{ | |
Eyes.Open(Driver, AppName, "IgnoreMultipleElements", Resolution1080P); | |
//Ignore multiple elements with a single Check() | |
Eyes.Check("IgnoreMultipleElements", Target.Window().Ignore(PriceLocator, SubheaderLocator)); | |
} |
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 void FloatingRegion() | |
{ | |
Eyes.Open(Driver, AppName, "FloatingRegion", Resolution1080P); | |
//This will add a floating region to the social sharing toolbar | |
Eyes.Check("FloatingRegion", Target.Window().Floating(SocialSharingToolbar)); | |
} |
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 StrictRegion() | |
{ | |
Eyes.Open(Driver, AppName, "StrictRegion", Resolution1080P); | |
Eyes.MatchLevel = MatchLevel.Layout; | |
//This will add a strict region to all the price options | |
Eyes.Check("StrictRegion", Target.Window().Strict(PriceLocator)); | |
} |
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 ContentRegion() | |
{ | |
Eyes.Open(Driver, AppName, "ContentRegion", Resolution1080P); | |
//This will add a content region to all the price options | |
Eyes.Check("ContentRegion", Target.Window().Content(PriceLocator)); | |
} |
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 LayoutRegion() | |
{ | |
Eyes.Open(Driver, AppName, "LayoutRegion", Resolution1080P); | |
//This will add a layout region to the section that holds price information | |
Eyes.Check("LayoutRegion", Target.Window().Layout( | |
Driver.FindElement(By.XPath("//*[@class='et_pb_module et_pb_pricing " + | |
"clearfix et_pb_pricing_1 et_pb_pricing_tables_0 " + | |
"et_pb_no_featured_in_first_row']")))); | |
} |
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 MatchLevels : BaseClass | |
{ | |
[Test] | |
public void ContentMatchLevel() | |
{ | |
//Set the applitools match level to Content | |
Eyes.MatchLevel = MatchLevel.Content; | |
//Will open the fake pricing page | |
GoToPricingPage(); | |
//Will change the first element to a Euro symbol instead of the $ |
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
private void ChangeToEuroAndUpdateColor() | |
{ | |
//take the first element with class name et_pb_sum and update the value to what's specified | |
Javascript.ExecuteScript( | |
"document.getElementsByClassName('et_pb_sum')[0].innerText = \"€0\";"); | |
var element = Driver.FindElement(By.TagName("h1")); | |
//Executes some javascript that updates the color of the h1 element on the page to the color specified | |
Javascript.ExecuteScript( | |
"arguments[0].setAttribute('style', 'color:#f9ca33!important')",element); | |
} |