Skip to content

Instantly share code, notes, and snippets.

View ultimate-qa2's full-sized avatar

Ultimate QA ultimate-qa2

View GitHub Profile
[Test]
public void TestBaseline()
{
GoToPricingPage();
UpdateElements();
Eyes.Open(Driver, AppName, TestCaseName, Resolution1080P);
Eyes.CheckWindow();
}
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 $
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);
}
public void LayoutMatchLevel()
{
//Sets the applitools match leve to Layout
Eyes.MatchLevel = MatchLevel.Layout;
//Will open the fake pricing page
GoToPricingPage();
//Will change the first element to a Euro symbol instead of the $
//and will change the collor to a yellow.
ChangeToEuroAndUpdateColor();
//Starts the applitools test with 4 parameters passed in
namespace Applitools
{
[TestFixture]
[Category("MatchLevels")]
public class MatchLevels : BaseClass
{
[Test]
public void ContentMatchLevel()
{
//Set the applitools match level to Content
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);
}
public void LayoutMatchLevel()
{
//Sets the applitools match leve to Layout
Eyes.MatchLevel = MatchLevel.Layout;
//Will open the fake pricing page
GoToPricingPage();
//Will change the first element to a Euro symbol instead of the $
//and will change the collor to a yellow.
ChangeToEuroAndUpdateColor();
//Starts the applitools test with 4 parameters passed in
public void Check(ICheckSettings checkSettings);
public void Check(string name, ICheckSettings checkSettings);
public void Check(params ICheckSettings[] checkSettings);
public void CheckWindow(TimeSpan matchTimeout, string tag = null);
public void CheckWindow(string tag = null);
Eyes.Check(name,
Target.Window().Fully().Floating(SocialSharingToolbar, 180, 4035, 0, 17)
.Layout(SocialSharingToolbar)
.Strict(HeaderLocator));