Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 1b3c9dd

Browse files
authored
Merge pull request #830 from bjones1/fix_tests
Fix tests
2 parents ffc5346 + 4c09d4f commit 1b3c9dd

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

runestone/activecode/test/test_activecode.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def test_activity_count(self):
9090
rb.click()
9191
pb = self.driver.find_element_by_id("subchapterprogress")
9292
self.assertIsNotNone(pb)
93+
# Wait for the JS to run. Increase this delay if the next assertion fails.
94+
time.sleep(1)
9395
total = self.driver.find_element_by_id("scprogresstotal").text.strip()
9496
self.assertEqual(2, int(total))
9597
possible = self.driver.find_element_by_id("scprogressposs").text.strip()

runestone/parsons/test/test_parsons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def wait_and_close_alert(self, timeout = 3):
171171
WebDriverWait(self.driver, timeout).until(EC.alert_is_present(),
172172
'Timed out waiting for PA creation ' +
173173
'confirmation popup to appear.')
174-
alert = self.driver.switch_to_alert()
174+
alert = self.driver.switch_to.alert
175175
alert.accept()
176176
return True
177177
except TimeoutException:

runestone/unittest_base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import platform
55
import subprocess
66
from selenium import webdriver
7+
from selenium.webdriver.chrome.options import Options
78
from pyvirtualdisplay import Display
89

910
# Select an unused port for serving web pages to the test suite.
@@ -51,11 +52,9 @@ def setUpModule(self):
5152
else:
5253
self.display = None
5354
#self.driver = webdriver.PhantomJS() # use this for Jenkins auto testing
54-
# options = webdriver.ChromeOptions()
55-
# options.add_argument("headless")
56-
# options.add_argument("window-size=1200x800")
57-
#self.driver = webdriver.Chrome(chrome_options=options) # good for development.
58-
self.driver = webdriver.Chrome() # good for development.
55+
options = Options()
56+
options.add_argument("--window-size=1200,800")
57+
self.driver = webdriver.Chrome(chrome_options=options) # good for development.
5958

6059
# Make this accessible
6160
global mf

0 commit comments

Comments
 (0)