Skip to content

Instantly share code, notes, and snippets.

@efleming969
Last active May 23, 2018 21:50
Show Gist options
  • Save efleming969/4f072f269e30da595c2ca9ed9730e79f to your computer and use it in GitHub Desktop.
Save efleming969/4f072f269e30da595c2ca9ed9730e79f to your computer and use it in GitHub Desktop.
acme package
const Express = require( "express" )
const Expression = require( "express-session" )
const app = Express()
app.use( Expression( {
secret: "secret",
resave: false,
saveUninitialized: false
} ) )
app.use( Express.static( "public" ) )
app.get( "/", function ( req, res ) {
res.send( "hello" )
} )
app.listen( 8080, function () {
console.log( "listening" )
} )
{
"name": "acme",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"express-session": "^1.15.6"
}
}
const WebDriver = require( "webdriverio" )
const driver = WebDriver.remote( {
browserName: "chrome",
path: "/",
port: 9515
} )
driver.init()
.url( `http://duckduckgo.com/` )
.setValue( "#search_form_input_homepage", "selenium" )
.click( "#search_button_homepage" )
.click( "a*=Web Browser Automation" )
.waitForExist( "#mainContent", 3000 )
.getTitle().then(
title => expect( title ).toEqual( "Selenium - Web Browser Automation" ) )
.end()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment