Refactor TextEditorTest to wait until text editor is opened. Fixes: # 877