Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix autocomplete tests for lab #6924

Merged
merged 4 commits into from
Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions test/ipynb/clojure/ClojureTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/groovy/GroovyTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"de"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/java/JavaTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"imp"
]
"source": []
},
{
"cell_type": "markdown",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/kotlin/KotlinTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"fu"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/python/InitCellsTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"im"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/scala/ScalaTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pr"
]
"source": []
},
{
"cell_type": "code",
Expand Down
4 changes: 1 addition & 3 deletions test/ipynb/sql/SQLTest.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"s"
]
"source": []
},
{
"cell_type": "code",
Expand Down
11 changes: 0 additions & 11 deletions test/js/beakerx.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,6 @@ function BeakerXPageObject() {
return codeCell.$('div.beaker-easyform-container');
};

this.callAutocompleteAndGetItsList = function(codeCell){
codeCell.scroll();
codeCell.click('div.CodeMirror-code[role="presentation"]');
browser.keys("Tab");
browser.keys('\uE000');
browser.waitUntil(function() {
return browser.isVisible('#complete');
}, 10000, 'autocomplete list is not visible');
return $$('#complete > select > option');
}

};

module.exports = BeakerXPageObject;
2 changes: 1 addition & 1 deletion test/js/clojure/clojureTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Clojure base tests ', function () {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'def');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/groovy/groovyTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('Groovy base tests. ', function () {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'de');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/java/javaTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('Java base tests ', function () {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'imp');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/kotlin/kotlinTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('Kotlin base tests ', function () {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'fu');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
15 changes: 14 additions & 1 deletion test/js/lab.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,19 @@ var LabPageObject = function () {

this.getAllOutputsWidget = function(codeCell){
return codeCell.$$('div.jp-OutputArea-child > div.jp-OutputArea-output');
}
};

this.callAutocompleteAndGetItsList = function(codeCell, codeStr){
codeCell.scroll();
codeCell.click('div.CodeMirror.cm-s-jupyter');
codeCell.keys(codeStr);
browser.keys("Tab");
browser.keys('\uE000');
browser.waitUntil(function() {
return browser.isVisible('ul.jp-Completer')
}, 10000, 'autocomplete list is not visible');
return $$('li.jp-Completer-item');
};

};
module.exports = LabPageObject;
14 changes: 13 additions & 1 deletion test/js/notebook.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,19 @@ var NotebookPageObject = function () {

this.getAllOutputsWidget = function(codeCell){
return codeCell.$$('div.output_subarea.jupyter-widgets-view');
}
};

this.callAutocompleteAndGetItsList = function(codeCell, codeStr){
codeCell.scroll();
codeCell.click('div.CodeMirror-code[role="presentation"]');
codeCell.keys(codeStr);
browser.keys("Tab");
browser.keys('\uE000');
browser.waitUntil(function() {
return browser.isVisible('#complete');
}, 10000, 'autocomplete list is not visible');
return $$('#complete > select > option');
};

};
module.exports = NotebookPageObject;
2 changes: 1 addition & 1 deletion test/js/python/initCellsPythonTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('(Python) Testing of init cells', function() {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'im');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/scala/scalaTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('Scala base tests ', function () {
it('Autocomplete list is not empty ', function(){
cellIndex += 1;
var codeCell = beakerxPO.getCodeCellByIndex(cellIndex);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 'pr');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down
2 changes: 1 addition & 1 deletion test/js/sql/sqlTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('SQL base tests ', function () {
describe('(SQL) Autocomplete cell ', function () {
it('Autocomplete list is not empty ', function () {
var codeCell = beakerxPO.getCodeCellByIndex(3);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell);
var completeList = beakerxPO.callAutocompleteAndGetItsList(codeCell, 's');
expect(completeList.length).toBeGreaterThan(0);
});
});
Expand Down