-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'remove-filter-for-view' of github.com:JavierJia/cloudbe…
…rry into remove-filter-for-view
- Loading branch information
Showing
2 changed files
with
108 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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Must download selenium-webdriver on Node.js Command Prompt by entering | ||
|
||
npm install selenium-webdriver | ||
|
||
For each browser you are testing, you will be required to download a driver and | ||
add it to Enviornmental Variables PATH. The current browsers currently being tested | ||
are Chrome and Firefox. Please make sure to download the latest version of the driver | ||
and also have the browser itself installed on your computer. | ||
|
||
Chrome: | ||
http://chromedriver.storage.googleapis.com/index.html | ||
|
||
Firefox: | ||
https://github.com/mozilla/geckodriver/releases/ | ||
|
||
For more browser drivers or fully detailed instructions on setting up, visit | ||
https://www.npmjs.com/package/selenium-webdriver | ||
|
||
API Doc: http://seleniumhq.github.io/selenium/docs/api/javascript/index.html | ||
|
||
*********************************************************************************************** | ||
To run test: | ||
|
||
On Node.js Command Prompt change directory to neo\test\resources\ | ||
then run | ||
|
||
node front-end.js | ||
|
||
Browsers will open and test will begin. Please wait for test to be completed. | ||
|
||
If you encounter any errors, it is most likely that you are missing a module file. | ||
Simply return to Node.js Command Prompt and install by running | ||
|
||
npm install (missing module) | ||
|
||
*********************************************************************************************** |
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,72 @@ | ||
//Load modules | ||
var webdriver = require('selenium-webdriver'); | ||
|
||
//Internet Browser Drivers | ||
var chrome = new webdriver.Builder().forBrowser('chrome').build(); | ||
var firefox = new webdriver.Builder().forBrowser('firefox').build(); | ||
|
||
var drivers = [ chrome, firefox]; | ||
var names = ['Chrome', 'FireFox']; | ||
|
||
//Execute Tests | ||
for (i = 0; i < drivers.length; i++){ | ||
console.log('Now Testing for %s \n', names[i]); | ||
drivers[i].get('http://cloudberry.ics.uci.edu'); | ||
Title_Assert(); | ||
Reset_Button_Assert(); | ||
console.log(' '); | ||
|
||
} | ||
|
||
|
||
|
||
|
||
//Test Functions | ||
function Title_Assert() { | ||
var title = drivers[i].getTitle().then( function(title) { | ||
if(title != "Cloudberry") | ||
{ | ||
console.log("************************"); | ||
console.log("Title Check......Failed "); | ||
console.log("************************"); | ||
} | ||
else | ||
console.log("Title Check......Cleared"); | ||
}); | ||
|
||
} | ||
|
||
function Reset_Button_Assert() { | ||
var zoomLevel = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("zoom").then( function(zoomlevel){ | ||
if(zoomlevel != 4) | ||
{ | ||
console.log("****************************************"); | ||
console.log('Reset Button ZoomLevel Check......Failed'); | ||
console.log("****************************************"); | ||
} | ||
else | ||
console.log('Reset Button Zoomlevel Check......Cleared'); | ||
}); | ||
|
||
var latCoordinate = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("lat").then( function(latCoordinate){ | ||
if(latCoordinate != 39.5) | ||
{ | ||
console.log("**************************************************"); | ||
console.log('Reset Button Latitude Coordinate Check......Failed'); | ||
console.log("**************************************************"); | ||
} | ||
else | ||
console.log('Reset Button Latitude Coordinate Check......Cleared'); | ||
}); | ||
|
||
var lngCoordinate = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("lng").then( function(lngCoordinate){ | ||
if(lngCoordinate != -96.35) | ||
{ | ||
console.log("**************************************************"); | ||
console.log('Reset Button Longitude Coordinate Check......Failed'); | ||
console.log("**************************************************"); | ||
} | ||
else | ||
console.log('Reset Button Longitude Coordinate Check......Cleared'); | ||
}); | ||
} |