-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Adding functional test base (#305)
- Loading branch information
Jeremy Press
authored
Aug 17, 2017
1 parent
0441920
commit 5dc3247
Showing
4 changed files
with
78 additions
and
2 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,5 +1,13 @@ | ||
language: node_js | ||
node_js: | ||
- "6" | ||
- '6' | ||
addons: | ||
sauce_connect: | ||
username: box-content-preview | ||
jwt: | ||
secure: EPjmiionirVVkbFbp9r4DjMLMcfmdj9Sq8UiMcIGGf5gQk0cV5sgJpDHUDlKhFL3na8FkYf27qadaaJHG9Lr7o1V6IN1tsLamD9kdQjeG1pUSZbyMoMbja9i8CY0/MnQPaPL8UBXbcPrJoBwPNp6PphZ1PtBW68oXale3Xdfd7JMyTtm8f6G40pxpDl50dKI2VZHKKrfWakFkK2DMM73vJScxCrlyJEDc+wSJi2Mr/lrZc/QYy3ug3BGq1S6vV6wsOCk/4Jx+W1hvqK0QBgIytv1XzypqDFJ0OiTiOccsbwvEUHOepQl0EQxBZtM9PO//SBMFc2TqAhldta37JFrEcOEtqrsHwqVELzRMJm9lDSSD+TSj/tri6Kevy311gboZsJh2T3Znkq2h5Zpx8ImbgZCKvQyn8bTSp9MOkb9bGt1tUkZ1LEk3Pj0PUEjFZMnAsT/fLg2EGdXRQWb1W/ZyknoNPfvsU5Po8obQ/AOlKMqaMM7YiGQWruL7Esml0XaiL9H1TSUwmtyAnAU+Q1eYv7II7SnQmVxcgILX7D7nAO82/jP2f12fszEOlgivLr0AS9iAMLcNsrTfSO2p60MESmc/2ZVGjIagNEaGohfb9AI5d0tezU6+GWijuRijVqn1x2rLbSXOV7c3G9yrJpGTru9WD3n/ekgVvg/0nanBpU= | ||
before_script: | ||
- python -m SimpleHTTPServer & | ||
- sleep 2 | ||
script: yarn run ci | ||
cache: yarn |
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,39 @@ | ||
const webdriver = require('selenium-webdriver'); | ||
const expect = require('chai').expect; | ||
|
||
describe('Base Test', () => { | ||
before(() => { | ||
if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) { | ||
this.browser = new webdriver.Builder() | ||
.usingServer(`http://${process.env.SAUCE_USERNAME}:${process.env.SAUCE_ACCESS_KEY}@ondemand.saucelabs.com:80/wd/hub`) | ||
.withCapabilities({ | ||
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER, | ||
build: process.env.TRAVIS_BUILD_NUMBER, | ||
username: process.env.SAUCE_USERNAME, | ||
accessKey: process.env.SAUCE_ACCESS_KEY, | ||
browserName: 'chrome' | ||
}).build(); | ||
} else { | ||
this.browser = new webdriver.Builder() | ||
.withCapabilities({ | ||
browserName: 'chrome' | ||
}).build(); | ||
} | ||
}); | ||
|
||
beforeEach(() => { | ||
return this.browser.get('http://localhost:8000/functional-tests/index.html'); | ||
}); | ||
|
||
after(() => { | ||
return this.browser.quit(); | ||
}); | ||
|
||
it('should load a file', () => { | ||
return this.browser.wait(webdriver.until.elementLocated(webdriver.By.className('bp-loaded')), 5000).then((element) => { | ||
this.browser.wait(webdriver.until.elementIsVisible(element), 5000).then((el) => { | ||
expect(el).to.not.equal(undefined); | ||
}); | ||
}); | ||
}); | ||
}); |
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,27 @@ | ||
<head> | ||
<style> | ||
.preview-container { | ||
border: 1px solid #eee; | ||
height: 490px; | ||
width: 100%; | ||
} | ||
</style> | ||
<link rel="stylesheet" type="text/css" href="../dist/dev/en-US/preview.css"> | ||
<script src="../dist/dev/en-US/preview.js"></script> | ||
|
||
</head> | ||
|
||
<body> | ||
<div class="preview-container"></div> | ||
<script> | ||
var ACCESS_TOKEN = 'EqFyi1Yq1tD9mxY8F38sxDfp73pFd7FP'; | ||
|
||
var FILE_ID_DOC = '93392244621'; | ||
|
||
var preview = new Box.Preview(); | ||
preview.show(FILE_ID_DOC, ACCESS_TOKEN, { | ||
container: '.preview-container', | ||
showDownload: true, | ||
}); | ||
</script> | ||
</body> |
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