Skip to content

Commit

Permalink
Merge pull request #17 from michielbdejong/add-selenium
Browse files Browse the repository at this point in the history
Bug #16 - Add selenium, r=johanlorenzo
  • Loading branch information
michielbdejong committed Feb 5, 2016
2 parents 7d9a9d5 + cc527b6 commit 69675e4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
# Generated by Cargo
/target/

# Used in selenium tests
node_modules
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
language: rust
rust:
- nightly

before_script:
- "sh -e /etc/init.d/xvfb start"
- "export DISPLAY=:99.0"
- "wget http://selenium-release.storage.googleapis.com/2.50/selenium-server-standalone-2.50.1.jar"
- "java -jar selenium-server-standalone-2.50.1.jar > /dev/null &"
- sleep 5
- nvm install 4.2
- nvm use 4.2
- npm install selenium-webdriver

script:
- cargo build # Linter is also executed here
- RUST_BACKTRACE=1 cargo test
- (cargo run > /dev/null &) ; node test/selenium/ftu_test.js
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title>FoxLink</title>
<title>FoxBox</title>
</head>
<body>
<h1>Welcome To FoxLink!</h1>
<h1>Welcome To FoxBox!</h1>
</body>
</html>
10 changes: 10 additions & 0 deletions test/selenium/ftu_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
var webdriver = require('selenium-webdriver'),
until = require('selenium-webdriver').until;

var driver = new webdriver.Builder().
forBrowser('firefox').
build();

driver.get('http://localhost:3000/');
driver.wait(until.titleIs('FoxBox'), 10000);
driver.quit();

0 comments on commit 69675e4

Please sign in to comment.