| Summary: | Orion Editor should provide a way to obtain it's state (e.g. isReady, loading) | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Bartosz Grabski <bartosz.grabski> |
| Component: | Client | Assignee: | Project Inbox <orion.client-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | maciej.bendkowski, steve_northover |
| Version: | 6.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
We are unlikely to get to this. We are interested in testing, but unlikely to get to this. (In reply to Steve Northover from comment #2) > We are interested in testing, but unlikely to get to this. Please change the bug status to RESOLVED WONTFIX if you do not intend to fix it. |
Editor should provide a way to access the state of itself. It could streamline the UI automation and make tester's life much easier :) Right now UI automation is highly dependant on timeouts. This can lead to failures when the server backend responds slower than anticipated. Moreover DOM elements could not be fully initialized. Providing aforementioned interface to access Editor state would lead to more robust and elegant UI automation code. We could expose the state in several ways. The two i have in mind are: - creating an orionEditor object in the global window object. The former would hold the state. - holding the state in a proper requireJS module. Writing UI automation would require accessing the module first. Java WebDriver sample code that could do the work, Boolean isReady = ((JavascriptExecutor) driver).executeJavascript( "return window.orionEditor.isReady;" ) or Boolean isReady = ((JavascriptExecutor) driver).executeJavascript( "var editorModuleState = require(["editor"], function(editor) { return editor.state });" + "return editorModuleState;" ) and then creating a fluent wait which waits until the Editor is fully loaded is really simple and elegant Wait<WebDriver> wait = new WebDriverWait(driver, max_timeout); wait.until(new Function<WebDriver,Boolean> { public Boolean apply(driver) { return ...... <- Javascript invocation } }