From ff301c5715de6e6737789f3351bacb530424e139 Mon Sep 17 00:00:00 2001 From: Michael Nikitochkin Date: Wed, 12 Jun 2024 16:39:36 +0200 Subject: [PATCH 1/4] Firefox: Allow to specify the custom location to Firefox binary (#45) --- src/selenium/firefox/capabilities.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/selenium/firefox/capabilities.cr b/src/selenium/firefox/capabilities.cr index e84f6b1..0ecc729 100644 --- a/src/selenium/firefox/capabilities.cr +++ b/src/selenium/firefox/capabilities.cr @@ -11,5 +11,6 @@ class Selenium::Firefox::Capabilities < Selenium::Capabilities end property args = [] of String + property binary String? end end From 90ce874d2ad962c72a7ac5cffa00bea189575e9e Mon Sep 17 00:00:00 2001 From: Jeremy Woertink Date: Wed, 12 Jun 2024 07:42:50 -0700 Subject: [PATCH 2/4] Update README.md (#51) Fixing some links. Fixes #49 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b16d80..9249a62 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ Selenium client for interacting with web pages for browser automation. -[API Documentation](https://matthewmcgarvey.github.io/selenium.cr/) +[API Documentation](https://crystal-loot.github.io/selenium.cr/) ## Installation @@ -11,7 +11,7 @@ Selenium client for interacting with web pages for browser automation. ```yaml dependencies: selenium: - github: matthewmcgarvey/selenium.cr + github: crystal-loot/selenium.cr ``` 2. Run `shards install` @@ -46,7 +46,7 @@ driver = Selenium::Driver.for(:chrome, service: service) ``` You must call `driver.stop` when you are finished or it will leave the service running. -Consider using [webdrivers.cr](https://github.com/matthewmcgarvey/webdrivers.cr) for automatically installing drivers and managing the driver path for you. +Consider using [webdrivers.cr](https://github.com/crystal-loot/webdrivers.cr) for automatically installing drivers and managing the driver path for you. ### Creating a Session @@ -116,7 +116,7 @@ Running just `crystal spec` will use chrome. ## Contributing -1. Fork it () +1. Fork it () 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) From ce06098ab8f39ff8810f521e355307f652f483b9 Mon Sep 17 00:00:00 2001 From: Jeremy Woertink Date: Wed, 12 Jun 2024 08:40:38 -0700 Subject: [PATCH 3/4] oops... missed this syntax error (#54) --- src/selenium/firefox/capabilities.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selenium/firefox/capabilities.cr b/src/selenium/firefox/capabilities.cr index 0ecc729..47137f4 100644 --- a/src/selenium/firefox/capabilities.cr +++ b/src/selenium/firefox/capabilities.cr @@ -11,6 +11,6 @@ class Selenium::Firefox::Capabilities < Selenium::Capabilities end property args = [] of String - property binary String? + property binary : String? end end From 94bc783189854699053a4e1bccbb6789cf57eb33 Mon Sep 17 00:00:00 2001 From: Jeremy Woertink Date: Wed, 12 Jun 2024 08:47:57 -0700 Subject: [PATCH 4/4] Lock to Ameba 1.5 since 1.6 has some issues. Adding periodic CI job to check against Crystal nightly. Fixes #50 (#53) --- .github/workflows/docs.yml | 9 +++--- .github/workflows/specs.yml | 11 ++++---- .github/workflows/weekly.yml | 54 ++++++++++++++++++++++++++++++++++++ shard.yml | 2 +- 4 files changed, 65 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index aa501f6..c978bcd 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,18 +7,19 @@ on: jobs: deploy: runs-on: ubuntu-latest - container: - image: crystallang/crystal steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: persist-credentials: false + - uses: crystal-lang/install-crystal@v1 + with: + crystal: latest - name: "Install shards" run: shards install - name: "Generate docs" run: crystal docs - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs diff --git a/.github/workflows/specs.yml b/.github/workflows/specs.yml index f1e090f..ee83378 100644 --- a/.github/workflows/specs.yml +++ b/.github/workflows/specs.yml @@ -14,18 +14,17 @@ jobs: continue-on-error: false steps: - name: Download source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Crystal uses: crystal-lang/install-crystal@v1 + with: + crystal: latest - name: Install shards run: shards install - name: Format run: crystal tool format --check - name: Crystal Ameba Linter - id: crystal-ameba - uses: crystal-ameba/github-action@v0.7.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: ./bin/ameba verify-chrome: strategy: fail-fast: false @@ -40,7 +39,7 @@ jobs: runs-on: ${{ matrix.os }} continue-on-error: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: crystal-lang/install-crystal@v1 with: crystal: ${{ matrix.crystal_version }} diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 0000000..b209ce6 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,54 @@ +name: Selenium Weekly CI + +on: + schedule: + - cron: "0 1 * * MON" + workflow_dispatch: + +jobs: + check_format: + strategy: + fail-fast: false + runs-on: ubuntu-latest + continue-on-error: false + steps: + - name: Download source + uses: actions/checkout@v4 + - name: Install Crystal + uses: crystal-lang/install-crystal@v1 + with: + crystal: latest + - name: Install shards + run: shards install + - name: Format + run: crystal tool format --check + - name: Crystal Ameba Linter + run: ./bin/ameba + verify-chrome: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + crystal: nightly + - os: windows-latest + crystal: nightly + - os: macos-latest + crystal: nightly + runs-on: ${{ matrix.os }} + continue-on-error: false + steps: + - uses: actions/checkout@v4 + - uses: crystal-lang/install-crystal@v1 + with: + crystal: ${{ matrix.crystal_version }} + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + if: matrix.os == 'windows-latest' + - name: Install dependencies + run: shards install --ignore-crystal-version --skip-executables --skip-postinstall + - name: Run tests + run: crystal spec --tag "~chrome" + env: + SELENIUM_BROWSER: chrome diff --git a/shard.yml b/shard.yml index 9d070ac..b868644 100644 --- a/shard.yml +++ b/shard.yml @@ -10,4 +10,4 @@ development_dependencies: version: ~> 0.4 ameba: github: crystal-ameba/ameba - version: ~> 1.5 + version: ~> 1.5.0