mirror of
https://github.com/nasa/openmct.git
synced 2025-02-01 00:45:41 +00:00
Merge remote-tracking branch 'upstream/master' into mobile
This commit is contained in:
commit
66c81ce3d6
4
.gitignore
vendored
4
.gitignore
vendored
@ -22,3 +22,7 @@ node_modules
|
||||
|
||||
# Build documentation
|
||||
docs
|
||||
|
||||
# Protractor logs
|
||||
protractor/logs
|
||||
|
||||
|
13
README.md
13
README.md
@ -67,6 +67,19 @@ as described above.
|
||||
An example of this is expressed in `platform/framework`, which follows
|
||||
bundle conventions.
|
||||
|
||||
### Regression Testing
|
||||
|
||||
The tests described above are all at the unit-level; an additional
|
||||
test suite using [Protractor](https://angular.github.io/protractor/)
|
||||
us under development, in the `protractor` folder.
|
||||
|
||||
To run:
|
||||
|
||||
* Install protractor following the instructions above.
|
||||
* `webdriver-manager start`
|
||||
* `node app.js -p 1984 -x platform/persistence/elastic -i example/persistence
|
||||
* `protractor protractor/conf.js`
|
||||
|
||||
## Build
|
||||
|
||||
Open MCT Web includes a Maven command line build. Although Open MCT Web
|
||||
|
@ -27,7 +27,8 @@ define(
|
||||
"use strict";
|
||||
|
||||
var DEFAULT_DIMENSIONS = [ 12, 8 ],
|
||||
DEFAULT_GRID_SIZE = [32, 32];
|
||||
DEFAULT_GRID_SIZE = [ 32, 32 ],
|
||||
MINIMUM_FRAME_SIZE = [ 320, 180 ];
|
||||
|
||||
/**
|
||||
* The LayoutController is responsible for supporting the
|
||||
@ -67,12 +68,22 @@ define(
|
||||
};
|
||||
}
|
||||
|
||||
// Generate default positions for a new panel
|
||||
function defaultDimensions() {
|
||||
return MINIMUM_FRAME_SIZE.map(function (min, i) {
|
||||
return Math.max(
|
||||
Math.ceil(min / gridSize[i]),
|
||||
DEFAULT_DIMENSIONS[i]
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Generate a default position (in its raw format) for a frame.
|
||||
// Use an index to ensure that default positions are unique.
|
||||
function defaultPosition(index) {
|
||||
return {
|
||||
position: [index, index],
|
||||
dimensions: DEFAULT_DIMENSIONS
|
||||
dimensions: defaultDimensions()
|
||||
};
|
||||
}
|
||||
|
||||
@ -107,6 +118,18 @@ define(
|
||||
ids.forEach(populatePosition);
|
||||
}
|
||||
|
||||
// Update grid size when it changed
|
||||
function updateGridSize(layoutGrid) {
|
||||
var oldSize = gridSize;
|
||||
|
||||
gridSize = layoutGrid || DEFAULT_GRID_SIZE;
|
||||
|
||||
// Only update panel positions if this actually changed things
|
||||
if (gridSize[0] !== oldSize[0] || gridSize[1] !== oldSize[1]) {
|
||||
lookupPanels(Object.keys(positions));
|
||||
}
|
||||
}
|
||||
|
||||
// Position a panel after a drop event
|
||||
function handleDrop(e, id, position) {
|
||||
if (e.defaultPrevented) {
|
||||
@ -138,6 +161,9 @@ define(
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
// Watch for changes to the grid size in the model
|
||||
$scope.$watch("model.layoutGrid", updateGridSize);
|
||||
|
||||
// Position panes when the model field changes
|
||||
$scope.$watch("model.composition", lookupPanels);
|
||||
|
||||
|
@ -175,6 +175,23 @@ define(
|
||||
);
|
||||
expect(testConfiguration.panels.d).not.toBeDefined();
|
||||
});
|
||||
|
||||
it("ensures a minimum frame size", function () {
|
||||
var styleB, styleC;
|
||||
|
||||
// Start with a very small frame size
|
||||
testModel.layoutGrid = [ 1, 1 ];
|
||||
|
||||
// White-boxy; we know which watch is which
|
||||
mockScope.$watch.calls[0].args[1](testModel.layoutGrid);
|
||||
mockScope.$watch.calls[1].args[1](testModel.composition);
|
||||
|
||||
styleB = controller.getFrameStyle("b");
|
||||
|
||||
// Resulting size should still be reasonably large pixel-size
|
||||
expect(parseInt(styleB.width, 10)).toBeGreaterThan(63);
|
||||
expect(parseInt(styleB.width, 10)).toBeGreaterThan(31);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
3
pom.xml
3
pom.xml
@ -40,6 +40,8 @@
|
||||
<include>**/bundle.json</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>protractor/**/*</exclude>
|
||||
<exclude>node_modules/**/*</exclude>
|
||||
<exclude>platform/core/bundle.json</exclude>
|
||||
<exclude>example/**/*</exclude>
|
||||
<exclude>**/test/lib/*</exclude>
|
||||
@ -162,6 +164,7 @@
|
||||
<exclude>**/lib/**</exclude>
|
||||
<exclude>app.js</exclude>
|
||||
<exclude>node_modules/**/*</exclude>
|
||||
<exclude>protractor/**/*</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
<executions>
|
||||
|
75
protractor/StressTest.js
Normal file
75
protractor/StressTest.js
Normal file
@ -0,0 +1,75 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
//TODO Add filter for duplications/
|
||||
var itemCreate = require("./common/CreateItem");
|
||||
var itemEdit = require("./common/EditItem");
|
||||
var right_click = require("./common/RightMenu.js");
|
||||
|
||||
describe('Create Folder', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new itemCreate();
|
||||
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';
|
||||
var ITEM_SIDE_SELECT = ">\nF\nFolder"
|
||||
|
||||
beforeEach(function() {
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get('http://localhost:1984/warp/');
|
||||
browser.sleep(2000); // 20 seconds
|
||||
});
|
||||
it('should Create new Folder', function(){
|
||||
browser.sleep(5000);
|
||||
for(var i=0; i < 50; i++){
|
||||
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 (){
|
||||
browser.sleep(1000);
|
||||
// if(i === 1){
|
||||
clickClass.delete(ITEM_SIDE_SELECT, true);
|
||||
element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).click();
|
||||
// }else{
|
||||
browser.sleep(1000);
|
||||
|
||||
// clickClass.delete(ITEM_SIDE_SELECT, false);
|
||||
// }
|
||||
});
|
||||
}
|
||||
browser.pause();
|
||||
|
||||
});
|
||||
|
||||
});
|
135
protractor/UI/DragDrop.js
Normal file
135
protractor/UI/DragDrop.js
Normal file
@ -0,0 +1,135 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var fullScreenFile = require("../common/Buttons");
|
||||
var createItem = require("../common/CreateItem")
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightMenu = require("../common/RightMenu");
|
||||
var Drag = require("../common/drag");
|
||||
|
||||
describe('Test Drag and Drop', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
var createClass = new createItem();
|
||||
var editItemClass = new itemEdit();
|
||||
var rightMenuClass = new rightMenu();
|
||||
var dragDrop = new Drag();
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should create a folder', function(){
|
||||
var ITEM_NAME = "Folder";
|
||||
var ITEM_TYPE = "folder";
|
||||
var ITEM_MENU_GLYPH = 'F\nFolder';
|
||||
var ITEM_GRID_SELECT = 'P\nF\nFolder\n0 Items';
|
||||
|
||||
browser.wait(function() {
|
||||
return createClass.createButton().click();
|
||||
}).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);
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
});
|
||||
it('should create a timer',function (){
|
||||
var ITEM_NAME = "Timer";
|
||||
var ITEM_TYPE = "timer";
|
||||
var ITEM_MENU_GLYPH = 'õ\nTimer';
|
||||
var ITEM_GRID_SELECT = 'P\nõ\nTimer';
|
||||
|
||||
browser.wait(function() {
|
||||
return createClass.createButton().click();
|
||||
}).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(1500);
|
||||
}).then(function (){
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
||||
it('should drag timer into folder', function(){
|
||||
var ITEM_SIDE_SELECT = ">\nF\nFolder"
|
||||
var name = "õ\nTimer";
|
||||
|
||||
rightMenuClass.select(ITEM_SIDE_SELECT, true).click();
|
||||
browser.sleep(2000);
|
||||
var object = element.all(by.css('.ng-isolate-scope.ng-pristine.ng-valid')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
return text === name;
|
||||
});
|
||||
});
|
||||
var clock = object.get(1);
|
||||
var panel = element(by.css('.items-holder.grid.abs.ng-scope'));
|
||||
|
||||
//drag
|
||||
expect(panel.isPresent()).toBe(true)
|
||||
expect(clock.isPresent()).toBe(true)
|
||||
browser.executeScript(dragDrop.DragDrop,clock.getWebElement(),panel.getWebElement())
|
||||
browser.sleep(3000);
|
||||
//check
|
||||
var dragObject = element.all(by.repeater('childObject in composition')).filter(function (ele) {
|
||||
return ele.getText().then(function(text) {
|
||||
return text === "P\nõ\nTimer"
|
||||
})
|
||||
})//output console.log
|
||||
/*expect(dragObject.get(0).isPresent()).toBe(true);
|
||||
browser.manage().logs().get('browser').then(function(browserLogs) {
|
||||
browserLogs.forEach(function(log){
|
||||
console.log(log.message);
|
||||
});
|
||||
});*/
|
||||
});
|
||||
it('should delete the Folder Item', function(){
|
||||
var ITEM_SIDE_SELECT = ">\nF\nFolder"
|
||||
browser.wait(function() {
|
||||
return element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).isDisplayed();
|
||||
});
|
||||
rightMenuClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
it('should delete the Timer Item', function(){
|
||||
var ITEM_SIDE_SELECT = "õ\nTimer";
|
||||
browser.wait(function() {
|
||||
return element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).isDisplayed();
|
||||
});
|
||||
rightMenuClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
});
|
50
protractor/UI/Fullscreen.js
Normal file
50
protractor/UI/Fullscreen.js
Normal file
@ -0,0 +1,50 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
//TODO Add filter for duplications/
|
||||
var fullScreenFile = require("../common/Buttons");
|
||||
|
||||
describe('Test Fullscreen', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
beforeEach(function() {
|
||||
browser.wait(function(){
|
||||
return element(by.css('[title="Enter full screen mode"]')).isPresent();
|
||||
}, 7000);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
it('should find fullscreen button', function(){
|
||||
expect(element(by.css('[title="Enter full screen mode"]')).isDisplayed()).toBeTruthy();
|
||||
|
||||
});it('should enter fullscreen when fullscreen button is pressed', function(){
|
||||
function getFullScreen(){
|
||||
return document.webkitIsFullScreen;
|
||||
}
|
||||
var fullscreen = browser.executeScript(getFullScreen)
|
||||
expect(fullscreen).toBeFalsy();
|
||||
fullScreenClass.fullScreen()
|
||||
fullscreen = browser.executeScript(getFullScreen)
|
||||
expect(fullscreen).toBeTruthy();
|
||||
});
|
||||
});
|
43
protractor/UI/InfoBubble.js
Normal file
43
protractor/UI/InfoBubble.js
Normal file
@ -0,0 +1,43 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var fullScreenFile = require("../common/Buttons");
|
||||
var createItem = require("../common/CreateItem")
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightMenu = require("../common/RightMenu");
|
||||
var Drag = require("../common/drag");
|
||||
|
||||
describe('Test Info Bubble', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
var createClass = new createItem();
|
||||
var editItemClass = new itemEdit();
|
||||
var rightMenuClass = new rightMenu();
|
||||
var dragDrop = new Drag();
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should detect info bubble', function(){
|
||||
var myitem = (element.all(by.repeater('child in composition'))).get(0);
|
||||
browser.actions().mouseMove(myitem).perform();
|
||||
browser.sleep(4000);
|
||||
expect(element(by.css('.t-infobubble.s-infobubble.l-infobubble-wrapper')).isDisplayed()).toBe(true);
|
||||
});
|
||||
});
|
90
protractor/UI/NewWindow.js
Normal file
90
protractor/UI/NewWindow.js
Normal file
@ -0,0 +1,90 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var fullScreenFile = require("../common/Buttons");
|
||||
var createClassFile = require("../common/CreateItem")
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightMenu = require("../common/RightMenu.js");
|
||||
|
||||
describe('Test New Window', function() {
|
||||
var fullScreenClass = new fullScreenFile();
|
||||
var createClass = new createClassFile();
|
||||
var editItemClass = new itemEdit();
|
||||
var rightMenuClass = new rightMenu();
|
||||
|
||||
var ITEM_NAME = "Folder";
|
||||
var ITEM_TYPE = "folder";
|
||||
var ITEM_MENU_GLYPH = 'F\nFolder';
|
||||
var ITEM_GRID_SELECT = 'P\nF\nFolder\n0 Items';
|
||||
var ITEM_SIDE_SELECT = ">\nF\nFolder"
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should create an object and open it in new window', function(){
|
||||
function replaceString(string){
|
||||
//used to remove timestamp on the output so files can be compared
|
||||
return string.replace(new RegExp("([0-1]?[0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]","g"),"z");
|
||||
}
|
||||
browser.wait(function() {
|
||||
return createClass.createButton().click();
|
||||
}).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 (){
|
||||
//open file in new page
|
||||
var before = browser.driver.getPageSource();
|
||||
before = browser.executeScript(replaceString, before)
|
||||
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
browser.sleep(1000);
|
||||
fullScreenClass.newWidnow().click();
|
||||
|
||||
var after = browser.driver.getPageSource();
|
||||
after = browser.executeScript(replaceString, after)
|
||||
|
||||
browser.getAllWindowHandles().then(function (handles) {
|
||||
browser.driver.switchTo().window(handles[1]);
|
||||
browser.sleep(1000);
|
||||
expect(before).toEqual(after);
|
||||
browser.sleep(1000);
|
||||
browser.driver.close();
|
||||
browser.driver.switchTo().window(handles[0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
it('should delete the object in the new window', function(){
|
||||
browser.wait(function() {
|
||||
return element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).isDisplayed();
|
||||
});
|
||||
rightMenuClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
48
protractor/UI/RightClick.js
Normal file
48
protractor/UI/RightClick.js
Normal file
@ -0,0 +1,48 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Right Click Interations', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Folder";
|
||||
var ITEM_TYPE = "folder";
|
||||
var ITEM_MENU_GLYPH = 'F\nFolder';
|
||||
|
||||
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();
|
||||
})
|
||||
createClass.fillFolderForum(ITEM_NAME, ITEM_TYPE).click();
|
||||
clickClass.delete(ITEM_NAME);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
41
protractor/common/Buttons.js
Normal file
41
protractor/common/Buttons.js
Normal file
@ -0,0 +1,41 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var Buttons = (function () {
|
||||
function Buttons() {
|
||||
}
|
||||
//finds the Edit Button
|
||||
Buttons.prototype.fullScreen = function () {
|
||||
element(by.css('[title="Enter full screen mode"]')).click();
|
||||
|
||||
};
|
||||
Buttons.prototype.newWidnow = function () {
|
||||
return element.all(by.css('[ng-click="parameters.action.perform()"]')).filter(function (arg) {
|
||||
return arg.getAttribute("title").then(function (title){
|
||||
//expect(title).toEqual("Edit this object.");
|
||||
return title == 'Open in a new browser tab';
|
||||
})
|
||||
});
|
||||
};
|
||||
return Buttons;
|
||||
|
||||
})();
|
||||
module.exports = Buttons;
|
194
protractor/common/CreateItem.js
Normal file
194
protractor/common/CreateItem.js
Normal file
@ -0,0 +1,194 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var CreateItem = (function () {
|
||||
function CreateItem() {}
|
||||
//finds the Create Button
|
||||
CreateItem.prototype.createButton = function () {
|
||||
return element.all(by.css('[ng-click="createController.toggle()"]'));
|
||||
};
|
||||
function getFolderType(arg) {
|
||||
switch(arg) {
|
||||
case 'folder':
|
||||
return "F\nFolder"
|
||||
break;
|
||||
case 'display':
|
||||
return "L\nDisplay Layout"
|
||||
break;
|
||||
case 'telemetry':
|
||||
return "t\nTelemetry Panel"
|
||||
break;
|
||||
case 'webpage':
|
||||
return "ê\nWeb Page"
|
||||
break;
|
||||
case 'clock':
|
||||
return "C\nClock"
|
||||
break;
|
||||
case 'timer':
|
||||
return "õ\nTimer"
|
||||
case 'timeline':
|
||||
return "S\nTimeline"
|
||||
break;
|
||||
case 'activity':
|
||||
return "a\nActivity"
|
||||
break;
|
||||
case 'activity-mode':
|
||||
return "A\nActivity Mode"
|
||||
break;
|
||||
case 'sinewave':
|
||||
return "T\nSine Wave Generator"
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unexpect State");
|
||||
}
|
||||
}
|
||||
//Selects Object from Create Menu
|
||||
CreateItem.prototype.selectNewItem = function (itemText) {
|
||||
item = getFolderType(itemText);
|
||||
browser.wait(function(){
|
||||
return element(by.css('[ng-click="createAction.perform()"]')).isPresent();
|
||||
}, 6000);
|
||||
this.els =element.all(by.css('[ng-click="createAction.perform()"]'));
|
||||
this.todoButton = this.els.filter(function(elem) {
|
||||
return elem.getText().then(function(text) {
|
||||
return text === item;
|
||||
});
|
||||
});
|
||||
return this.todoButton;
|
||||
};
|
||||
//Fills Out Folder Forum
|
||||
CreateItem.prototype.fillFolderForum = function (folderName, type) {
|
||||
this.namefields = element.all(by.css('[ng-required="ngRequired"]')).filter(function (elem) {
|
||||
return elem.getAttribute('type').then(function(text) {
|
||||
return text === 'text';
|
||||
});
|
||||
});
|
||||
|
||||
browser.sleep(1000);
|
||||
this.namefields.clear();
|
||||
browser.sleep(1000);
|
||||
|
||||
this.namefields.get(0).sendKeys(folderName);
|
||||
switch(type) {
|
||||
case 'folder':
|
||||
// return "F\nFolder"
|
||||
break;
|
||||
case 'display':
|
||||
this.namefields.get(1).sendKeys("1");
|
||||
browser.sleep(1000);
|
||||
this.namefields.get(2).sendKeys("2");
|
||||
break;
|
||||
case 'telemetry':
|
||||
this.namefields.get(1).sendKeys("1");
|
||||
browser.sleep(1000);
|
||||
this.namefields.get(2).sendKeys("2");
|
||||
this.dropdownElement = element.all(by.model('ngModel[field]')).filter(function(elem) {
|
||||
return elem.getTagName().then(function(tag) {
|
||||
return tag === 'select';
|
||||
});
|
||||
});
|
||||
this.dropdownElement.click();
|
||||
this.dropdownElement.all(by.css('option')).get(1).click();
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
case 'webpage':
|
||||
this.namefields.get(1).sendKeys("http://test.com");
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
case 'clock':
|
||||
this.dropdownElement = element.all(by.model('ngModel[field]')).filter(function(elem) {
|
||||
return elem.getTagName().then(function(tag) {
|
||||
return tag === 'select';
|
||||
});
|
||||
});
|
||||
this.dropdownElement.get(0).click();
|
||||
this.dropdownElement.get(0).all(by.css('option')).get(0).click();
|
||||
browser.sleep(1000);
|
||||
this.dropdownElement.get(1).click();
|
||||
this.dropdownElement.get(1).all(by.css('option')).get(0).click();
|
||||
browser.sleep(1000);
|
||||
|
||||
break;
|
||||
case 'timer':
|
||||
this.timerDate = element.all(by.model('datetime.date'));
|
||||
browser.sleep(1000);
|
||||
this.timerDate.clear().sendKeys("2015-07-22");
|
||||
browser.sleep(1000);
|
||||
this.timerDate = element.all(by.model('datetime.hour'));
|
||||
this.timerDate.get(0).sendKeys("7");
|
||||
this.timerDate = element.all(by.model('datetime.min'));
|
||||
this.timerDate.get(0).sendKeys("30");
|
||||
this.timerDate = element.all(by.model('datetime.sec'));
|
||||
this.timerDate.get(0).sendKeys("000");
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
case 'timeline':
|
||||
this.timerDate = element.all(by.model('datetime.days'));
|
||||
this.timerDate.clear().sendKeys("10");
|
||||
browser.sleep(1000);
|
||||
this.timerDate = element.all(by.model('datetime.hours'));
|
||||
this.timerDate.get(0).sendKeys("7");
|
||||
this.timerDate = element.all(by.model('datetime.minutes'));
|
||||
this.timerDate.get(0).sendKeys("30");
|
||||
this.timerDate = element.all(by.model('datetime.seconds'));
|
||||
this.timerDate.get(0).sendKeys("3");
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
case 'activity':
|
||||
this.startDay = element.all(by.model('datetime.days'));
|
||||
this.startDay.clear().sendKeys("10");
|
||||
this.startHours = element.all(by.model('datetime.hours'));
|
||||
this.startHours.get(0).clear().sendKeys("7");
|
||||
this.startMinutes = element.all(by.model('datetime.minutes'));
|
||||
this.startMinutes.get(0).clear().sendKeys("30");
|
||||
this.startSeconds = element.all(by.model('datetime.seconds'));
|
||||
this.startSeconds.get(0).clear().sendKeys("3");
|
||||
browser.sleep(1000);
|
||||
//Duration
|
||||
this.startDay.get(1).clear().sendKeys("1");
|
||||
this.startHours.get(1).clear().sendKeys("1");
|
||||
this.startMinutes.get(1).clear().sendKeys("0");
|
||||
this.startSeconds.get(1).clear().sendKeys("0");
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
case 'activity-mode':
|
||||
this.namefields.get(1).sendKeys("55");
|
||||
browser.sleep(1000);
|
||||
this.namefields.get(2).sendKeys("10");
|
||||
break;
|
||||
case 'sinewave':
|
||||
this.namefields.get(1).sendKeys("10");
|
||||
browser.sleep(1000);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unexpect State");
|
||||
}
|
||||
return element.all(by.css('[ng-click="ngModel.confirm()"]'));
|
||||
|
||||
};
|
||||
//TODO USAGE FOR CLICK ON OBJECT ONCE CREATED
|
||||
CreateItem.prototype.findFolder = function (){
|
||||
return element.all(by.css('[ng-click="action.perform("navigate")"]'));
|
||||
};
|
||||
return CreateItem;
|
||||
|
||||
})();
|
||||
module.exports = CreateItem;
|
66
protractor/common/EditItem.js
Normal file
66
protractor/common/EditItem.js
Normal file
@ -0,0 +1,66 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var EditItem = (function () {
|
||||
function EditItem() {
|
||||
}
|
||||
//finds the Edit Button
|
||||
EditItem.prototype.SelectItem = function (item_title) {
|
||||
return element.all(by.css('.item.grid-item.ng-scope')).filter(function (arg){
|
||||
return arg.getText().then(function (text) {
|
||||
// expect(text).toEqual("fh");
|
||||
return text == item_title;
|
||||
});
|
||||
});
|
||||
};
|
||||
EditItem.prototype.EditButton = function () {
|
||||
return element.all(by.css('[ng-click="parameters.action.perform()"]')).filter(function (arg) {
|
||||
return arg.getAttribute("title").then(function (title){
|
||||
//expect(title).toEqual("Edit this object.");
|
||||
return title == 'Edit this object.';
|
||||
})
|
||||
});
|
||||
};
|
||||
EditItem.prototype.CreateActivity = function () {
|
||||
element.all(by.css('[ng-controller="ClickAwayController as toggle"]')).click();
|
||||
browser.sleep(1000);
|
||||
var list = element.all(by.css('[ng-repeat="option in structure.options"]')).filter(function (arg){
|
||||
return arg.getText().then(function (text){
|
||||
//expect(text).toEqual("Edit this object.");
|
||||
return text == "a\nActivity";
|
||||
});
|
||||
}).click();
|
||||
};
|
||||
EditItem.prototype.saveButton = function () {
|
||||
element.all(by.css('[ng-click="currentAction.perform()"]')).filter(function (args){
|
||||
return args.getText().then(function (text) {
|
||||
//expect(text).toEqual("Save");
|
||||
return text == "Save";
|
||||
});
|
||||
}).click();
|
||||
};
|
||||
function getFolderType(arg) {
|
||||
|
||||
}
|
||||
return EditItem;
|
||||
|
||||
})();
|
||||
module.exports = EditItem;
|
29
protractor/common/Launch.js
Normal file
29
protractor/common/Launch.js
Normal file
@ -0,0 +1,29 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global module,browser*/
|
||||
|
||||
module.exports = function launch() {
|
||||
'use strict';
|
||||
browser.ignoreSynchronization = true;
|
||||
browser.get('http://localhost:1984/');
|
||||
browser.sleep(2000); // 20 seconds
|
||||
};
|
111
protractor/common/RightMenu.js
Normal file
111
protractor/common/RightMenu.js
Normal file
@ -0,0 +1,111 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
|
||||
var RightMenu = (function () {
|
||||
|
||||
function RightMenu() {
|
||||
}
|
||||
//RightMenu Click on Object
|
||||
RightMenu.prototype.delete = function (name, flag) {
|
||||
if(typeof flag === 'undefined'){
|
||||
flag = true;
|
||||
}
|
||||
if(flag === true){
|
||||
var carrot = element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).get(0).click();
|
||||
}
|
||||
browser.sleep(1000)
|
||||
var object = element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
//expect(text).toEqual("3");
|
||||
return text === name;
|
||||
});
|
||||
});
|
||||
browser.sleep(1000)
|
||||
browser.actions().mouseMove(object.get(0)).perform();
|
||||
browser.actions().click(protractor.Button.RIGHT).perform();
|
||||
browser.sleep(1000)
|
||||
var remove = element.all(by.css('.ng-binding')).filter(function (ele){
|
||||
return ele.getText().then(function (text) {
|
||||
return text == "Z\nRemove";
|
||||
})
|
||||
}).click();
|
||||
browser.sleep(1000)
|
||||
element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
return text === name;
|
||||
});
|
||||
}).then(function (folder) {
|
||||
expect(folder.length).toBe(0);
|
||||
});
|
||||
};
|
||||
RightMenu.prototype.reset = function (name) {
|
||||
var carrot = element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).click();
|
||||
browser.sleep(1000)
|
||||
var object = element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
//expect(text).toEqual("3");
|
||||
return text === name;
|
||||
});
|
||||
}).click();
|
||||
browser.sleep(1000)
|
||||
browser.actions().mouseMove(object.get(0)).perform();
|
||||
browser.actions().click(protractor.Button.RIGHT).perform();
|
||||
browser.sleep(1000)
|
||||
var remove = element.all(by.css('.ng-binding')).filter(function (ele){
|
||||
return ele.getText().then(function (text) {
|
||||
return text == "r\nRestart at 0";
|
||||
})
|
||||
}).click();
|
||||
};
|
||||
RightMenu.prototype.select = function(name, flag){
|
||||
if(typeof flag == "undefined"){
|
||||
flag = true;
|
||||
}
|
||||
//click '<', true==yes false==no
|
||||
if(flag == true){
|
||||
var carrot = element.all(by.css('.ui-symbol.view-control.ng-binding.ng-scope')).click();
|
||||
}
|
||||
browser.sleep(1000)
|
||||
return element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
// expect(text).toEqual("3");
|
||||
return text === name;
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
RightMenu.prototype.dragDrop = function(name){
|
||||
var object = element.all(by.repeater('child in composition')).filter(function (ele){
|
||||
return ele.getText().then(function(text) {
|
||||
//expect(text).toEqual("3");
|
||||
return text === name;
|
||||
});
|
||||
});
|
||||
var folder = object.get(0);
|
||||
var panel = element(by.css('.items-holder.grid.abs.ng-scope'));
|
||||
|
||||
browser.actions().dragAndDrop(folder, panel).perform();
|
||||
};
|
||||
return RightMenu;
|
||||
|
||||
})();
|
||||
module.exports = RightMenu;
|
70
protractor/common/drag.js
Normal file
70
protractor/common/drag.js
Normal file
@ -0,0 +1,70 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
//drag function
|
||||
/*
|
||||
var e = document.createEvent("Event");
|
||||
e.initEvent('dragstart',true,false);
|
||||
_element.dispatchEvent(e);
|
||||
*/
|
||||
// qux.js
|
||||
var Drag = (function () {
|
||||
|
||||
function Drag() {};
|
||||
Drag.prototype.DragDrop = function(elem, zone){
|
||||
createEvent = function(type) {
|
||||
var event = document.createEvent("event");
|
||||
event.initEvent(type, true, false);
|
||||
event.dataTransfer = {
|
||||
data: {
|
||||
},
|
||||
setData: function(type, val){
|
||||
event.dataTransfer.data[type] = val;
|
||||
},
|
||||
getData: function(type){
|
||||
return event.dataTransfer.data[type];
|
||||
}
|
||||
};
|
||||
return event;
|
||||
}
|
||||
var event = createEvent('dragstart');
|
||||
event.effectAllowed = "copyMove";
|
||||
elem.dispatchEvent(event);
|
||||
|
||||
var ele = createEvent('dragover');
|
||||
ele.preventDefault();
|
||||
zone.dispatchEvent(ele);
|
||||
|
||||
var dropEvent = createEvent('drop', {});
|
||||
dropEvent.dataTransfer = event.dataTransfer;
|
||||
dropEvent.preventDefault();
|
||||
zone.dispatchEvent(dropEvent);
|
||||
|
||||
var dragEndEvent = createEvent('dragend', {});
|
||||
dragEndEvent.dataTransfer = event.dataTransfer;
|
||||
elem.dispatchEvent(dragEndEvent);
|
||||
};
|
||||
return Drag;
|
||||
})();
|
||||
module.exports = Drag;
|
||||
|
||||
|
||||
|
67
protractor/conf.js
Normal file
67
protractor/conf.js
Normal file
@ -0,0 +1,67 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
/*global exports,process*/
|
||||
|
||||
// conf.js
|
||||
exports.config = {
|
||||
allScriptsTimeout: 500000,
|
||||
defaultTimeoutInterval: 60000,
|
||||
seleniumAddress: 'http://localhost:4444/wd/hub',
|
||||
//specs: ['StressTest.js'],
|
||||
specs: [
|
||||
//'create/CreateActivity.js',
|
||||
//'delete/DeleteActivity.js',
|
||||
//'create/CreateActivityMode.js',
|
||||
//'delete/DeleteActivityMode.js',
|
||||
//'create/CreateActivityMode.js',
|
||||
//'create/CreateClock.js',
|
||||
//'delete/DeleteClock.js',
|
||||
'create/CreateDisplay.js',
|
||||
//'delete/DeleteDisplay.js',
|
||||
'create/CreateFolder.js',
|
||||
//'delete/DeleteFolder.js',
|
||||
'create/CreateTelemetry.js',
|
||||
//'delete/DeleteTelemetry.js',
|
||||
//'create/CreateTimeline.js',
|
||||
//'delete/DeleteTimeline.js',
|
||||
//'create/CreateTimer.js',
|
||||
//'delete/DeleteTimer.js',
|
||||
'create/CreateWebPage.js',
|
||||
//'delete/DeleteWebPage.js',
|
||||
'UI/Fullscreen.js',
|
||||
'create/CreateButton.js',
|
||||
//"UI/DragDrop.js",
|
||||
//"UI/NewWindow.js",
|
||||
'UI/InfoBubble.js'
|
||||
],
|
||||
capabilities: {
|
||||
'browserName': 'chrome', // or 'safari'
|
||||
'chromeOptions': {}
|
||||
}
|
||||
};
|
||||
|
||||
// Allow specifying binary location as an environment variable,
|
||||
// for cases where Chrome is not installed in a usual location.
|
||||
if (process.env.PROTRACTOR_CHROME_BINARY) {
|
||||
exports.config.capabilities.chromeOptions.binary =
|
||||
process.env.PROTRACTOR_CHROME_BINARY;
|
||||
}
|
57
protractor/create/CreateActivity.js
Normal file
57
protractor/create/CreateActivity.js
Normal file
@ -0,0 +1,57 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Activity', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Activity";
|
||||
var ITEM_TYPE = "activity";
|
||||
var ITEM_MENU_GLYPH = 'a\nActivity';
|
||||
var ITEM_GRID_SELECT = 'P\na\nActivity\n0 Items';
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create new Activity', function(){
|
||||
//button.click()
|
||||
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();
|
||||
})
|
||||
var ok = createClass.fillFolderForum(ITEM_NAME, ITEM_TYPE).click();
|
||||
browser.sleep(1000);
|
||||
//ok.click();
|
||||
}).then(function (){
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
58
protractor/create/CreateActivityMode.js
Normal file
58
protractor/create/CreateActivityMode.js
Normal file
@ -0,0 +1,58 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Web Page', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Activity Mode";
|
||||
var ITEM_TYPE = "activity-mode";
|
||||
var ITEM_MENU_GLYPH = 'A\nActivity Mode';
|
||||
var ITEM_GRID_SELECT = 'P\nA\nActivity Mode';
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create new Activity Mode', function(){
|
||||
//button.click()
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
40
protractor/create/CreateButton.js
Normal file
40
protractor/create/CreateButton.js
Normal file
@ -0,0 +1,40 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
//TODO Add filter for duplications/
|
||||
describe('Create Button', function() {
|
||||
beforeEach(require('../common/Launch'));
|
||||
//it('should hava title "My Items"', function(){
|
||||
// expect(browser.getTitle()).toEqual('My Items');
|
||||
//});
|
||||
it('should find create menu to be invisible', function(){
|
||||
expect(element(by.css('[ng-show="createController.isActive()"]')).isDisplayed()).toBeFalsy();
|
||||
});
|
||||
it('should find create menu only visable after the create button clicked', function(){
|
||||
element(by.css('[ng-click="createController.toggle()"]')).click();
|
||||
expect(element(by.css('[ng-show="createController.isActive()"]')).isDisplayed()).toBeTruthy();
|
||||
});
|
||||
it('should find create menu only visable after the create button clicked', function(){
|
||||
element(by.css('[ng-click="createController.toggle()"]')).click();
|
||||
expect(element(by.css('[ng-show="createController.isActive()"]')).isDisplayed()).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
101
protractor/create/CreateClock.js
Normal file
101
protractor/create/CreateClock.js
Normal file
@ -0,0 +1,101 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightClick = require("../common/RightMenu");
|
||||
describe('Create Clock', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var rightClickClass = new rightClick();
|
||||
|
||||
var ITEM_NAME = "Clock";
|
||||
var ITEM_TYPE = "clock";
|
||||
var ITEM_MENU_GLYPH = 'C\nClock';
|
||||
var ITEM_GRID_SELECT = 'P\nC\nClock';
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create new Clock', function(){
|
||||
//button.click()
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
it('should check clock', function () {
|
||||
|
||||
function getTime() {
|
||||
function addZero(time){
|
||||
if(time < 10){
|
||||
return '0' + time;
|
||||
}
|
||||
return time;
|
||||
}
|
||||
var currentdate = new Date();
|
||||
|
||||
|
||||
var month = currentdate.getMonth() + 1;
|
||||
month = addZero(month);
|
||||
|
||||
var day = currentdate.getDate();
|
||||
day = addZero(day);
|
||||
|
||||
var hour = currentdate.getHours() - 5;
|
||||
hour = addZero(hour);
|
||||
|
||||
var second = currentdate.getSeconds();
|
||||
second = addZero(second);
|
||||
|
||||
var minute = currentdate.getMinutes();
|
||||
minute = addZero(minute);
|
||||
|
||||
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);
|
||||
})
|
||||
})
|
||||
|
||||
});
|
||||
});
|
58
protractor/create/CreateDisplay.js
Normal file
58
protractor/create/CreateDisplay.js
Normal file
@ -0,0 +1,58 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Display', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Display";
|
||||
var ITEM_TYPE = "display";
|
||||
var ITEM_MENU_GLYPH = 'L\nDisplay Layout';
|
||||
var ITEM_GRID_SELECT = 'P\nL\nDisplay\n0 Items';
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create new Display', function(){
|
||||
//button.click()
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
59
protractor/create/CreateFolder.js
Normal file
59
protractor/create/CreateFolder.js
Normal file
@ -0,0 +1,59 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
//TODO Add filter for duplications/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Folder', function() {
|
||||
var createClass = new itemCreate();
|
||||
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 Create new Folder', 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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
59
protractor/create/CreateSineWave.js
Normal file
59
protractor/create/CreateSineWave.js
Normal file
@ -0,0 +1,59 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
|
||||
describe('Create Sine Wave Generator', function() {
|
||||
var createClass = new itemCreate();
|
||||
var ITEM_NAME = "Sine Wave G";
|
||||
var ITEM_TYPE = "sinewave";
|
||||
var ITEM_MENU_GLYPH = 'T\nSine Wave Generator'
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create new Sin Wave Generator' , function(){
|
||||
//button.click()
|
||||
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();
|
||||
})
|
||||
var ok = createClass.fillFolderForum(ITEM_NAME, ITEM_TYPE);
|
||||
browser.sleep(1000);
|
||||
ok.click();
|
||||
}).then(function (){
|
||||
var checkfolder = element.all(by.css('.title.ng-binding')).filter(function (ele) {
|
||||
return ele.getTagName('div').then(function (tag){
|
||||
return tag == 'div';
|
||||
});
|
||||
})
|
||||
expect(checkfolder.getText()).toEqual([ '', 'Sine Wave G' ]);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
59
protractor/create/CreateTelemetry.js
Normal file
59
protractor/create/CreateTelemetry.js
Normal file
@ -0,0 +1,59 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Telemetry', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Telemetry";
|
||||
var ITEM_TYPE = "telemetry";
|
||||
var ITEM_MENU_GLYPH = 't\nTelemetry Panel'
|
||||
var ITEM_GRID_SELECT = 'P\nt\nTelemetry\n0 Items';
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should Create new Telemetry', function(){
|
||||
//button.click()
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
81
protractor/create/CreateTimeline.js
Normal file
81
protractor/create/CreateTimeline.js
Normal file
@ -0,0 +1,81 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Timeline', function() {
|
||||
var createItemClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Timeline";
|
||||
var ITEM_TYPE = "timeline";
|
||||
var ITEM_MENU_GLYPH = 'S\nTimeline';
|
||||
var ITEM_GRID_SELECT = 'P\nS\nTimeline\n0 Items';
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should Create Timeline', function(){
|
||||
//button.click()
|
||||
browser.wait(function() {
|
||||
createItemClass.createButton().click();
|
||||
return true;
|
||||
}).then(function (){
|
||||
var folder = createItemClass.selectNewItem(ITEM_TYPE)
|
||||
expect(folder.getText()).toEqual([ ITEM_MENU_GLYPH ]);
|
||||
folder.click()
|
||||
}).then(function() {
|
||||
browser.wait(function () {
|
||||
return element.all(by.model('ngModel[field]')).isDisplayed();
|
||||
})
|
||||
createItemClass.fillFolderForum(ITEM_NAME, ITEM_TYPE).click();
|
||||
browser.sleep(1000);
|
||||
}).then(function (){
|
||||
var fo= element.all(by.css('.item.grid-item.ng-scope')).filter(function (arg){
|
||||
return arg.getText().then(function (text) {
|
||||
expect(text).toEqual("fh");
|
||||
return text == ITEM_GRID_SELECT;
|
||||
});
|
||||
});
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
|
||||
});
|
||||
});
|
||||
it('should Create Timeline Activity', function(){
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
item.click();
|
||||
browser.sleep(1000);
|
||||
expect(browser.getTitle()).toEqual(ITEM_NAME);
|
||||
browser.sleep(1000);
|
||||
var edit = editItemClass.EditButton();
|
||||
expect(edit.count()).toBe(1);
|
||||
edit.click();
|
||||
browser.sleep(1000);
|
||||
editItemClass.CreateActivity();
|
||||
var ok = createItemClass.fillFolderForum("Activity", "activity");
|
||||
browser.sleep(1000);
|
||||
ok.click();
|
||||
browser.sleep(1000);
|
||||
editItemClass.saveButton();
|
||||
//save.click();
|
||||
browser.sleep(5000);
|
||||
});
|
||||
|
||||
});
|
70
protractor/create/CreateTimer.js
Normal file
70
protractor/create/CreateTimer.js
Normal file
@ -0,0 +1,70 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
var rightClick = require("../common/RightMenu");
|
||||
|
||||
describe('Create Timer', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var rightMenu = new rightClick();
|
||||
|
||||
var ITEM_NAME = "Timer";
|
||||
var ITEM_TYPE = "timer";
|
||||
var ITEM_MENU_GLYPH = 'õ\nTimer';
|
||||
var ITEM_GRID_SELECT = 'P\nõ\nTimer';
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should Create Timer', function(){
|
||||
//button.click()
|
||||
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(1500);
|
||||
}).then(function (){
|
||||
var item = editItemClass.SelectItem(ITEM_GRID_SELECT);
|
||||
expect(item.count()).toBe(1);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
});
|
||||
it('should test Timer', function(){
|
||||
browser.sleep(2000)
|
||||
rightMenu.reset(ITEM_MENU_GLYPH);
|
||||
browser.sleep(1000)
|
||||
var timer = element(by.css('.value.ng-binding.active'))
|
||||
timer.getText().then(function (time) {
|
||||
expect(time).toEqual("0D 00:00:01")
|
||||
})
|
||||
});
|
||||
|
||||
});
|
59
protractor/create/CreateWebPage.js
Normal file
59
protractor/create/CreateWebPage.js
Normal file
@ -0,0 +1,59 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var itemCreate = require("../common/CreateItem");
|
||||
var itemEdit = require("../common/EditItem");
|
||||
|
||||
describe('Create Web Page', function() {
|
||||
var createClass = new itemCreate();
|
||||
var editItemClass = new itemEdit();
|
||||
var ITEM_NAME = "Webpage";
|
||||
var ITEM_TYPE = "webpage";
|
||||
var ITEM_MENU_GLYPH = 'ê\nWeb Page';
|
||||
var ITEM_GRID_SELECT = 'P\nê\nWebpage';
|
||||
|
||||
beforeEach(require('../common/Launch'));
|
||||
|
||||
it('should Create new Web Page', function(){
|
||||
//button.click()
|
||||
browser.wait(function() {
|
||||
createClass.createButton().click();
|
||||
return true;
|
||||
}).then(function (){
|
||||
var folder = createClass.selectNewItem('webpage')
|
||||
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);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
60
protractor/ctrl.sh
Executable file
60
protractor/ctrl.sh
Executable file
@ -0,0 +1,60 @@
|
||||
#! /bin/bash
|
||||
ARGUMENT=$1;
|
||||
DIRECTORY=/Users/jsanderf/Applications;
|
||||
|
||||
if [ $# != 1 ]; then
|
||||
echo "Expected 1 Aurgument. Received " $# 1>&2;
|
||||
exit 1
|
||||
fi
|
||||
#Start webdrive and http-server
|
||||
if [ $ARGUMENT == start ]; then
|
||||
echo
|
||||
echo "Starting MMAP ..."
|
||||
$DIRECTORY/MAMP/ctlscript.sh start > logs/MAMP.log 2>&1 &
|
||||
wait $!
|
||||
if [ $? != 0 ]; then
|
||||
echo " Error: MMAP"
|
||||
echo " Check Log file"
|
||||
echo
|
||||
else
|
||||
echo " Started: MMAP"
|
||||
echo
|
||||
fi
|
||||
echo "Starting webdriver ..."
|
||||
webdriver-manager start > logs/webdriver.log 2>&1 &
|
||||
sleep 3;
|
||||
if grep -iq "Exception" logs/webdriver.log; then
|
||||
echo " Error: webdriver-manager"
|
||||
echo " Check Log file"
|
||||
echo
|
||||
else
|
||||
echo " Started: webdriver-manager"
|
||||
fi
|
||||
echo "Starting Elastic Search..."
|
||||
elasticsearch > logs/elasticSearch.log 2>&1 &
|
||||
sleep 3;
|
||||
if grep -iq "Exception" logs/elasticSearch.log; then
|
||||
echo " Error: ElasticSearch"
|
||||
echo " Check Log file"
|
||||
echo
|
||||
else
|
||||
echo " Started: ElasticSearch"
|
||||
fi
|
||||
#Runs Protractor tests
|
||||
elif [ $ARGUMENT == run ]; then
|
||||
protractor ./conf.js
|
||||
#Kill Process
|
||||
elif [ $ARGUMENT == stop ]; then
|
||||
echo "Stopping MAMP"
|
||||
$DIRECTORY/MAMP/ctlscript.sh stop >> logs/MAMP.log 2>&1 &
|
||||
sleep 1;
|
||||
echo "Stopping webdriver ..."
|
||||
kill $(ps aux | grep "[p]rotractor" | awk '{print $2}');
|
||||
kill $(ps aux | grep "[w]ebdriver-manager" | awk '{print $2}');
|
||||
sleep 1;
|
||||
echo "Stopping Elastic..."
|
||||
kill $(ps aux | grep "[e]lastic" | awk '{print $2}');
|
||||
sleep 1;
|
||||
else
|
||||
echo "Unkown: Command" $1;
|
||||
fi
|
38
protractor/delete/DeleteActivity.js
Normal file
38
protractor/delete/DeleteActivity.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Activity', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Activity";
|
||||
var ITEM_TYPE = "activity";
|
||||
var ITEM_MENU_GLYPH = 'a\nActivity';
|
||||
//var ITEM_GRID_SELECT = 'P\nS\nTimeline\n0 Items';
|
||||
var ITEM_SIDE_SELECT = ">\na\nActivity"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Activity', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteActivityMode.js
Normal file
38
protractor/delete/DeleteActivityMode.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Activity Mode', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Activity Mode";
|
||||
var ITEM_TYPE = "activity-mode";
|
||||
var ITEM_MENU_GLYPH = 'A\nActivity Mode';
|
||||
var ITEM_GRID_SELECT = 'P\nA\nActivity Mode';
|
||||
var ITEM_SIDE_SELECT = "A\nActivity Mode"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Activty Mode', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteClock.js
Normal file
38
protractor/delete/DeleteClock.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Clock', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Clock";
|
||||
var ITEM_TYPE = "clock";
|
||||
var ITEM_MENU_GLYPH = 'C\nClock';
|
||||
var ITEM_GRID_SELECT = 'P\nC\nClock';
|
||||
var ITEM_SIDE_SELECT = "C\nClock";
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Clock', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteDisplay.js
Normal file
38
protractor/delete/DeleteDisplay.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Display', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Display";
|
||||
var ITEM_TYPE = "display";
|
||||
var ITEM_MENU_GLYPH = 'L\nDisplay Layout';
|
||||
var ITEM_GRID_SELECT = 'P\nL\nDisplay Layout';
|
||||
var ITEM_SIDE_SELECT = ">\nL\nDisplay"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Dispay', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteFolder.js
Normal file
38
protractor/delete/DeleteFolder.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Folder', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Folder";
|
||||
var ITEM_TYPE = "folder";
|
||||
var ITEM_MENU_GLYPH = 'F\nFolder';
|
||||
var ITEM_GRID_SELECT = 'P\nF\nFolder\n0 Items';
|
||||
var ITEM_SIDE_SELECT = ">\nF\nFolder"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the folder', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteTelemetry.js
Normal file
38
protractor/delete/DeleteTelemetry.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Telemetry', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Telemetry";
|
||||
var ITEM_TYPE = "telemetry";
|
||||
var ITEM_MENU_GLYPH = 't\nTelemetry Panel'
|
||||
var ITEM_GRID_SELECT = 'P\nt\nTelemetry\n0 Items';
|
||||
var ITEM_SIDE_SELECT = ">\nt\nTelemetry"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Telemetry', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteTimeline.js
Normal file
38
protractor/delete/DeleteTimeline.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Timeline', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Timeline";
|
||||
var ITEM_TYPE = "timeline";
|
||||
var ITEM_MENU_GLYPH = 'S\nTimeline';
|
||||
var ITEM_GRID_SELECT = 'P\nS\nTimeline\n0 Items';
|
||||
var ITEM_SIDE_SELECT = ">\nS\nTimeline"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the specified object', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
38
protractor/delete/DeleteTimer.js
Normal file
38
protractor/delete/DeleteTimer.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Timer', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Timer";
|
||||
var ITEM_TYPE = "timer";
|
||||
var ITEM_MENU_GLYPH = 'õ\nTimer';
|
||||
var ITEM_GRID_SELECT = 'P\nõ\nTimer';
|
||||
var ITEM_SIDE_SELECT = "õ\nTimer"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Timer', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
37
protractor/delete/DeleteWebPage.js
Normal file
37
protractor/delete/DeleteWebPage.js
Normal file
@ -0,0 +1,37 @@
|
||||
/*****************************************************************************
|
||||
* Open MCT Web, Copyright (c) 2014-2015, United States Government
|
||||
* as represented by the Administrator of the National Aeronautics and Space
|
||||
* Administration. All rights reserved.
|
||||
*
|
||||
* Open MCT Web is licensed under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
* Open MCT Web includes source code licensed under additional open source
|
||||
* licenses. See the Open Source Licenses file (LICENSES.md) included with
|
||||
* this source code distribution or the Licensing information page available
|
||||
* at runtime from the About dialog for additional information.
|
||||
*****************************************************************************/
|
||||
var right_click = require("../common/RightMenu.js");
|
||||
var Create = require("../common/CreateItem")
|
||||
describe('Delete Webpage', function() {
|
||||
var clickClass = new right_click();
|
||||
var createClass = new Create();
|
||||
var ITEM_NAME = "Webpage";
|
||||
var ITEM_TYPE = "webpage";
|
||||
var ITEM_MENU_GLYPH = 'ê\nWeb Page';
|
||||
var ITEM_SIDE_SELECT = "ê\nWebpage"
|
||||
beforeEach(require('../common/Launch'));
|
||||
it('should delete the Webpage', function(){
|
||||
clickClass.delete(ITEM_SIDE_SELECT);
|
||||
browser.sleep(1000);
|
||||
});
|
||||
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user