Skip to content

Commit

Permalink
webui: make installer.reach method more robust
Browse files Browse the repository at this point in the history
So that is is able to handle the case where it starts from the page
whose next page has also some other possible previous page.
  • Loading branch information
rvykydal committed Oct 18, 2023
1 parent 80ab6b7 commit e98f6c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/webui/test/helpers/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def begin_installation(self, should_fail=False, confirm_erase=True):

def reach(self, target_page):
path = []
page = target_page
prev_pages = [target_page]
current_page = self.get_current_page()

while current_page != page:
while current_page not in prev_pages:
page = prev_pages[0]
path.append(page)
prev = [k for k, v in self.steps._steps_jump.items() if page in v][0]
page = prev
prev_pages = [k for k, v in self.steps._steps_jump.items() if page in v]

while self.get_current_page() != target_page:
next_page = path.pop()
Expand Down

0 comments on commit e98f6c0

Please sign in to comment.