Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 439617

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: ClientAssignee: 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:

Description Bartosz Grabski CLA 2014-07-15 09:21:08 EDT
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
	}
}
Comment 1 Steve Northover CLA 2015-05-08 11:29:46 EDT
We are unlikely to get to this.
Comment 2 Steve Northover CLA 2015-05-08 11:32:11 EDT
We are interested in testing, but unlikely to get to this.
Comment 3 Maciej Bendkowski CLA 2015-05-08 11:34:19 EDT
(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.