Skip to content

Commit 7024abb

Browse files
committed
Run Firefox tests for Ruby on Windows
1 parent db43c94 commit 7024abb

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

.github/workflows/ci-ruby.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,12 @@ jobs:
9393
firefox-test:
9494
if: ${{ needs.check_workflow.outputs.result == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || contains(toJson(github.event.commits), '[run ruby]') == true }}
9595
needs: check_workflow
96-
runs-on: ubuntu-latest
96+
runs-on: ${{ matrix.os }}
9797
strategy:
9898
fail-fast: false
9999
matrix:
100100
target: [ 'firefox-test', 'remote-firefox-test' ]
101+
os: [ 'ubuntu-latest', 'windows-latest' ]
101102
steps:
102103
- name: Checkout source tree
103104
uses: actions/checkout@v2
@@ -111,16 +112,22 @@ jobs:
111112
workflow: ruby
112113
key: ${{ matrix.target }}
113114
- name: Setup Fluxbox
115+
if: matrix.os == 'ubuntu-latest'
114116
run: sudo apt-get -y install fluxbox
115117
- name: Setup Firefox
116118
uses: abhi1693/setup-browser@v0.3.4
117119
with:
118120
browser: firefox
119121
version: latest
120122
- name: Start XVFB
123+
if: matrix.os == 'ubuntu-latest'
121124
run: Xvfb :99 &
122125
- name: Start Fluxbox
126+
if: matrix.os == 'ubuntu-latest'
123127
run: fluxbox -display :99 &
128+
- name: Set resolution
129+
if: matrix.os == 'windows-latest'
130+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
124131
- name: Run Firefox tests
125132
uses: ./.github/actions/bazel
126133
with:

rb/spec/integration/selenium/webdriver/action_builder_spec.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ module WebDriver
202202
expect(element.attribute(:value)).to eq('Clicked')
203203
end
204204

205-
it 'moves to element with offset' do
205+
it 'moves to element with offset', except: {browser: :firefox,
206+
ci: :github,
207+
platform: :windows,
208+
reason: 'Some issues with resolution?'} do
206209
driver.navigate.to url_for('javascriptPage.html')
207210
origin = driver.find_element(id: 'keyUpArea')
208211
destination = driver.find_element(id: 'clickField')
@@ -317,7 +320,7 @@ module WebDriver
317320

318321
describe '#scroll_by', only: {browser: %i[chrome edge firefox]} do
319322
it 'scrolls by given amount', except: {browser: :firefox,
320-
platform: %i[macosx windows],
323+
platform: :macosx,
321324
reason: 'scrolls insufficient number of pixels'} do
322325
driver.navigate.to url_for('scrolling_tests/frame_with_nested_scrolling_frame_out_of_view.html')
323326
footer = driver.find_element(tag_name: 'footer')

rb/spec/integration/selenium/webdriver/firefox/driver_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ module Firefox
4444
page: {width: 30})).to include(magic_number)
4545
end
4646

47-
it 'should print full page' do
47+
it 'should print full page', except: {ci: :github,
48+
platform: :windows,
49+
reason: 'Some issues with resolution?'} do
4850
viewport_width = driver.execute_script("return window.innerWidth;")
4951
viewport_height = driver.execute_script("return window.innerHeight;")
5052

rb/spec/integration/selenium/webdriver/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
guards = WebDriver::Support::Guards.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')
5353
guards.add_condition(:driver, GlobalTestEnv.driver)
5454
guards.add_condition(:browser, GlobalTestEnv.browser)
55+
guards.add_condition(:ci, WebDriver::Platform.ci)
5556
guards.add_condition(:platform, WebDriver::Platform.os)
5657

5758
results = guards.disposition

rb/spec/integration/selenium/webdriver/takes_screenshot_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def save_screenshot_and_assert(source, path)
9191
expect(height).to be <= viewport_height
9292
end
9393

94-
it 'takes full page screenshot', exclusive: {browser: :firefox} do
94+
it 'takes full page screenshot', exclusive: {browser: :firefox},
95+
except: {
96+
ci: :github,
97+
platform: :windows,
98+
reason: 'Some issues with resolution?'
99+
} do
95100
viewport_width = driver.execute_script("return window.innerWidth;")
96101
viewport_height = driver.execute_script("return window.innerHeight;")
97102

0 commit comments

Comments
 (0)