Skip to content

Commit

Permalink
Fix #130
Browse files Browse the repository at this point in the history
Add delay between actions in functional test for more stability
  • Loading branch information
SAMOXA committed Feb 6, 2019
1 parent 3c2877e commit d2ff1a3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/test_fresh_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pywinauto.application import Application
import os
import glob
import locale

sample_fest_path = r"..\..\test\data\sample.fest"
items_number = 3
Expand All @@ -23,17 +24,25 @@ def setUp(self):

def test_load_session(self):
app = Application().start("FestEngine.exe")
time.sleep(1)

app['Welcome to Fest Engine'].OK.click()
time.sleep(0.5)

settings = app.Settings
settings['Current Fest:Edit'].set_text(os.path.abspath(sample_fest_path))
time.sleep(0.5)

settings.Load.click()
time.sleep(1)

app['Restart Required'].NoButton.click()
app.wxWindowNR.menu_select("Main -> Exit")
if locale.getdefaultlocale()[0] == 'ru_RU':
app['Restart Required'].НетButton.click()
else:
app['Restart Required'].NoButton.click()
time.sleep(0.5)

app.wxWindowNR.menu_select("Main -> Exit")
app.wait_for_process_exit(1)

app = Application().start("FestEngine.exe")
Expand All @@ -43,7 +52,7 @@ def test_load_session(self):
self.assertTrue('Loaded %d items' % items_number in main_window.StatusBar.texts())

main_window.menu_select("Main -> Show Log")
time.sleep(0.5)
time.sleep(1)
log_text = app["FestEngine Log"].Edit.text_block()
self.assertTrue(log_text.strip() == "Init", "Errors in log:")

Expand Down

0 comments on commit d2ff1a3

Please sign in to comment.