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
const {Eyes} = require('eyes.selenium') | |
let eyes | |
before(async () => { | |
eyes = new Eyes() | |
eyes.setApiKey(process.env.APPLITOOLS_APIKEY) | |
await eyes.open(driver, 'Calculator App', 'Tests', {width: 800, height: 600}) | |
}) |
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
let driver | |
before(async () => { | |
driver = new webdriver.Builder().forBrowser('chrome').build() | |
}) | |
after(async () => await driver.quit()) |
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
<script> | |
console.time('benchmark') | |
</script> | |
<script type="module"> | |
import itWorks from './es6-module-1.js' | |
const $ = document.querySelector.bind(document) | |
$('#output').textContent = itWorks() | |
console.timeEnd('benchmark') | |
</script> |
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
export function greetings() { | |
console.log('Hello, world') | |
} |
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
import {greetings} from './es6-modules-export.js' | |
greetings() |
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
const http = require('http') | |
const fs = require('fs') | |
const path = require('path') | |
const extensionToContentType = { | |
'.js': 'application/javascript', | |
'.html': 'text/html' | |
} | |
http.createServer((req, res) => { |
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
var ev = new Event("keyup", ...); | |
document.dispatchEvent(ev); |
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
ReactDom.render(e(CalculatorApp), document.getElementById('container')) | |
const displayElement = document.querySelector('.display') | |
expect(displayElement.textContent).to.equal('0') | |
const digit4Element = document.querySelector('.digit-4') | |
const digit2Element = document.querySelector('.digit-2') | |
const operatorMultiply = document.querySelector('.operator-multiply') | |
const operatorEquals = document.querySelector('.operator-equals') |
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(function () { | |
global.document = jsdom(`<!doctype html><html><body><div id="container"/></div></body></html>`) | |
global.window = document.defaultView | |
}) | |
after(function () { | |
delete global.window | |
delete global.document | |
}) |
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
const digit4Element = await driver.findElement(By.css('.digit-4')) | |
const digit2Element = await driver.findElement(By.css('.digit-2')) | |
const operatorMultiply = await driver.findElement(By.css('.operator-multiply')) | |
const operatorEquals = await driver.findElement(By.css('.operator-equals')) | |
await digit4Element.click() | |
await digit2Element.click() | |
await operatorMultiply.click() | |
await digit2Element.click() | |
await operatorEquals.click() |