mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 09:26:45 +00:00
Updated README and Renamed Tests
This commit is contained in:
parent
fde0dc2a35
commit
7918d7b287
@ -8,15 +8,15 @@ E2e Protractor Tests.
|
||||
stop.js : node script, kills the 3 process started in start.js.
|
||||
|
||||
2. Use npm(Node Package Mangager) to Run Scripts.
|
||||
*"npm link" will put the scripts on your system path.
|
||||
a. cd protractor;
|
||||
b. npm install;
|
||||
c. npm link; (optional)
|
||||
d. script_name
|
||||
-start
|
||||
-run
|
||||
-stop
|
||||
|
||||
c. To Run:
|
||||
-npm start : will start processes need by protractor
|
||||
-npm stop : will stop the processes need by protractor
|
||||
-npm run-script run : will execute Protractor Script
|
||||
-npm run-script all : will execute "start", "run", and "stop" script
|
||||
-
|
||||
|
||||
(optional: Scripts NOT on path)
|
||||
a. To Run
|
||||
-./bin/start.js
|
||||
|
@ -22,7 +22,7 @@
|
||||
//TODO Add filter for duplications/
|
||||
var fullScreenFile = require("../common/Buttons");
|
||||
|
||||
describe('Test Fullscreen', function() {
|
||||
describe('Enable Fullscreen', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
@ -25,7 +25,7 @@ var itemEdit = require("../common/EditItem");
|
||||
var rightMenu = require("../common/RightMenu");
|
||||
var Drag = require("../common/drag");
|
||||
|
||||
describe('Test Info Bubble', function() {
|
||||
describe('Info Bubble', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
var createClass = new createItem();
|
||||
var editItemClass = new itemEdit();
|
||||
|
@ -24,7 +24,7 @@ var createClassFile = require("../common/CreateItem")
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightMenu = require("../common/RightMenu.js");
|
||||
|
||||
describe('Test New Window', function() {
|
||||
describe('New Window', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
var createClass = new createClassFile();
|
||||
var editItemClass = new itemEdit();
|
||||
|
@ -21,28 +21,64 @@
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Right Click Interations', function() {
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('The Right Menu', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Folder";
|
||||
var ITEM_TYPE = "folder";
|
||||
var ITEM_MENU_GLYPH = 'F\nFolder';
|
||||
var ITEM_GRID_SELECT = 'P\nF\nFolder\n0 Items';
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should delete the specified object', function(){
|
||||
createClass.createButton().click();
|
||||
var folder = createClass.selectNewItem(ITEM_TYPE);
|
||||
expect(folder.getText()).toEqual([ ITEM_MENU_GLYPH ]);
|
||||
browser.sleep(1000);
|
||||
folder.click()
|
||||
browser.sleep(1000);
|
||||
browser.wait(function () {
|
||||
return element.all(by.model('ngModel[field]')).isDisplayed();
|
||||
it('should Dissapear After Delete', function(){
|
||||
browser.wait(function() {
|
||||
createClass.createButton().click();
|
||||
return true;
|
||||
}).then(function (){
|
||||
var folder = createClass.selectNewItem(ITEM_TYPE);
|
||||
expect(folder.getText()).toEqual([ ITEM_MENU_GLYPH ]);
|
||||
browser.sleep(1000);
|
||||
folder.click()
|
||||
}).then(function() {
|
||||
browser.wait(function () {
|
||||
return element.all(by.model('ngModel[field]')).isDisplayed();
|
||||
})
|
||||
createClass.fillFolderForum(ITEM_NAME, ITEM_TYPE).click();
|
||||
browser.sleep(1000);
|
||||
}).then(function (){
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
browser.sleep(1000);
|
||||
}).then(function () {
|
||||
var MyItem = ">\nF\nMy Items"
|
||||
element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
return text === MyItem;
|
||||
});
|
||||
}).all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).click();
|
||||
var object = element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
return text === ">\nF\nFolder";
|
||||
});
|
||||
});
|
||||
browser.sleep(1000)
|
||||
browser.actions().mouseMove(object.get(0)).perform();
|
||||
browser.actions().click(protractor.Button.RIGHT).perform();
|
||||
browser.sleep(1000)
|
||||
var menu = element.all(by.css('.ng-binding')).filter(function (ele){
|
||||
return ele.getText().then(function (text) {
|
||||
return text == "Z\nRemove";
|
||||
})
|
||||
})
|
||||
menu.click();
|
||||
browser.sleep(1000)
|
||||
|
||||
expect(menu.isDisplayed()).toBe(false);
|
||||
})
|
||||
createClass.fillFolderForum(ITEM_NAME, ITEM_TYPE).click();
|
||||
clickClass.delete(ITEM_NAME);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
||||
|
15
protractor/bin/clean.js
Executable file
15
protractor/bin/clean.js
Executable file
@ -0,0 +1,15 @@
|
||||
#! /usr/bin/env node
|
||||
var shell = require("shelljs/global");
|
||||
|
||||
var startdir = process.cwd();
|
||||
var command = "npm unlink";
|
||||
|
||||
console.log("Cleaning Directory")
|
||||
exec(command, function(code, output) {
|
||||
if(code != 0){
|
||||
console.log('Exit code:', code);
|
||||
console.log('Program output:', output);
|
||||
}
|
||||
});
|
||||
console.log("rm -rf node_modules")
|
||||
rm('-rf', __dirname + "/../node_modules")
|
@ -30,11 +30,11 @@ console.log(' Started Node');
|
||||
console.log();
|
||||
console.log('Starting Webdriver');
|
||||
sleep.sleep(1);
|
||||
exec("protractor/node_modules/protractor/bin/webdriver-manager start > protractor/logs/webdriver.log 2>&1 &",{async:false});
|
||||
exec("protractor/node_modules/protractor/bin/webdriver-manager start --standalone> protractor/logs/webdriver.log 2>&1 &",{async:false});
|
||||
if(error() == null){
|
||||
console.log(" Webdriver Started");
|
||||
}else{
|
||||
console.log(" Error : ", error());
|
||||
}
|
||||
|
||||
sleep.sleep(1);
|
||||
cd(startdir);
|
@ -3,6 +3,7 @@
|
||||
var shell = require("shelljs/global");
|
||||
var ps = require('psnode');
|
||||
var S = require('string');
|
||||
var sleep = require('sleep');
|
||||
|
||||
// A simple pid lookup
|
||||
ps.list(function(err, results) {
|
||||
@ -19,6 +20,7 @@ ps.list(function(err, results) {
|
||||
console.log(stdout);
|
||||
});
|
||||
}
|
||||
sleep.usleep(10000);
|
||||
if((process.command.indexOf("webdriver")) != -1) {
|
||||
console.log();
|
||||
console.log( 'Killing WebDriver: %s', process.command);
|
||||
@ -29,16 +31,6 @@ ps.list(function(err, results) {
|
||||
console.log(stdout);
|
||||
});
|
||||
}
|
||||
if((process.command.indexOf("protractor")) != -1) {
|
||||
console.log();
|
||||
console.log( 'Killing Protractor Driver: %s', process.command);
|
||||
ps.kill(process.pid, function(err, stdout) {
|
||||
if (err){
|
||||
throw new Error(err);
|
||||
}
|
||||
console.log(stdout);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -32,7 +32,6 @@ exports.config = {
|
||||
'delete/DeleteActivity.js',
|
||||
'create/CreateActivityMode.js',
|
||||
'delete/DeleteActivityMode.js',
|
||||
'create/CreateActivityMode.js',
|
||||
'create/CreateClock.js',
|
||||
'delete/DeleteClock.js',
|
||||
'create/CreateDisplay.js',
|
||||
@ -51,7 +50,8 @@ exports.config = {
|
||||
'create/CreateButton.js',
|
||||
"UI/DragDrop.js",
|
||||
"UI/NewWindow.js",
|
||||
'UI/InfoBubble.js'
|
||||
'UI/InfoBubble.js',
|
||||
'UI/RightClick.js'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome', // or 'safari'
|
||||
|
@ -22,7 +22,7 @@
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Web Page', function() {
|
||||
describe('Create Activity Mode', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Activity Mode";
|
||||
|
@ -57,7 +57,7 @@ describe('Create Clock', function() {
|
||||
});
|
||||
it('should check clock', function () {
|
||||
|
||||
function getTime() {
|
||||
function getTime(flag) {
|
||||
function addZero(time){
|
||||
if(time < 10){
|
||||
return '0' + time;
|
||||
@ -66,7 +66,6 @@ describe('Create Clock', function() {
|
||||
}
|
||||
var currentdate = new Date();
|
||||
|
||||
|
||||
var month = currentdate.getMonth() + 1;
|
||||
month = addZero(month);
|
||||
|
||||
@ -77,6 +76,9 @@ describe('Create Clock', function() {
|
||||
hour = addZero(hour);
|
||||
|
||||
var second = currentdate.getSeconds();
|
||||
if(flag == true) {
|
||||
second = second + 1;
|
||||
}
|
||||
second = addZero(second);
|
||||
|
||||
var minute = currentdate.getMinutes();
|
||||
@ -85,17 +87,24 @@ describe('Create Clock', function() {
|
||||
return ("UTC " + currentdate.getFullYear() + "/" + (month) + "/" +
|
||||
day + " " + (hour) + ":" + minute + ":" + second + " PM");
|
||||
}
|
||||
|
||||
var current,clock;
|
||||
rightClickClass.select(ITEM_MENU_GLYPH, true).click().then(function () {
|
||||
browser.sleep(1000);
|
||||
current = browser.executeScript(getTime);
|
||||
}).then(function () {
|
||||
clock = element(by.css('.l-time-display.l-digital.l-clock.s-clock.ng-scope'));
|
||||
clock.getText().then(function (time) {
|
||||
expect(current).toEqual(time);
|
||||
})
|
||||
this.addMatchers({
|
||||
toBeIn: function(expected){
|
||||
var posibilities = Array.isArray(this.actual) ? this.actual : [this.actual];
|
||||
return posibilities.indexOf(expected) > -1;
|
||||
}
|
||||
})
|
||||
|
||||
var current,current1,clock;
|
||||
rightClickClass.select(ITEM_MENU_GLYPH, true).click().then(function () {
|
||||
browser.sleep(1000);
|
||||
browser.executeScript(getTime, false).then(function(current){
|
||||
browser.executeScript(getTime, true).then(function(current1) {
|
||||
clock = element(by.css('.l-time-display.l-digital.l-clock.s-clock.ng-scope'));
|
||||
clock.getText().then(function (ele) {
|
||||
expect([current,current1]).toBeIn(ele);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
|
@ -1,10 +1,12 @@
|
||||
{
|
||||
"name": "protractorCtr",
|
||||
"version": "1.0.0",
|
||||
"bin": {
|
||||
"scripts" : {
|
||||
"start": "bin/start.js",
|
||||
"run" : "bin/run.js",
|
||||
"stop" : "bin/stop.js"
|
||||
"stop" : "bin/stop.js",
|
||||
"all" : "bin/start.js; bin/run.js; bin/stop.js;",
|
||||
"clean": "bin/clean.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"protractor": "^2.1.0",
|
||||
|
Loading…
x
Reference in New Issue
Block a user