Skip to content

Commit 29d1efd

Browse files
authored
Merge branch 'master' into remove-filter-for-view
2 parents 808835f + e3837bc commit 29d1efd

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

neo/test/resources/README.txt

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Must download selenium-webdriver on Node.js Command Prompt by entering
2+
3+
npm install selenium-webdriver
4+
5+
For each browser you are testing, you will be required to download a driver and
6+
add it to Enviornmental Variables PATH. The current browsers currently being tested
7+
are Chrome and Firefox. Please make sure to download the latest version of the driver
8+
and also have the browser itself installed on your computer.
9+
10+
Chrome:
11+
http://chromedriver.storage.googleapis.com/index.html
12+
13+
Firefox:
14+
https://github.com/mozilla/geckodriver/releases/
15+
16+
For more browser drivers or fully detailed instructions on setting up, visit
17+
https://www.npmjs.com/package/selenium-webdriver
18+
19+
API Doc: http://seleniumhq.github.io/selenium/docs/api/javascript/index.html
20+
21+
***********************************************************************************************
22+
To run test:
23+
24+
On Node.js Command Prompt change directory to neo\test\resources\
25+
then run
26+
27+
node front-end.js
28+
29+
Browsers will open and test will begin. Please wait for test to be completed.
30+
31+
If you encounter any errors, it is most likely that you are missing a module file.
32+
Simply return to Node.js Command Prompt and install by running
33+
34+
npm install (missing module)
35+
36+
***********************************************************************************************

neo/test/resources/front-end.js

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//Load modules
2+
var webdriver = require('selenium-webdriver');
3+
4+
//Internet Browser Drivers
5+
var chrome = new webdriver.Builder().forBrowser('chrome').build();
6+
var firefox = new webdriver.Builder().forBrowser('firefox').build();
7+
8+
var drivers = [ chrome, firefox];
9+
var names = ['Chrome', 'FireFox'];
10+
11+
//Execute Tests
12+
for (i = 0; i < drivers.length; i++){
13+
console.log('Now Testing for %s \n', names[i]);
14+
drivers[i].get('http://cloudberry.ics.uci.edu');
15+
Title_Assert();
16+
Reset_Button_Assert();
17+
console.log(' ');
18+
19+
}
20+
21+
22+
23+
24+
//Test Functions
25+
function Title_Assert() {
26+
var title = drivers[i].getTitle().then( function(title) {
27+
if(title != "Cloudberry")
28+
{
29+
console.log("************************");
30+
console.log("Title Check......Failed ");
31+
console.log("************************");
32+
}
33+
else
34+
console.log("Title Check......Cleared");
35+
});
36+
37+
}
38+
39+
function Reset_Button_Assert() {
40+
var zoomLevel = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("zoom").then( function(zoomlevel){
41+
if(zoomlevel != 4)
42+
{
43+
console.log("****************************************");
44+
console.log('Reset Button ZoomLevel Check......Failed');
45+
console.log("****************************************");
46+
}
47+
else
48+
console.log('Reset Button Zoomlevel Check......Cleared');
49+
});
50+
51+
var latCoordinate = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("lat").then( function(latCoordinate){
52+
if(latCoordinate != 39.5)
53+
{
54+
console.log("**************************************************");
55+
console.log('Reset Button Latitude Coordinate Check......Failed');
56+
console.log("**************************************************");
57+
}
58+
else
59+
console.log('Reset Button Latitude Coordinate Check......Cleared');
60+
});
61+
62+
var lngCoordinate = drivers[i].findElement(webdriver.By.tagName('map')).getAttribute("lng").then( function(lngCoordinate){
63+
if(lngCoordinate != -96.35)
64+
{
65+
console.log("**************************************************");
66+
console.log('Reset Button Longitude Coordinate Check......Failed');
67+
console.log("**************************************************");
68+
}
69+
else
70+
console.log('Reset Button Longitude Coordinate Check......Cleared');
71+
});
72+
}

0 commit comments

Comments
 (0)