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
#region Applitools Actions | |
public T TakeVisualPicture<T>(string tag) | |
{ | |
_eyes.CheckWindow(tag); | |
return (T) Convert.ChangeType(this, typeof(T)); | |
} | |
#endregion |
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
// 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); | |
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
[TestMethod] | |
[TestCategory("UITests")] | |
public void Add1stDonutTest() | |
{ | |
var webApp = HomePage.Launch(_applitoolsApiKey, | |
_applitoolsBatchName, | |
_applitoolsBatchId, | |
"Add 1st Donut Test", | |
_browserType); |
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
// <reference types="cypress" /> | |
describe('todo actions', () => { | |
beforeEach(() => { | |
cy.visit('http://todomvc-app-for-testing.surge.sh/') | |
cy.get('.new-todo', {timeout: 6000}).type('Clean room{enter}') | |
}) | |
it('should add a new todo to the list', () => { |
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
it(‘should add a new todo to the list’, () => { | |
cy.visit(‘http://todomvc-app-for-testing.surge-sh/’) | |
cy.get(‘.new-todo’, {timeout: 6000}.type(“Clean room{enter}”) | |
cy.get(‘label’).should(‘have.text’, ‘Clean room’) | |
cy.get(‘.toggle’).should(‘not.be.checked’) | |
}) |
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
//Start the test capture | |
eyes.open(driver, “Demo App”, “Login Page Test”, new RectangleSize(800,800)); | |
//Take a screenshot so AI can analyze | |
eyes.checkWindow(“Login Window); | |
//End the test | |
eyes.closeAsync(); |
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
@Before | |
public void beforeEach() { | |
//Open the app | |
driver.get("http://localhost:8000/tablesort.html"); | |
//Click on the Rank column | |
driver.findElement(By.id("rank")).click(); | |
} |
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 | |
@UseDataProvider("testForDataFailure") | |
public void testLoginFailure(String username, String password, String expected, String testName, string locatorId) { | |
//try loggin in with username and password | |
login(username,password); | |
//get the text from the alert element | |
String actual = driver.findElement(By.id("alert")).getText(); | |
assertEquals(testName, expected, actual); | |
} |
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
@BeforeClass | |
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); |
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
@Before | |
public void beforeEach() { | |
} | |
@Test | |
public void chartTest1() { | |
eyes.open(driver, "Demo App", "ChartTest 1", new RectangleSize(1200,800)); | |
driver.get("http://localhost:8000/BarChart.html"); | |
eyes.checkWindow("1st Test Window"); |
OlderNewer