Skip to content

Commit

Permalink
Merge pull request #710 from bugsnag/js-perf-patches
Browse files Browse the repository at this point in the history
Add wait for element and click element patches from js-perf into browser driver
  • Loading branch information
Cawllec authored Jan 7, 2025
2 parents 256093b + 5647a24 commit 389592d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Enhancements

- Skip remaining tests after Appium session failure [708](https://github.com/bugsnag/maze-runner/pull/708)
- Add wait_for_element and click_element methods to browser driver [710](https://github.com/bugsnag/maze-runner/pull/710)

# 9.21.0 - 2024/11/28

Expand Down
14 changes: 14 additions & 0 deletions lib/maze/driver/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ def find_element(*args)
@driver.find_element(*args)
end

def wait_for_element(id)
@driver.find_element(id: id)
end

def click_element(id)
element = @driver.find_element(id: id)

if $browser.mobile?
element.click
else
@driver.action.move_to(element).click.perform
end
end

def navigate
@driver.navigate
end
Expand Down

0 comments on commit 389592d

Please sign in to comment.