Skip to content
Snippets Groups Projects
Commit 32dfb5fb authored by mpukhliak's avatar mpukhliak
Browse files

SSDM-8848 I did test 14. refactoring

parent 3a56b0fb
No related branches found
No related tags found
No related merge requests found
...@@ -106,17 +106,7 @@ var UserTests = new function() { ...@@ -106,17 +106,7 @@ var UserTests = new function() {
var pathToResource = "js/test/resources/bacteria_for_test_without_identifier.tsv"; var pathToResource = "js/test/resources/bacteria_for_test_without_identifier.tsv";
return new Promise(function executor(resolve, reject) { return new Promise(function executor(resolve, reject) {
var e = EventUtil; var e = EventUtil;
Promise.resolve().then(() => e.waitForId("_MATERIALS_BACTERIA_BACTERIA_COLLECTION")) Promise.resolve().then(() => UserTests.importBacteriasFromFile(baseURL + pathToResource))
.then(() => e.click("_MATERIALS_BACTERIA_BACTERIA_COLLECTION"))
.then(() => e.waitForId("options-menu-btn"))
.then(() => e.click("options-menu-btn"))
.then(() => e.waitForId("register-object-btn"))
.then(() => e.click("register-object-btn"))
.then(() => e.waitForId("choose-type-btn"))
.then(() => e.change("choose-type-btn", "BACTERIA", false))
.then(() => TestUtil.setFile("name", baseURL + pathToResource, "text"))
.then(() => e.waitForId("accept-type-file"))
.then(() => e.click("accept-type-file"))
.then(() => e.waitForId("bac5-column-id")) .then(() => e.waitForId("bac5-column-id"))
.then(() => e.waitForId("bac6-column-id")) .then(() => e.waitForId("bac6-column-id"))
.then(() => e.waitForId("bac7-column-id")) .then(() => e.waitForId("bac7-column-id"))
...@@ -130,6 +120,21 @@ var UserTests = new function() { ...@@ -130,6 +120,21 @@ var UserTests = new function() {
var pathToResource = "js/test/resources/bacteria_for_test_with_identifier.tsv"; var pathToResource = "js/test/resources/bacteria_for_test_with_identifier.tsv";
return new Promise(function executor(resolve, reject) { return new Promise(function executor(resolve, reject) {
var e = EventUtil; var e = EventUtil;
Promise.resolve().then(() => UserTests.importBacteriasFromFile(baseURL + pathToResource))
.then(() => e.waitForId("bac10-column-id"))
.then(() => e.waitForId("bac11-column-id"))
.then(() => e.waitForId("next-page-id"))
.then(() => e.click("next-page-id"))
.then(() => e.waitForId("bac12-column-id"))
.then(() => e.waitForId("bac13-column-id"))
.then(() => resolve());
});
}
this.importBacteriasFromFile = function(file) {
return new Promise(function executor(resolve, reject) {
var e = EventUtil;
Promise.resolve().then(() => e.waitForId("_MATERIALS_BACTERIA_BACTERIA_COLLECTION")) Promise.resolve().then(() => e.waitForId("_MATERIALS_BACTERIA_BACTERIA_COLLECTION"))
.then(() => e.click("_MATERIALS_BACTERIA_BACTERIA_COLLECTION")) .then(() => e.click("_MATERIALS_BACTERIA_BACTERIA_COLLECTION"))
.then(() => e.waitForId("options-menu-btn")) .then(() => e.waitForId("options-menu-btn"))
...@@ -138,18 +143,12 @@ var UserTests = new function() { ...@@ -138,18 +143,12 @@ var UserTests = new function() {
.then(() => e.click("register-object-btn")) .then(() => e.click("register-object-btn"))
.then(() => e.waitForId("choose-type-btn")) .then(() => e.waitForId("choose-type-btn"))
.then(() => e.change("choose-type-btn", "BACTERIA", false)) .then(() => e.change("choose-type-btn", "BACTERIA", false))
.then(() => TestUtil.setFile("name", baseURL + pathToResource, "text")) .then(() => TestUtil.setFile("name", file, "text"))
.then(() => e.waitForId("accept-type-file")) .then(() => e.waitForId("accept-type-file"))
.then(() => e.click("accept-type-file")) .then(() => e.click("accept-type-file"))
.then(() => e.waitForId("bac10-column-id"))
.then(() => e.waitForId("bac11-column-id"))
.then(() => e.waitForId("next-page-id"))
.then(() => e.click("next-page-id"))
.then(() => e.waitForId("bac12-column-id"))
.then(() => e.waitForId("bac13-column-id"))
.then(() => resolve()); .then(() => resolve());
}); });
} }
this.storageTest = function() { this.storageTest = function() {
return new Promise(function executor(resolve, reject) { return new Promise(function executor(resolve, reject) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment