Skip to content

Instantly share code, notes, and snippets.

View batmi02's full-sized avatar

Michael Battat batmi02

  • Applitools
View GitHub Profile
batmi02 / gist:5c19718a0c05b27d6f4412343c0dab02
Created May 23, 2019 17:01
Abel's code for calling Applitools
#region Applitools Actions
public T TakeVisualPicture<T>(string tag)
return (T) Convert.ChangeType(this, typeof(T));
batmi02 / BasePage.cs
Created May 23, 2019 17:05
Abel's code for initiating Applitools Eyes
// initialize the eyes SDK and set your private API key
var eyes = new Eyes();
eyes.ApiKey = appliToolsKey;
eyes.Batch = batchInfo;
// Start the test by setting AUT's name, window or the page name that's being tested,
//viewport width and height
TESTNAME = testName;
eyes.Open(driver, "Mercury Health Web App", TESTNAME, WINDOWSIZE);
batmi02 / MercuryAppTestsExcerpt.cs
Created May 23, 2019 17:57
Excerpt from MercuryHealthAppTests.cs
public void Add1stDonutTest()
var webApp = HomePage.Launch(_applitoolsApiKey,
"Add 1st Donut Test",
// <reference types="cypress" />
describe('todo actions', () => {
beforeEach(() => {
cy.get('.new-todo', {timeout: 6000}).type('Clean room{enter}')
it('should add a new todo to the list', () => {
it(‘should add a new todo to the list’, () => {
cy.get(‘.new-todo’, {timeout: 6000}.type(“Clean room{enter}”)
cy.get(‘label’).should(‘have.text’, ‘Clean room’)
//Start the test capture, “Demo App”, “Login Page Test”, new RectangleSize(800,800));
//Take a screenshot so AI can analyze
eyes.checkWindow(“Login Window);
//End the test
public void beforeEach() {
//Open the app
//Click on the Rank column
public void testLoginFailure(String username, String password, String expected, String testName, string locatorId) {
//try loggin in with username and password
//get the text from the alert element
String actual = driver.findElement("alert")).getText();
assertEquals(testName, expected, actual);
public static void setBatch() {
// Must be before ALL tests (at Class Level)
batch = new BatchInfo("Data Driven Testing");
// Initialize the Runner for your test
runner - new ClassicRunner();
//Initialize the eyes SDK
eyes = new Eyes(runner);
public void beforeEach() {
public void chartTest1() {, "Demo App", "ChartTest 1", new RectangleSize(1200,800));
eyes.checkWindow("1st Test Window");