-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
4b69d6e
commit 9fa5892
Showing
2 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"true" | ||
] | ||
}, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"null" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult = true;\n", | ||
"String seeNullString = null;\n", | ||
"seeNullString" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"null" | ||
] | ||
}, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"com.twosigma.beakerx.kernel.Kernel.showNullExecutionResult = false;\n", | ||
"String noNullString = null;\n", | ||
"noNullString" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Groovy", | ||
"language": "groovy", | ||
"name": "groovy" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": "groovy", | ||
"file_extension": ".groovy", | ||
"mimetype": "", | ||
"name": "Groovy", | ||
"nbconverter_exporter": "", | ||
"version": "2.4.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC | ||
* | ||
* 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. | ||
*/ | ||
|
||
var BeakerXPageObject = require('../beakerx.po.js'); | ||
var beakerxPO; | ||
|
||
describe('(Groovy) Testing of showing the null execution result', function() { | ||
|
||
beforeAll(function () { | ||
beakerxPO = new BeakerXPageObject(); | ||
beakerxPO.runNotebookByUrl('/notebooks/test/notebooks/groovy/ShowNullExecutionResultTest.ipynb'); | ||
}, 2); | ||
|
||
afterAll(function () { | ||
beakerxPO.closeAndHaltNotebook(); | ||
}); | ||
|
||
describe('(Groovy) Show null execution result as true', function() { | ||
it('Cell displays true output', function () { | ||
cellIndex = 0; | ||
var codeCell = beakerxPO.runCodeCellByIndex(cellIndex); | ||
|
||
expect(codeCell.$('div.output_result').isEnabled()).toBeTruthy(); | ||
expect(codeCell.$('div.output_result').getText()).toBe('true'); | ||
}); | ||
}); | ||
|
||
describe('(Groovy) Show null execution result as null', function() { | ||
it('Cell displays null output', function () { | ||
cellIndex += 1; | ||
var codeCell = beakerxPO.runCodeCellByIndex(cellIndex); | ||
|
||
expect(codeCell.$('div.output_result').isEnabled()).toBeTruthy(); | ||
expect(codeCell.$('div.output_result').getText()).toBe('null'); | ||
}); | ||
}); | ||
|
||
describe('(Groovy) Do not show null execution result', function() { | ||
it('Cell displays no output', function () { | ||
cellIndex += 1; | ||
var codeCell = beakerxPO.runCodeCellByIndex(cellIndex); | ||
|
||
expect(codeCell.$('div.output').getText()).toBe(''); | ||
}); | ||
}); | ||
}); |