-
Notifications
You must be signed in to change notification settings - Fork 20
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
1 parent
c177aeb
commit 961b5ae
Showing
11 changed files
with
86 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
module.exports = { | ||
'src_folders': [ | ||
'test/e2e'// Where you are storing your Nightwatch e2e tests | ||
], | ||
'output_folder': './reports', // reports (test outcome) output by nightwatch | ||
'selenium': { // downloaded by selenium-download module | ||
'start_process': true, // tells nightwatch to start/stop the selenium process | ||
'server_path': '../../node_modules/nightwatch/bin/selenium.jar', | ||
'host': '127.0.0.1', | ||
'port': 4444, // standard selenium port | ||
'cli_args': { // chromedriver is downloaded by selenium-download | ||
'webdriver.chrome.driver': '../../node_modules/nightwatch/bin/chromedriver' | ||
} | ||
}, | ||
'test_settings': { | ||
'default': { | ||
'screenshots': { | ||
'enabled': true, // if you want to keep screenshots | ||
'path': './screenshots' // save screenshots here | ||
}, | ||
'globals': { | ||
'waitForConditionTimeout': 5000 // sometimes internet is slow so wait. | ||
}, | ||
'desiredCapabilities': { // use Chrome as the default browser for tests | ||
'browserName': 'chrome' | ||
} | ||
}, | ||
'chrome': { | ||
'desiredCapabilities': { | ||
'browserName': 'chrome', | ||
'javascriptEnabled': true // turn off to test progressive enhancement | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* selenium-download does exactly what it's name suggests; | ||
* downloads (or updates) the version of Selenium (& chromedriver) | ||
* on your localhost where it will be used by Nightwatch. | ||
*/ | ||
var BINPATH = '../../node_modules/nightwatch/bin/' | ||
require('fs').stat(BINPATH + 'selenium.jar', function (err, stat) { // got it? | ||
if (err || !stat || stat.size < 1) { | ||
require('selenium-download').ensure(BINPATH, function (error) { | ||
if (error) throw new Error(error) // no point continuing so exit! | ||
console.log('✔ Selenium & Chromedriver downloaded to:', BINPATH) | ||
}) | ||
} | ||
}) |
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
21 changes: 21 additions & 0 deletions
21
examples/sdk-upload/reports/CHROME_53.0.2785.116_MAC_sdk-upload.test.xml
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,21 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<testsuites errors="0" | ||
failures="0" | ||
tests="1"> | ||
|
||
<testsuite name="sdk-upload.test" | ||
errors="0" failures="0" hostname="" id="" package="sdk-upload.test" skipped="0" | ||
tests="1" time="17.38" timestamp="Thu, 29 Sep 2016 16:31:44 GMT"> | ||
|
||
<testcase name="Image Upload" time="17.38" assertions="3"> | ||
|
||
|
||
|
||
|
||
|
||
|
||
</testcase> | ||
|
||
|
||
</testsuite> | ||
</testsuites> |
Binary file added
BIN
+307 KB
.../screenshots/sdk-upload.test/Image-Upload_ERROR_Sep-29-2016-172939-GMT+0100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+308 KB
.../screenshots/sdk-upload.test/Image-Upload_ERROR_Sep-29-2016-172941-GMT+0100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+311 KB
.../screenshots/sdk-upload.test/Image-Upload_ERROR_Sep-29-2016-173002-GMT+0100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+305 KB
.../screenshots/sdk-upload.test/Image-Upload_ERROR_Sep-29-2016-173036-GMT+0100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+307 KB
.../screenshots/sdk-upload.test/Image-Upload_ERROR_Sep-29-2016-173056-GMT+0100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,14 @@ | ||
module.exports = { | ||
'Image Upload': function (browser) { | ||
browser | ||
.url('http://localhost:8000') | ||
.waitForElementVisible('body', 1000) | ||
.waitForElementVisible('input#fileInput', 1000) | ||
.pause(1000) | ||
.setValue('input#fileInput', require('path').resolve(__dirname + '/another-cute-kitten.jpg')) | ||
.click('#submit') | ||
.pause(13000) | ||
.assert.containsText('h4', 'Image Successfully Uploaded') | ||
.end() | ||
} | ||
} |
Empty file.