Skip to content

Commit

Permalink
Fix some async issues running tests.
Browse files Browse the repository at this point in the history
These were probably caused by the minor version change to jQuery.
Test logic remains unchanged as the underlying application still worked fine.
  • Loading branch information
tomtom5152 committed May 9, 2017
1 parent c16ba62 commit 0f65766
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion RIGS/test_functional.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import os
import re
import time
from datetime import date, timedelta

import reversion
Expand Down Expand Up @@ -297,6 +298,7 @@ def testRigCreate(self):
name.clear()
name.send_keys('Rig ' + person1.name)
name.send_keys(Keys.ENTER)
time.sleep(0.1)

wait.until(animation_is_finished())

Expand Down Expand Up @@ -378,6 +380,7 @@ def testRigCreate(self):
e = modal.find_element_by_id("item_cost")
e.send_keys("23.95")
e.send_keys(Keys.ENTER) # enter submit
wait.until(animation_is_finished())

# Confirm item has been saved to json field
objectitems = self.browser.execute_script("return objectitems;")
Expand All @@ -388,6 +391,7 @@ def testRigCreate(self):

# See new item appear in table
row = self.browser.find_element_by_id('item--1') # ID number is known, see above
self.assertIsNotNone(row.text)
self.assertIn("Test Item 1", row.find_element_by_xpath('//span[@class="name"]').text)
self.assertIn("This is an item description", row.find_element_by_xpath('//div[@class="item-description"]').text)
self.assertEqual(u'拢 23.95', row.find_element_by_xpath('//tr[@id="item--1"]/td[2]').text)
Expand Down Expand Up @@ -487,6 +491,7 @@ def testEventDuplicate(self):
e = modal.find_element_by_id("item_cost")
e.send_keys("23.95")
e.send_keys(Keys.ENTER) # enter submit
wait.until(animation_is_finished())

# Attempt to save
save.click()
Expand Down Expand Up @@ -909,9 +914,9 @@ def __init__(self):
pass

def __call__(self, driver):
time.sleep(0.1) # allow time for the animation to actually start
numberAnimating = driver.execute_script('return $(":animated").length')
finished = numberAnimating == 0
if finished:
import time
time.sleep(0.1)
return finished

0 comments on commit 0f65766

Please sign in to comment.