Skip to content

Commit

Permalink
[rb] fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed May 25, 2022
1 parent fa5be62 commit 37be1da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion common/src/web/pointerActionsPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"button: " + event.button + ", " +
"pageX: " + event.pageX + ", " +
"pageY: " + event.pageY + ", " +
"button: " + event.button + ", " +
"buttons: " + event.buttons + ", " +
"ctrlKey: " + event.ctrlKey + ", " +
"altKey: " + event.altKey + ", " +
Expand Down
7 changes: 5 additions & 2 deletions rb/spec/integration/selenium/webdriver/action_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module WebDriver
driver.action.release_actions
expect(event_input.attribute(:value)).to eq('Clicked')
end
end
end

describe '#click' do
it 'clicks provided element' do
Expand Down Expand Up @@ -323,6 +323,7 @@ module WebDriver
delta_y = footer.rect.y

driver.action.scroll_by(0, delta_y).perform
sleep 0.2

expect(in_viewport?(footer)).to eq true
end
Expand All @@ -337,6 +338,7 @@ module WebDriver
driver.action.scroll_from(scroll_origin, 0, 200).perform

driver.switch_to.frame(iframe)
sleep 0.2
checkbox = driver.find_element(name: 'scroll_checkbox')
expect(in_viewport?(checkbox)).to eq true
end
Expand All @@ -347,6 +349,7 @@ module WebDriver
scroll_origin = WheelActions::ScrollOrigin.element(footer, 0, -50)

driver.action.scroll_from(scroll_origin, 0, 200).perform
sleep 0.2

iframe = driver.find_element(tag_name: 'iframe')
driver.switch_to.frame(iframe)
Expand Down Expand Up @@ -387,7 +390,7 @@ module WebDriver
end

def properties(element)
element.text.sub(/.*?\s/, '').split(',').map { |item| item.lstrip.split /\s*:\s*/ }.to_h
element.text.sub(/.*?\s/, '').split(',').to_h { |item| item.lstrip.split(/\s*:\s*/) }
end

def in_viewport?(element)
Expand Down
2 changes: 1 addition & 1 deletion rb/spec/integration/selenium/webdriver/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module WebDriver

it 'any element in form' do
driver.navigate.to url_for('formPage.html')
driver.find_element(id: 'form > p').submit
driver.find_element(css: 'form > p').submit

expect(driver.title).to eq('We Arrive Here')
end
Expand Down

0 comments on commit 37be1da

Please sign in to comment.