Skip to content

Commit

Permalink
reverted previous change and implemented more explicit usage of webdr…
Browse files Browse the repository at this point in the history
…iverwaitt
  • Loading branch information
root authored and root committed Feb 20, 2024
1 parent ac5217d commit b34f273
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions semesterly/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def assert_invisibility(self, locator, root=None):
print("Process done!")
except TimeoutException:
raise RuntimeError(
'Failed to assert invisibility of element "%s" by %s due to TimeoutException' % locator[::-1]
'Failed to assert invisibility of element "%s" by %s due to TimeoutException'
% locator[::-1]
)

def clear_tutorial(self):
Expand Down Expand Up @@ -546,7 +547,14 @@ def add_course_from_course_modal(self, n_slots, n_master_slots):
course = Course.objects.get(code=url_match.group(1))
self.find((By.CLASS_NAME, "fa-plus"), root=modal_header).click()
self.assert_loader_completes()
time.sleep(3)

try:
WebDriverWait(self.driver, self.TIMEOUT).until_not(
EC.presence_of_element_located((By.CLASS_NAME, "course-modal"))
)
except TimeoutException:
print("FAILED BEFORE ASSERT_INVISIBILITY")

self.assert_invisibility((By.CLASS_NAME, "course-modal"))
self.assert_slot_presence(n_slots, n_master_slots)
return course
Expand Down
2 changes: 1 addition & 1 deletion semesterly/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def common_logged_in_tests(self):
self.search_course("AS.110.106", 1)
self.open_course_modal_from_search(0)
course2 = self.add_course_from_course_modal(n_slots=8, n_master_slots=2)
self.search_course("EN.553.171", 1)
self.search_course("AS.110.415", 1)
self.open_course_modal_from_search(0)
self.add_course_from_course_modal(n_slots=11, n_master_slots=3)
self.open_course_modal_from_slot(2)
Expand Down

0 comments on commit b34f273

Please sign in to comment.