Skip to content

Commit 8aeb1e1

Browse files
authored
Run fluxbox as window manager for jobs using Xvfb (#11025)
Use Fluxbox as window manager for browser tests using Xvfb
1 parent ff37292 commit 8aeb1e1

File tree

9 files changed

+44
-21
lines changed

9 files changed

+44
-21
lines changed

.github/workflows/ci-java.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ jobs:
171171
${{ runner.os }}-bazel-build-
172172
- name: Setup bazelisk
173173
uses: ./.github/actions/setup-bazelisk
174+
- name: Setup Fluxbox
175+
run: sudo apt-get -y install fluxbox
174176
- name: Setup Java
175177
uses: actions/setup-java@v1
176178
with:
@@ -189,6 +191,8 @@ jobs:
189191
matrix.browser == 'chrome'
190192
- name: Start XVFB
191193
run: Xvfb :99 &
194+
- name: Start Fluxbox
195+
run: fluxbox -display :99 &
192196
- name: Run browser tests in ${{ matrix.browser }}
193197
uses: ./.github/actions/bazel-test
194198
with:
@@ -225,6 +229,8 @@ jobs:
225229
${{ runner.os }}-bazel-build-
226230
- name: Setup bazelisk
227231
uses: ./.github/actions/setup-bazelisk
232+
- name: Setup Fluxbox
233+
run: sudo apt-get -y install fluxbox
228234
- name: Setup Java
229235
uses: actions/setup-java@v1
230236
with:
@@ -243,6 +249,8 @@ jobs:
243249
matrix.browser == 'chrome'
244250
- name: Start XVFB
245251
run: Xvfb :99 &
252+
- name: Start Fluxbox
253+
run: fluxbox -display :99 &
246254
- name: Run server tests
247255
uses: ./.github/actions/bazel-test
248256
with:
@@ -270,6 +278,8 @@ jobs:
270278
${{ runner.os }}-bazel-build-
271279
- name: Setup bazelisk
272280
uses: ./.github/actions/setup-bazelisk
281+
- name: Setup Fluxbox
282+
run: sudo apt-get -y install fluxbox
273283
- name: Setup Java
274284
uses: actions/setup-java@v1
275285
with:
@@ -280,6 +290,8 @@ jobs:
280290
version: latest
281291
- name: Start XVFB
282292
run: Xvfb :99 &
293+
- name: Start Fluxbox
294+
run: fluxbox -display :99 &
283295
- name: Run browser tests in Firefox
284296
uses: ./.github/actions/bazel-test
285297
with:

.github/workflows/ci-javascript.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
java-version: 11
5454
- name: Setup bazelisk
5555
uses: ./.github/actions/setup-bazelisk
56+
- name: Setup Fluxbox
57+
run: sudo apt-get -y install fluxbox
5658
- name: Setup Firefox and GeckoDriver
5759
uses: ./.github/actions/setup-firefox
5860
with:
@@ -98,12 +100,16 @@ jobs:
98100
java-version: 11
99101
- name: Setup bazelisk
100102
uses: ./.github/actions/setup-bazelisk
103+
- name: Setup Fluxbox
104+
run: sudo apt-get -y install fluxbox
101105
- name: Setup Firefox and GeckoDriver
102106
uses: ./.github/actions/setup-firefox
103107
with:
104108
version: ${{ matrix.version }}
105109
- name: Start XVFB
106110
run: Xvfb :99 &
111+
- name: Start Fluxbox
112+
run: fluxbox -display :99 &
107113
- name: Run atom tests on Firefox
108114
uses: ./.github/actions/bazel
109115
with:

.github/workflows/ci-python.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ jobs:
132132
${{ runner.os }}-bazel-python-unit-tests-
133133
- name: Setup bazelisk
134134
uses: ./.github/actions/setup-bazelisk
135+
- name: Setup Fluxbox
136+
run: sudo apt-get -y install fluxbox
135137
- name: Set up Python 3.7
136138
uses: actions/setup-python@v2
137139
with:
@@ -144,6 +146,8 @@ jobs:
144146
uses: ./.github/actions/setup-chrome
145147
- name: Start XVFB
146148
run: Xvfb :99 &
149+
- name: Start Fluxbox
150+
run: fluxbox -display :99 &
147151
- name: Run browser tests in Chrome
148152
uses: ./.github/actions/bazel-test
149153
with:
@@ -171,6 +175,8 @@ jobs:
171175
${{ runner.os }}-bazel-python-unit-tests-
172176
- name: Setup bazelisk
173177
uses: ./.github/actions/setup-bazelisk
178+
- name: Setup Fluxbox
179+
run: sudo apt-get -y install fluxbox
174180
- name: Set up Python 3.7
175181
uses: actions/setup-python@v2
176182
with:
@@ -183,6 +189,8 @@ jobs:
183189
uses: ./.github/actions/setup-firefox
184190
- name: Start XVFB
185191
run: Xvfb :99 &
192+
- name: Start Fluxbox
193+
run: fluxbox -display :99 &
186194
- name: Run browser tests in Firefox (Remote)
187195
uses: ./.github/actions/bazel
188196
with:
@@ -209,6 +217,8 @@ jobs:
209217
${{ runner.os }}-bazel-python-unit-tests-
210218
- name: Setup bazelisk
211219
uses: ./.github/actions/setup-bazelisk
220+
- name: Setup Fluxbox
221+
run: sudo apt-get -y install fluxbox
212222
- name: Set up Python 3.7
213223
uses: actions/setup-python@v2
214224
with:
@@ -219,8 +229,10 @@ jobs:
219229
java-version: '11'
220230
- name: Setup Firefox and GeckoDriver
221231
uses: ./.github/actions/setup-firefox
222-
- name: Start XVFB
232+
- name: Start Xvfb
223233
run: Xvfb :99 &
234+
- name: Start Fluxbox
235+
run: fluxbox -display :99 &
224236
- name: Run browser tests in Firefox
225237
uses: ./.github/actions/bazel-test
226238
with:

.github/workflows/ci-ruby.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ jobs:
7474
restore-keys: |
7575
${{ runner.os }}-bazel-ruby-${{ matrix.target }}-
7676
- uses: ./.github/actions/setup-bazelisk
77+
- name: Setup Fluxbox
78+
run: sudo apt-get -y install fluxbox
7779
- uses: ./.github/actions/setup-chrome
7880
- run: Xvfb :99 &
81+
- name: Start Fluxbox
82+
run: fluxbox -display :99 &
7983
- uses: ./.github/actions/bazel
8084
with:
8185
command: test --test_output=all //rb:${{ matrix.target }}
@@ -107,9 +111,13 @@ jobs:
107111
restore-keys: |
108112
${{ runner.os }}-bazel-ruby-${{ matrix.target }}-
109113
- uses: ./.github/actions/setup-bazelisk
114+
- name: Setup Fluxbox
115+
run: sudo apt-get -y install fluxbox
110116
- name: Setup Firefox and GeckoDriver
111117
uses: ./.github/actions/setup-firefox
112118
- run: Xvfb :99 &
119+
- name: Start Fluxbox
120+
run: fluxbox -display :99 &
113121
- uses: ./.github/actions/bazel
114122
with:
115123
command: test --test_output=all //rb:${{ matrix.target }}

java/test/org/openqa/selenium/WindowTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public void testGetsThePositionOfTheCurrentWindow() {
9191
}
9292

9393
@Test
94-
@Ignore(value = FIREFOX, gitHubActions = true, issue = "https://github.com/mozilla/geckodriver/issues/2042")
9594
public void testSetsThePositionOfTheCurrentWindow() {
9695
// Browser window cannot be resized or moved on ANDROID (and most mobile platforms
9796
// though others aren't defined in org.openqa.selenium.Platform).

py/test/selenium/webdriver/common/api_example_tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ def test_is_element_displayed(driver, pages):
240240

241241

242242
@pytest.mark.xfail_chrome
243-
@pytest.mark.xfail_firefox(reason='https://github.com/mozilla/geckodriver/issues/2042')
244-
@pytest.mark.xfail_remote(reason='https://github.com/mozilla/geckodriver/issues/2042')
245243
def test_move_window_position(driver, pages):
246244
pages.load("blank.html")
247245
loc = driver.get_window_position()

py/test/selenium/webdriver/common/window_tests.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ def test_should_get_the_position_of_the_current_window(driver):
6565
assert position.get('y') >= 0
6666

6767

68-
@pytest.mark.xfail_firefox(reason='https://github.com/mozilla/geckodriver/issues/2042')
69-
@pytest.mark.xfail_remote(reason='https://github.com/mozilla/geckodriver/issues/2042')
7068
def test_should_set_the_position_of_the_current_window(driver):
7169
position = driver.get_window_position()
7270

@@ -93,8 +91,6 @@ def test_should_get_the_rect_of_the_current_window(driver):
9391
assert rect.get('height') >= 0
9492

9593

96-
@pytest.mark.xfail_firefox(reason='https://github.com/mozilla/geckodriver/issues/2042')
97-
@pytest.mark.xfail_remote(reason='https://github.com/mozilla/geckodriver/issues/2042')
9894
@pytest.mark.xfail_safari(raises=WebDriverException,
9995
reason='Get Window Rect command not implemented')
10096
def test_should_set_the_rect_of_the_current_window(driver):

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@
5353
guards.add_condition(:driver, GlobalTestEnv.driver)
5454
guards.add_condition(:browser, GlobalTestEnv.browser)
5555
guards.add_condition(:platform, WebDriver::Platform.os)
56-
window_manager = !WebDriver::Platform.linux? || !ENV['DESKTOP_SESSION'].nil?
57-
guards.add_condition(:window_manager, window_manager)
5856

5957
results = guards.disposition
6058
send(*results) if results

rb/spec/integration/selenium/webdriver/window_spec.rb

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ module WebDriver
6060
expect(pos.y).to be >= 0
6161
end
6262

63-
it 'sets the position of the current window',
64-
except: {browser: :firefox,
65-
window_manager: false,
66-
reason: 'https://github.com/mozilla/geckodriver/issues/2042'} do
63+
it 'sets the position of the current window' do
6764
pos = window.position
6865

6966
target_x = pos.x + 10
@@ -89,10 +86,7 @@ module WebDriver
8986
expect(rect.height).to be >= 0
9087
end
9188

92-
it 'sets the rect of the current window',
93-
except: {browser: :firefox,
94-
window_manager: false,
95-
reason: 'https://github.com/mozilla/geckodriver/issues/2042'} do
89+
it 'sets the rect of the current window' do
9690
rect = window.rect
9791

9892
target_x = rect.x + 10
@@ -111,7 +105,7 @@ module WebDriver
111105
expect(new_rect.height).to eq(target_height)
112106
end
113107

114-
it 'can maximize the current window', except: {window_manager: false, browser: %i[ie firefox safari]} do
108+
it 'can maximize the current window' do
115109
window.size = old_size = Dimension.new(700, 700)
116110

117111
window.maximize
@@ -122,7 +116,7 @@ module WebDriver
122116
expect(new_size.height).to be > old_size.height
123117
end
124118

125-
it 'can make window full screen', except: {window_manager: false, browser: :firefox} do
119+
it 'can make window full screen' do
126120
window.size = old_size = Dimension.new(700, 700)
127121

128122
window.full_screen
@@ -133,7 +127,7 @@ module WebDriver
133127
expect(new_size.height).to be > old_size.height
134128
end
135129

136-
it 'can minimize the window', only: {window_manager: true} do
130+
it 'can minimize the window' do
137131
window.minimize
138132
expect(driver.execute_script('return document.hidden;')).to be true
139133
end

0 commit comments

Comments
 (0)