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

Commit 9a4ab8d

Browse files
committed
Cleanup
1 parent 9bdc4e1 commit 9a4ab8d

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

runestone/activecode/test/test_activecode.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import time
2+
13
import pytest
24
from selenium.webdriver import ActionChains
35
from selenium.webdriver.support import expected_conditions as EC
@@ -124,21 +126,10 @@ def test_activity_count(selenium_utils_progress):
124126
def test_sql_activecode(selenium_utils_get):
125127
div_id = "test_activecode_6"
126128
t2 = find_ac(selenium_utils_get, div_id)
127-
import time
129+
# Without this line, tests fail on Github actions. They run on my local Windows machine with no problem without this line. I don't know why.
128130
time.sleep(1)
129131
click_run(selenium_utils_get, t2)
130-
# Some hacky debug code to try and understand why this fails on Github actions.
131-
for _ in selenium_utils_get.driver.get_log("browser"):
132-
print(_)
133-
from selenium.webdriver.support.ui import WebDriverWait
134-
long_wait = WebDriverWait(selenium_utils_get.driver, 30)
135-
start = time.time()
136-
try:
137-
long_wait.until(EC.text_to_be_present_in_element((By.ID, f"{div_id}_stdout"), "You"))
138-
except:
139-
print(selenium_utils_get.driver.find_element_by_id(f"{div_id}_stdout").text)
140-
print(time.time() - start)
141-
raise
132+
selenium_utils_get.wait.until(EC.text_to_be_present_in_element((By.ID, f"{div_id}_stdout"), "You"))
142133
res = selenium_utils_get.driver.find_element_by_id(f"{div_id}_sql_out")
143134
assert res
144135
out = selenium_utils_get.driver.find_element_by_id(f"{div_id}_stdout")

0 commit comments

Comments
 (0)