Skip to content

Commit 78c0f1d

Browse files
authored
Merge branch 'trunk' into patch-1
2 parents 580ac07 + 8945c9e commit 78c0f1d

File tree

19 files changed

+91
-30
lines changed

19 files changed

+91
-30
lines changed

.github/workflows/ruby-examples.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ jobs:
4141
if: matrix.os != 'windows'
4242
run: |
4343
sudo rm -rf $CHROMEWEBDRIVER $EDGEWEBDRIVER $GECKOWEBDRIVER
44-
- name: Start Xvfb
45-
if: matrix.os == 'ubuntu'
46-
run: Xvfb :99 &
44+
- name: Setup Fluxbox and Xvfb
45+
if: inputs.os == 'ubuntu'
46+
run: |
47+
sudo apt-get -y install fluxbox libxss1 libappindicator3-1 libindicator7
48+
Xvfb :99 &
49+
fluxbox -display :99 &
50+
echo "DISPLAY=:99" >> "$GITHUB_ENV"
4751
- name: Set up Ruby
4852
uses: ruby/setup-ruby@v1
4953
with:
50-
ruby-version: 3.0
54+
ruby-version: 3.1
5155
bundler-cache: true
5256
- name: Install Gems Nightly non-Windows
5357
if: matrix.release == 'nightly' && matrix.os != 'windows'
@@ -83,11 +87,26 @@ jobs:
8387
with:
8488
distribution: 'temurin'
8589
java-version: 11
86-
- name: Run tests
90+
- name: Run tests on Windows
91+
if: matrix.os == 'windows'
92+
uses: nick-invision/[email protected]
93+
with:
94+
timeout_minutes: 20
95+
max_attempts: 2
96+
command: |
97+
cd examples/ruby
98+
bundle exec rspec
99+
new_command_on_retry: |
100+
cd examples/ruby; $env:DEBUG="true"; bundle exec rspec --only-failures
101+
- name: Run tests on ${{ matrix.os }}
102+
if: matrix.os != 'windows'
87103
uses: nick-invision/[email protected]
88104
with:
89105
timeout_minutes: 20
90-
max_attempts: 3
106+
max_attempts: 2
91107
command: |
92108
cd examples/ruby
93109
bundle exec rspec
110+
new_command_on_retry: |
111+
cd examples/ruby
112+
DEBUG=true bundle exec rspec --only-failures

examples/ruby/spec/spec_helper.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
# Disable RSpec exposing methods globally on `Module` and `main`
1111
config.disable_monkey_patching!
12+
Dir.mktmpdir('tmp')
13+
config.example_status_persistence_file_path = "tmp/examples.txt"
1214

1315
config.expect_with :rspec do |c|
1416
c.syntax = :expect
@@ -30,6 +32,7 @@
3032
def start_session
3133
options = Selenium::WebDriver::Chrome::Options.new
3234
options.add_argument('disable-search-engine-choice-screen')
35+
options.add_argument('--no-sandbox')
3336
@driver = Selenium::WebDriver.for(:chrome, options: options)
3437
end
3538

website_and_docs/content/documentation/_index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ a browser. You can find a more comprehensive example in [Writing your first Sele
4242
{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}}
4343
{{< /tab >}}
4444
{{< tab header="Ruby" >}}
45-
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium_spec.rb" >}}
45+
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}}
4646
{{< /tab >}}
4747
{{< tab header="JavaScript" >}}
4848
{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}}

website_and_docs/content/documentation/_index.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Seleniumの中核は[WebDriver]({{< ref "webdriver.md" >}})であり、様々な
2929
{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}}
3030
{{< /tab >}}
3131
{{< tab header="Ruby" >}}
32-
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium_spec.rb" >}}
32+
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}}
3333
{{< /tab >}}
3434
{{< tab header="JavaScript" >}}
3535
{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}}

website_and_docs/content/documentation/_index.pt-br.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ navegadores. Aqui está uma das instruções mais simples que você pode fazer:
4040
{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}}
4141
{{< /tab >}}
4242
{{< tab header="Ruby" >}}
43-
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium_spec.rb" >}}
43+
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}}
4444
{{< /tab >}}
4545
{{< tab header="JavaScript" >}}
4646
{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}}

website_and_docs/content/documentation/_index.zh-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Selenium 的核心是 [WebDriver]({{< ref "webdriver.md" >}}),这是一个编
3434
{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}}
3535
{{< /tab >}}
3636
{{< tab header="Ruby" >}}
37-
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium_spec.rb" >}}
37+
{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}}
3838
{{< /tab >}}
3939
{{< tab header="JavaScript" >}}
4040
{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}}

website_and_docs/content/documentation/webdriver/browsers/firefox.en.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,16 @@ options.profile = FirefoxProfile()
135135
driver = FirefoxDriver(options)
136136
{{< /tab >}}
137137
{{< /tabpane >}}
138-
138+
**Note**: Whether you create an empty `FirefoxProfile` or point it to the directory of your own profile, Selenium
139+
will create a temporary directory to store either the data of the new profile or a copy of your existing one. Every
140+
time you run your program, a different temporary directory will be created. These directories are not cleaned up
141+
explicitly by Selenium, they should eventually get removed by the operating system. However, if you want to remove
142+
the copy manually (e.g. if your profile is large in size), the path of the copy is exposed by the `FirefoxProfile`
143+
object. Check the language specific implementation to see how to retrieve that location.
144+
145+
If you want to use an existing Firefox profile, you can pass in the path to that profile. Please refer to the official
146+
[Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
147+
for instructions on how to find the directory of your profile.
139148

140149
## Service
141150

website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,16 @@ driver = RemoteWebDriver(options)
141141
{{< /tabpane >}}
142142
</div>
143143

144+
**Note**: Whether you create an empty `FirefoxProfile` or point it to the directory of your own profile, Selenium
145+
will create a temporary directory to store either the data of the new profile or a copy of your existing one. Every
146+
time you run your program, a different temporary directory will be created. These directories are not cleaned up
147+
explicitly by Selenium, they should eventually get removed by the operating system. However, if you want to remove
148+
the copy manually (e.g. if your profile is large in size), the path of the copy is exposed by the `FirefoxProfile`
149+
object. Check the language specific implementation to see how to retrieve that location.
150+
151+
If you want to use an existing Firefox profile, you can pass in the path to that profile. Please refer to the official
152+
[Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
153+
for instructions on how to find the directory of your profile.
144154

145155
## サービス
146156

website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ driver = RemoteWebDriver(options)
140140
{{< /tabpane >}}
141141
</div>
142142

143+
**Note**: Whether you create an empty `FirefoxProfile` or point it to the directory of your own profile, Selenium
144+
will create a temporary directory to store either the data of the new profile or a copy of your existing one. Every
145+
time you run your program, a different temporary directory will be created. These directories are not cleaned up
146+
explicitly by Selenium, they should eventually get removed by the operating system. However, if you want to remove
147+
the copy manually (e.g. if your profile is large in size), the path of the copy is exposed by the `FirefoxProfile`
148+
object. Check the language specific implementation to see how to retrieve that location.
149+
150+
If you want to use an existing Firefox profile, you can pass in the path to that profile. Please refer to the official
151+
[Firefox documentation](https://support.mozilla.org/en-US/kb/profiles-where-firefox-stores-user-data#w_how-do-i-find-my-profile)
152+
for instructions on how to find the directory of your profile.
143153

144154
## Service
145155

0 commit comments

Comments
 (0)