forked from AlexViderman/heroku-selenium
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alex_viderman
authored and
alex_viderman
committed
Jul 10, 2017
1 parent
a730b54
commit a37c2ce
Showing
6 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,4 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
.idea |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node index.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "Heroku Selenium Node", | ||
"env": { | ||
|
||
}, | ||
"formation": { | ||
"web": { | ||
"quantity": 1, | ||
"size": "Free" | ||
} | ||
}, | ||
"addons": [ | ||
], | ||
"buildpacks": [ | ||
{ | ||
"url": "http://github.com/heroku/heroku-buildpack-nodejs.git" | ||
}, | ||
{ | ||
"url": "https://github.com/stomita/heroku-buildpack-phantomjs" | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var webdriver = require('selenium-webdriver'); | ||
var express = require('express') | ||
var app = express() | ||
|
||
var port = process.env.PORT || 14000; | ||
var By = webdriver.By; | ||
|
||
app.get('/test', function (req, res) { | ||
var driver = new webdriver.Builder() | ||
.forBrowser('phantomjs') | ||
.build(); | ||
driver.get('http://www.google.com/ncr'); | ||
driver.findElement(By.name('q')).sendKeys('webdriver'); | ||
driver.findElement(By.name('btnG')).click(); | ||
driver.wait(function() { | ||
return driver.getTitle().then(function(title) { | ||
console.log(title); | ||
return title === 'webdriver - Google Search'; | ||
}); | ||
}, 5000).then(function() { | ||
res.status(200).send('Done'); | ||
}, function(error) { | ||
res.status(200).send(error); | ||
}); | ||
driver.quit(); | ||
}); | ||
|
||
app.listen(port, function () { | ||
console.log('Example app listening on port: ',port) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "untitled2", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"start": "node index.js", | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"express": "^4.15.2", | ||
"selenium-webdriver": "^3.4.0" | ||
}, | ||
"engines": { | ||
"node": "6.10.3", | ||
"npm": "4.5.0" | ||
} | ||
} |