Skip to content

Instantly share code, notes, and snippets.

@jankcat
Created March 16, 2017 16:59
Show Gist options
  • Save jankcat/d60240e6d20d45ca7396b05b3d48b96d to your computer and use it in GitHub Desktop.
Save jankcat/d60240e6d20d45ca7396b05b3d48b96d to your computer and use it in GitHub Desktop.
Applitools Eyes Problem Snippet
/*...getConfig into host, capabilities, key vars...*/
let driver = new webdriver.Builder().usingServer(host).withCapabilities(capabilities).build();
let eyes = new Eyes();
eyes.setApiKey(key);
/*...eyes setBatch, setDefaultMatchTimeout, setWaitBeforeScreenshots, setSaveNewTests, setStitchMode, setForceFullPageScreenshot...*/
eyes.open(driver, testName, testArea).then(function (driver) {
const page = new SomePage(driver, eyes);
page.open(); // basically just: function { this.driver.get('someUrl'); }
page.blink(); // basically just: this.eyes.checkWindow('someStepName');
/*...same code for 7-8 other pages...*/
}).then(function() {
driver.quit();
eyes.close(false);
eyes.abortIfNotClosed();
});
/* I ahve tried replacing eyes.close(false); with eyes.close(false).then(function() {console.log("eyes are closed"});
but I never saw "eyes are closed" get logged to the console.
I have also tried not using the abortIfNotClosed but no difference.
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment