Skip to content

Commit

Permalink
Merge pull request #797 from openworm/development
Browse files Browse the repository at this point in the history
Release 0.4.0
  • Loading branch information
tarelli authored May 16, 2018
2 parents 14bdbf1 + bd455b3 commit ec3564d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 45 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@

This module contains the frontend of Geppetto which includes the visualization 3D engine (using the awesome [three.js](https://github.com/mrdoob/three.js/)), all the javascript magic and the servlet which is used to connect to the backend using WebSocket.

For more information related to this bundle please refer to the documentation below:
- [Geppetto Extensions tutorial](http://docs.geppetto.org/en/latest/build.html)
- [Geppetto Widgets tutorial](http://docs.geppetto.org/en/latest/widgets.html)
- [Lightspeed Search Customization](http://docs.geppetto.org/en/latest/spotlightcustom.html)
- [Control Panel Customization](http://docs.geppetto.org/en/latest/controlpanelcustom.html)

For information about how this fits into [Geppetto](http://www.geppetto.org/) refer to the umbrella project [org.geppetto](https://github.com/openworm/org.geppetto) on GitHub.
79 changes: 40 additions & 39 deletions src/main/webapp/js/pages/tests/casperjs/PersistenceTestsLogic.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ function testProject(test, url, expect_error, persisted, spotlight_record_variab
casper.then(function () {
doExperimentTableTest(test);
//FIXME Restore after fixing console test
// if(testConsole){
// doConsoleTest(test);
// }
if(testConsole){
doConsoleTest(test);
}
});

casper.then(function () {
Expand All @@ -129,9 +129,7 @@ function testProject(test, url, expect_error, persisted, spotlight_record_variab
if (persisted == false) {
casper.then(function () {
// make sure experiment panel is open
this.evaluate(function() {
$('a[href=experiments]').click();
});
// casper.clickLabel('Experiments', 'span');

//roll over the experiments row
this.mouse.move('tr.experimentsTableColumn:nth-child(1)');
Expand Down Expand Up @@ -160,10 +158,10 @@ function testProject(test, url, expect_error, persisted, spotlight_record_variab
casper.then(function () {
this.echo("Checking content of experiment row");
// test or wait for control panel stuff to be there
if(this.exists('a[href="#experiments"]')){
if(this.exists('span[class*="tabber"]')){
doExperimentsTableRowTests(test);
} else {
this.waitForSelector('a[href="#experiments"]', function(){
this.waitForSelector('span[class*="tabber"]', function(){
doExperimentsTableRowTests(test);
}, null, 10000);
}
Expand Down Expand Up @@ -247,27 +245,30 @@ function closeErrorMesage(test) {

function doExperimentTableTest(test) {
casper.then(function () {
test.assertExists('a[aria-controls="experiments"]', "Experiments tab anchor is present");
test.assertExists('span[class*="tabber"]', "Experiments tab anchor is present");

test.assertExists('div#experiments', "Experiments panel is present");
test.assertSelectorHasText('span[class*="tabber"]', 'Experiments');

test.assertNotVisible('div#experiments', "The experiment panel is correctly closed.");
test.assertExists('div#experimentsOutput', "Experiments panel is present");

test.assertNotVisible('div#experimentsOutput', "The experiment panel is correctly closed.");
});

casper.then(function () {
this.echo("Opening experiment console");
this.evaluate(function() {
$("a[href='#experiments']").click();
});
casper.clickLabel('Experiments', 'span');

this.waitUntilVisible('div#experiments', function () {
test.assertVisible('div#experiments', "The experiment panel is correctly open.");
this.waitUntilVisible('div#experimentsOutput', function () {
test.assertVisible('div#experimentsOutput', "The experiment panel is correctly open.");
this.echo("Closing experiment console");
casper.clickLabel('Experiments', 'span');
}, null, 15000);
});
}

function doExperimentsTableRowTests(test){
casper.echo("Opening experiments panel");
casper.clickLabel('Experiments', 'span');

// open first experiment row
casper.echo("Opening first experiment row");
Expand All @@ -279,7 +280,9 @@ function doExperimentsTableRowTests(test){
// make sure panel is open
casper.evaluate(function() {
if(!$('#experimentsOutput').is(':visible')){
$('#experimentsButton').click();
//$('#experimentsButton').click();
//this.echo("Closing experiment console");
casper.clickLabel('Experiments', 'span');
}
});
casper.waitUntilVisible('td[name=variables]', function(){
Expand All @@ -289,19 +292,23 @@ function doExperimentsTableRowTests(test){
}

function doConsoleTest(test) {

casper.then(function () {
test.assertExists('a[aria-controls="console"]', "Console tab anchor is present");
test.assertExists('span[class*="tabber"]', "Tabber anchor is present");

test.assertSelectorHasText('span[class*="tabber"]', 'Console');

test.assertExists('div#console', "Console panel is present");
test.assertExists('div[class*="consoleContainer"]', "Console panel is present");

test.assertNotVisible('div#console', "The console panel is correctly closed.");
test.assertNotVisible('div[class*="consoleContainer"]', "The console panel is correctly closed.");
});

casper.then(function () {
this.click('a[href="#console"]', "Opening command console");
//this.click('a[href="#console"]', "Opening command console");
casper.clickLabel('Console', 'span');

this.waitUntilVisible('div#console', function () {
test.assertVisible('div#console', "The console panel is correctly open.");
this.waitUntilVisible('div.consoleContainer', function () {
test.assertVisible('div.consoleContainer', "The console panel is correctly open.");
//type into console command (getTimeSeries()) half finished for state variable
casper.evaluate(function() {
$('textarea#commandInputArea').val('hhcell.hhpop[0].v.getTi');
Expand Down Expand Up @@ -371,9 +378,9 @@ function doPrePersistenceExperimentsTableButtonsCheck(test) {
function doPostPersistenceExperimentsTableButtonCheck(test) {
casper.waitForSelector('button.btn.SaveButton[disabled]', function () {
casper.wait(5000, function () {});
if(this.exists('a[href="#experiments"]')){
casper.echo("Experiments button exists");
}

test.assertSelectorHasText('span[class*="tabber"]', 'Console', 'Experiments button exists');

casper.mouse.move('tr.experimentsTableColumn:nth-child(1)');
//Check presence of experiment console buttons AFTER persistence
casper.waitForSelector('a.activeIcon', function () {
Expand Down Expand Up @@ -623,13 +630,11 @@ function testUpload2DropBoxFeature(test,projectURL){


casper.then(function () {
casper.evaluate(function() {
$("#consoleButton").click();
});
casper.clickLabel('Console', 'span');
});

casper.then(function(){
this.waitUntilVisible('div[id="Console1_console"]', function () {
this.waitUntilVisible('div[id="undefined_console"]', function () {
casper.then(function () {
casper.evaluate(function() {
G.debug(true);
Expand Down Expand Up @@ -842,12 +847,10 @@ function experimentConsoleToggleTests(test,rowLength){

casper.then(function () {
this.echo("Opening experiment console");
this.evaluate(function() {
$("a[href='#experiments']").click();
});
casper.clickLabel('Experiments', 'span');

this.waitUntilVisible('div#experiments', function () {
test.assertVisible('div#experiments', "The experiment panel is correctly open.");
this.waitUntilVisible('div#experimentsOutput', function () {
test.assertVisible('div#experimentsOutput', "The experiment panel is correctly open.");
}, null, 15000);
});
casper.then(function () {
Expand All @@ -860,13 +863,11 @@ function experimentConsoleToggleTests(test,rowLength){

casper.then(function () {
casper.then(function () {
casper.evaluate(function() {
$("#consoleButton").click();
});
casper.clickLabel('Console', 'span');
});

casper.then(function(){
this.waitUntilVisible('div[id="Console1_console"]', function () {
this.waitUntilVisible('div[id="undefined_console"]', function () {
casper.then(function () {
casper.evaluate(function() {
G.debug(true);
Expand Down
35 changes: 29 additions & 6 deletions src/main/webapp/js/pages/tests/casperjs/UIComponentsTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ casper.test.begin('Geppetto basic UI Components/Widgets Tests', function suite(t
casper.then(function(){launchTest(test,"Default Empty Project",5000);});
casper.then(function(){casper.wait(2000, function () {
//FIXME: Broken after tabbed drawer refactoring, on the to do list.
//casper.then(function(){consoleTest(test);});
casper.then(function(){consoleTest(test);});
casper.then(function(){debugModeTest(test);});
casper.then(function(){helpWindowTest(test);});
casper.then(function(){popupWidgetTest(test);});
Expand Down Expand Up @@ -140,7 +140,29 @@ function helpWindowTest(test){
function consoleTest(test){
//open the console
casper.then(function () {
buttonClick("#consoleButton");
//buttonClick("#consoleButton");
casper.clickLabel('Console', 'span');
});

casper.then(function () {
test.assertVisible('div[class*="consoleContainer"]', "The console panel is correctly visible.");

buttonClick(".minIcons");
test.assertNotVisible('div[class*="consoleContainer"]', "The console panel is correctly hidden.");

casper.clickLabel('Console', 'span');
test.assertVisible('div[class*="consoleContainer"]', "The console panel is correctly visible.");

buttonClick(".maxIcons");
var tabberHeight = casper.evaluate(function () {
return $(".drawer,.react-draggable").height() > 250;
});
test.assertEquals(tabberHeight, true, "Console is maximized correctly");

buttonClick(".closeIcons");
test.assertNotVisible('div[class*="consoleContainer"]', "The console panel is correctly hidden.");

casper.clickLabel('Console', 'span');
});

casper.then(function(){
Expand All @@ -167,7 +189,7 @@ function consoleTest(test){
//test console is empty upon opening
casper.then(function () {
var spanCount = casper.evaluate(function() {
return $("#Console1_console").find("span").length <=4;
return $("#undefined_console").find("span").length <=4;
});
test.assertEquals(spanCount, true, "Console output not empty");
});
Expand All @@ -183,7 +205,7 @@ function consoleTest(test){
//test console is empty after it got cleared
casper.then(function () {
var spanCount = casper.evaluate(function() {
return $("#Console1_console").find("span").length;
return $("#undefined_console").find("span").length;
});
test.assertEquals(spanCount, 0, "Console output not empty after G.clear");
});
Expand All @@ -201,9 +223,10 @@ function consoleTest(test){
casper.then(function () {
//test hiding the console
casper.then(function () {
buttonClick("#consoleButton");
//buttonClick("#consoleButton");
casper.clickLabel('Console', 'span');
});
casper.waitWhileVisible('div[id="Console1_console"]', function () {
casper.waitWhileVisible('#commandInputArea', function () {
this.echo("I've waited for console hide.");
});
});
Expand Down

0 comments on commit ec3564d

Please sign in to comment.