-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
9 changed files
with
1,241 additions
and
7 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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
language: node_js | ||
node_js: | ||
- "0.10" | ||
|
||
- '4' | ||
before_script: | ||
- /bin/env | ||
- /bin/ps auxf | ||
- env | ||
- ps auxf | ||
- hostname | ||
- uname -a | ||
- npm install -g protractor | ||
script: e2e/run.sh | ||
addons: | ||
sauce_connect: | ||
username: "fanatic" | ||
access_key: | ||
secure: Yhe4v48+JYDcaByL3/ZZf2qUbCYx9p1WjNa6nR6lW3Q7BJbLFERzyvTMoLyGfDRHNlnLE3cRfZM6NHNmAb8s8idtzilnC+RYEGLLi2KlGz2p6Xp9fKg0rkhIMGbuwQ4Z0pQMHeuYYCEp69/HKocQcaqiYtCtiLz4UTft+Tq0VQI= |
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,12 @@ | ||
{ | ||
request: { | ||
path: '/users/1', | ||
method: 'GET' | ||
}, | ||
response: { | ||
data: { | ||
userName: 'pro-mock', | ||
email: '[email protected]' | ||
} | ||
} | ||
} |
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,42 @@ | ||
exports.config = { | ||
baseUrl: 'http://localhost:8888/', | ||
//seleniumAddress: 'http://localhost:4444/wd/hub', | ||
specs: ['specs/*.js'], | ||
|
||
// Sauce Labs Setup | ||
sauceUser: process.env.SAUCE_USERNAME, | ||
sauceKey: process.env.SAUCE_ACCESS_KEY, | ||
|
||
// restartBrowserBetweenTests: true, | ||
|
||
onPrepare: function(){ | ||
var caps = browser.getCapabilities() | ||
}, | ||
|
||
multiCapabilities: [{ | ||
browserName: 'firefox', | ||
version: '32', | ||
platform: 'OS X 10.10', | ||
name: "firefox-tests", | ||
shardTestFiles: true, | ||
maxInstances: 2, | ||
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER | ||
}, { | ||
browserName: 'chrome', | ||
version: '41', | ||
platform: 'Windows 7', | ||
name: "chrome-tests", | ||
shardTestFiles: true, | ||
maxInstances: 2, | ||
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER | ||
}], | ||
|
||
onComplete: function() { | ||
var printSessionId = function(jobName){ | ||
browser.getSession().then(function(session) { | ||
console.log('SauceOnDemandSessionID=' + session.getId() + ' job-name=' + jobName); | ||
}); | ||
} | ||
printSessionId("Insert Job Name Here"); | ||
} | ||
}; |
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,17 @@ | ||
#!/bin/bash | ||
|
||
if [[ "$(basename `pwd`)" == "e2e" ]]; then | ||
echo "Run from the root of the project instead" | ||
echo "./e2e/run.sh" | ||
exit 1 | ||
fi | ||
|
||
python -m SimpleHTTPServer 8888 & | ||
http_pid=$! | ||
|
||
function finish { | ||
kill -9 $http_pid | ||
} | ||
trap finish EXIT | ||
|
||
protractor e2e/protractor.conf.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,46 @@ | ||
describe('swift-ui homepage', function() { | ||
beforeEach(function () { | ||
browser.driver.get('http://localhost:8888/index.html'); | ||
}); | ||
|
||
it('should log in', function() { | ||
//browser.pause(); | ||
// Allow page to load | ||
browser.sleep(10000); | ||
|
||
expect(browser.driver.getTitle()).toEqual('Swift UI'); | ||
browser.driver.findElement(by.id('loginButton')).click(); | ||
|
||
// Wait for login | ||
browser.sleep(1000); | ||
|
||
var loginText = browser.driver.findElement(by.css('#login-entry .navbar-text')); | ||
expect(loginText.getText()).toEqual('Signed in as test:tester'); | ||
}); | ||
|
||
it('should list accounts and details', function() { | ||
browser.sleep(10000); | ||
browser.driver.findElement(by.id('loginButton')).click(); | ||
|
||
// Wait for login | ||
browser.sleep(2000); | ||
|
||
//browser.pause(); | ||
|
||
var account = browser.driver.findElement(by.css('#test[rel="account"] a')); | ||
expect(account.getText()).toEqual(' test'); | ||
account.click(); | ||
|
||
// Wait for account details to laod | ||
browser.sleep(1000); | ||
|
||
var breadcrumb = browser.driver.findElement(by.css('.breadcrumb > li:first-child')); | ||
expect(breadcrumb.getText()).toEqual('test'); | ||
|
||
var header = browser.driver.findElement(by.css('.page-header > h1 > small')); | ||
expect(header.getText()).toEqual('Account'); | ||
|
||
var metadata = browser.driver.findElement(by.css('#Color.metadata')); | ||
expect(metadata.getText()).toEqual('blue'); | ||
}); | ||
}); |
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
Oops, something went wrong.