Skip to content

Commit

Permalink
revert code not ready (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolfe1 authored Oct 25, 2019
1 parent 3fa59c6 commit cee5ba0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
11 changes: 2 additions & 9 deletions src/Zoomba/GUILibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from robot.libraries.BuiltIn import BuiltIn
from robot.api.deco import keyword
from robot.libraries.Collections import Collections
from time import time

zoomba = BuiltIn()
zoomba_collections = Collections()
Expand Down Expand Up @@ -142,14 +141,8 @@ def wait_until_window_opens(self, title):
verify that the provided window title is among them.\n
title: (string) The title of the window you are waiting for.
"""
timeout = time() + self.timeout
while time() < timeout:
titles = self.get_window_titles()
found = zoomba.run_keyword_and_return_status(zoomba_collections.list_should_contain_value(titles, title))
if found:
return
zoomba.sleep("0.5s")
zoomba.fail("Window with the title: " + title + " not found.")
titles = self.get_window_titles()
zoomba_collections.list_should_contain_value(titles, title)

@keyword("Window Should Not Be Open")
def window_should_not_be_open(self, title):
Expand Down
7 changes: 2 additions & 5 deletions test/GUI/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,11 @@ def test_wait_for_and_select_checkbox_simple(self):
mock_gui.select_checkbox.assert_called_with("some_locator")

@patch('robot.libraries.Collections.Collections.list_should_contain_value')
@patch('robot.libraries.BuiltIn._RunKeyword.run_keyword_and_return_status')
def test_wait_until_window_opens_simple(self, robot_call, robot_call_2):
def test_wait_until_window_opens_simple(self, robot_call):
mock_gui = Mock()
mock_gui.timeout = 5
mock_gui.get_window_titles = Mock(return_value=["title"])
GUILibrary.wait_until_window_opens(mock_gui, "title")
robot_call.assert_called()
robot_call_2.assert_called_with(["title"], "title")
robot_call.assert_called_with(["title"], "title")

@patch('robot.libraries.Collections.Collections.list_should_not_contain_value')
def test_window_should_not_be_open_simple(self, robot_call):
Expand Down

0 comments on commit cee5ba0

Please sign in to comment.