Created
January 29, 2020 07:33
-
-
Save tourdedave/39b664c49380e7a9c62a7f093e3addab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Generated by Selenium IDE | |
const assert = require('assert') | |
const geckodriver = require('geckodriver') | |
const { Builder, By, Key, until } = require('selenium-webdriver') | |
const { ConsoleLogHandler, Target, Eyes, Configuration, VisualGridRunner, BrowserType, DeviceName, ScreenOrientation } = require('@applitools/eyes-selenium') | |
describe('asdf', function() { | |
let driver | |
let vars | |
let eyes | |
let preRenderHook | |
before(async () => { | |
geckodriver.start() | |
await new Promise(res => setTimeout(res, 2000)) | |
}) | |
beforeEach(async function() { | |
driver = await new Builder().forBrowser('chrome').build() | |
vars = {} | |
eyes = new Eyes(new VisualGridRunner()) | |
eyes.setLogHandler(new ConsoleLogHandler(true)) | |
const config = new Configuration() | |
config.setConcurrentSessions(10) | |
config.addBrowser(1920, 1080, BrowserType.CHROME) | |
eyes.setConfiguration(config) | |
eyes.setApiKey(process.env["APPLITOOLS_API_KEY"]) | |
await eyes.open(driver, "asdf", "asdf") | |
}) | |
afterEach(async function() { | |
await driver.quit(); | |
const results = await eyes.getRunner().getAllTestResults() | |
console.log(results) | |
await eyes.abortIfNotClosed() | |
geckodriver.stop() | |
await new Promise(res => setTimeout(res, 2000)) | |
}) | |
it('asdf', async function() { | |
await driver.get("https://www.youtube.com/") | |
await eyes.setViewportSize({ width: 1440, height: 998 }) | |
await eyes.check((new URL(await driver.getCurrentUrl())).pathname, Target.window().webHook(preRenderHook).accessibilityValidation("None").fully(true)) | |
await eyes.close() | |
}) | |
}) |
This file contains hidden or 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
{ | |
"name": "vg-youtube-ff-fail", | |
"version": "1.0.0", | |
"description": "", | |
"main": "asdf.spec.js", | |
"scripts": { | |
"test": "mocha --no-timeouts asdf.spec.js" | |
}, | |
"keywords": [], | |
"author": "", | |
"license": "ISC", | |
"dependencies": { | |
"mocha": "^7.0.1", | |
"selenium-webdriver": "^4.0.0-alpha.5", | |
"@applitools/eyes-selenium": "^4.33.10", | |
"geckodriver": "^1.19.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment