Skip to content

Commit

Permalink
Join Wiring Editor tests cases improve test speed and reliability
Browse files Browse the repository at this point in the history
Before this patch, the wiring editor tests cases are splited into
several test cases, making selenium to start and close the browser too
often. Moreover, some tests were grouped in a way that they cannot make
use of a different feature set. For example, some tests require search
indexes while others not, but due those tests using search indexes, all
the tests on the test case were forced to use search indexes, causing a
big time penality.
  • Loading branch information
aarranz committed Oct 12, 2018
1 parent 46902c4 commit 83a079d
Show file tree
Hide file tree
Showing 4 changed files with 558 additions and 681 deletions.
2 changes: 1 addition & 1 deletion src/wirecloud/commons/fixtures/user_with_workspaces.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
"model": "platform.workspace",
"fields": {
"forcedValues": "",
"wiringStatus": "{\"connections\": [], \"operators\": {}, \"version\": \"2.0\", \"visualdescription\": {\"connections\": [], \"behaviours\": [], \"components\": {\"operator\": {}, \"widget\": {}}}}",
"wiringStatus": "{\"version\":\"2.0\",\"connections\":[{\"readonly\":false,\"source\":{\"type\":\"widget\",\"id\":\"7\",\"endpoint\":\"outputendpoint\"},\"target\":{\"type\":\"widget\",\"id\":\"8\",\"endpoint\":\"inputendpoint\"}}],\"operators\":{},\"visualdescription\":{\"behaviours\":[],\"components\":{\"operator\":{},\"widget\":{\"7\":{\"name\":\"Wirecloud/Test/1.0\",\"position\":{\"x\":84,\"y\":40},\"collapsed\":false,\"endpoints\":{\"source\":[],\"target\":[]}},\"8\":{\"name\":\"Wirecloud/Test/1.0\",\"position\":{\"x\":411,\"y\":41},\"collapsed\":false,\"endpoints\":{\"source\":[],\"target\":[]}},\"9\":{\"name\":\"Wirecloud/Test/1.0\",\"position\":{\"x\":411,\"y\":188},\"collapsed\":false,\"endpoints\":{\"source\":[],\"target\":[]}}}},\"connections\":[{\"sourcename\":\"widget/7/outputendpoint\",\"sourcehandle\":\"auto\",\"targetname\":\"widget/8/inputendpoint\",\"targethandle\":\"auto\"}]}}",
"name": "WiringTests",
"title": "WiringTests",
"groups": [],
Expand Down
5 changes: 1 addition & 4 deletions src/wirecloud/commons/utils/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,10 +810,7 @@ def wait_still(self, timeout=2):
return self

def wait_loaded(self):
def widget_loaded(driver):
return self.loaded

WebDriverWait(self.testcase.driver, timeout=10).until(widget_loaded)
WebDriverWait(self.testcase.driver, timeout=10).until(lambda driver: self.loaded)
return self

def maximize(self, timeout=10):
Expand Down
3 changes: 3 additions & 0 deletions src/wirecloud/platform/static/js/wirecloud/ui/WiringEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Wirecloud.ui = Wirecloud.ui || {};
this.selectedCount = 0;

this.orderableComponent = null;
this.disable();
};

utils.inherit(ns.WiringEditor, se.Alternative, /** @lends Wirecloud.ui.WiringEditor.prototype */ {
Expand Down Expand Up @@ -196,6 +197,7 @@ Wirecloud.ui = Wirecloud.ui || {};
loadWiringStatus.call(this);

Wirecloud.UserInterfaceManager.rootKeydownHandler = document_onkeydown.bind(this);
this.enable();

return this;
},
Expand All @@ -212,6 +214,7 @@ Wirecloud.ui = Wirecloud.ui || {};
readyView.call(this);

Wirecloud.UserInterfaceManager.rootKeydownHandler = null;
this.disable();

return this;
},
Expand Down
Loading

0 comments on commit 83a079d

Please sign in to comment.