Skip to content

Commit

Permalink
fix playthrough test
Browse files Browse the repository at this point in the history
  • Loading branch information
evemartin committed Aug 28, 2024
1 parent 9717866 commit c25b25c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions game/end_to_end_tests/base_game_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,11 @@ def complete_and_check_level(
if final_level:
return page
if next_episode is None:
page.next_level(from_python_den)
page.assert_level_number(level_number + 1, from_python_den)
if next_level is None:
page.next_level_redirected(from_python_den)
else:
page.next_level(from_python_den)
page.assert_level_number(level_number + 1, from_python_den)
else:
page.next_episode()
page.assert_episode_number(next_episode, from_python_den)
Expand Down
11 changes: 11 additions & 0 deletions game/end_to_end_tests/game_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,17 @@ def next_level(self, from_python_den=False):
)
return self

def next_level_redirected(self, from_python_den=False):
self.assert_success()
self.browser.find_element(By.ID, "next_level_button").click()

episodeId = "episode-16" if from_python_den else "episode-1"

WebDriverWait(self.browser, 10).until(
presence_of_all_elements_located((By.ID, episodeId))
)
return self

def _run_failing_program(self, text):
self.run_program("try_again_button")
error_message = self.browser.find_element(By.ID, "myModal-lead").text
Expand Down

0 comments on commit c25b25c

Please sign in to comment.