so_many_devices 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2083f8748f8786c8ec499d5f9a67b6d97d5fc5080c3c7bfb82ee2217bb9ae515
4
- data.tar.gz: '09eb90cbaac0a1ae8d4f2c4dac0dc5e96306bd03bea6d2f6dd8b24fc0b475f7f'
3
+ metadata.gz: 15b6efb219438698be4a46e590cce66fdb663a413edd09d9cb2a1ce2e7a7ef63
4
+ data.tar.gz: 97ac505a5cd73539560f53732abc61c262c2a025983c54470cd97a86a0768e16
5
5
  SHA512:
6
- metadata.gz: ef4f46954c438c4be338b370918fed154e2f9dde3d51e765d40ec5ed489c63c827af69f3eb3c432f003deb028dcd58b117ba57fc7d9754599d10e2dbc3e4622b
7
- data.tar.gz: 2b2509f8b113fea58f28010997f90f58d7d73f365e49b45db826a3dc0a80e5261b04fd1ee5729410cf0c9532ee9ae4d3ab4f04f1e7af80a57e999b7e53950e23
6
+ metadata.gz: 0d67c72914f145926dda6f5478fe91cb5460cd2bbe669dea37f6e9ab8c134f5aa65826de3ce2ea0acd3db4abc67787a29d8e34c354a5fb5002fc4b27237cf157
7
+ data.tar.gz: de20ca536bfa8216233c04c64c798ce27e9dd8ee52768ca3d196cf87f41089b865404932f361e36b00d12e5a86225712759c89ef21ed110d525215da100263ba
data/CHANGELOG.md CHANGED
@@ -1,4 +1,14 @@
1
- ## [0.3.0] - 2023-01-25
1
+ # Changelog
2
+
3
+ ## [2.0.0] - 2026-11-06
4
+
5
+ - **Breaking**: require Ruby 3.3 or newer.
6
+ - **Breaking**: all drivers run Chrome with `--force-prefers-reduced-motion`.
7
+ - Fix device drivers on Selenium 4, which no longer provides `Remote::Capabilities.chrome` and `desired_capabilities:`.
8
+ - Register the Chrome drivers with downloads only once, instead of once per device.
9
+ - Release from Semaphore when a version tag is pushed.
10
+
11
+ ## [1.0.0] - 2023-01-25
2
12
 
3
13
  - Added two new methods `first_download` and `last_download`.
4
14
  - Added more instructions to the README for Chrome with downloads options, in particular to clean up folders.
data/README.md CHANGED
@@ -43,6 +43,9 @@ config.before(:each, type: :system, js: true) do
43
43
  end
44
44
  ```
45
45
 
46
+ All drivers run Chrome with `--force-prefers-reduced-motion`, so pages honouring `prefers-reduced-motion`
47
+ skip their animations and transitions, which makes tests faster and less flaky.
48
+
46
49
  We use it to run our system tests on so many devices! Here is our standard configuration:
47
50
 
48
51
  ```ruby
@@ -122,12 +125,24 @@ All downloads are performed in the `tmp/downloads` folder of your project.
122
125
 
123
126
  ## Development
124
127
 
125
- After checking out the repo, run `bin/setup` to install dependencies.
126
- Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
128
+ After checking out the repo, run `bin/setup` to install dependencies.
129
+ Then, run `bin/check` to run the tests and `bin/fastcheck` to run the linter.
130
+ You can also run `bin/console` for an interactive prompt that will allow you to experiment.
131
+
132
+ ### Release
133
+
134
+ 1. Bump the version in `lib/so_many_devices/version.rb`, run `bundle install`, update `CHANGELOG.md` and commit to `main`.
135
+ 2. Tag the commit with the bare version and push the tag:
136
+
137
+ ```bash
138
+ git tag -a 1.2.3 -m 1.2.3
139
+ git push origin 1.2.3
140
+ ```
141
+
142
+ 3. Create a GitHub release for the tag with the changelog section as notes.
127
143
 
128
- To install this gem onto your local machine, run `bundle exec rake install`.
129
- To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
130
- which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
144
+ Semaphore runs the tests on the tag and, when they pass, promotes the `release` pipeline, which pushes the gem to
145
+ [rubygems.org](https://rubygems.org). It fails when the tag does not match the gem version.
131
146
 
132
147
  ## Contributing
133
148
 
@@ -1,3 +1,3 @@
1
1
  module SoManyDevices
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -6,29 +6,27 @@ require "capybara"
6
6
  module SoManyDevices
7
7
  class Error < StandardError; end
8
8
 
9
- devices = YAML.load_file(File.join(__dir__, "so_many_devices.yml"))
9
+ standard_args = ["--disable-site-isolation-trials", "--force-prefers-reduced-motion"]
10
+ headless_args = ["--headless", *standard_args]
11
+ headless_args << "--disable-gpu" if Gem.win_platform?
10
12
 
11
- devices.each do |device_name, options|
12
- standard_args = ["--disable-site-isolation-trials"]
13
- headless_args = ["--headless", "--disable-site-isolation-trials"]
14
- headless_args << "--disable-gpu" if Gem.win_platform?
13
+ devices = YAML.load_file(File.join(__dir__, "so_many_devices.yml"))
15
14
 
16
- [[device_name, standard_args], ["#{device_name}_headless", headless_args]].each do |device_name, args|
17
- Capybara.register_driver device_name.to_sym do |app|
18
- capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
19
- "goog:chromeOptions" => {args: args, mobileEmulation: options}
20
- )
21
- Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
15
+ devices.each do |device_name, emulation|
16
+ [[device_name, standard_args], ["#{device_name}_headless", headless_args]].each do |driver_name, args|
17
+ Capybara.register_driver driver_name.to_sym do |app|
18
+ browser_options = ::Selenium::WebDriver::Chrome::Options.new(args: args, emulation: emulation)
19
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
22
20
  end
23
21
  end
22
+ end
24
23
 
25
- [[:selenium_chrome_with_download, standard_args], [:selenium_chrome_with_download_headless, headless_args]].each do |device_name, args|
26
- Capybara.register_driver device_name do |app|
27
- browser_options = ::Selenium::WebDriver::Chrome::Options.new(args: args)
28
- browser_options.add_preference(:download, prompt_for_download: false, default_directory: SoManyDevices::DownloadsHelper::PATH.to_s)
29
- browser_options.add_preference(:browser, set_download_behavior: {behavior: "allow"})
30
- Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
31
- end
24
+ [[:selenium_chrome_with_download, standard_args], [:selenium_chrome_with_download_headless, headless_args]].each do |driver_name, args|
25
+ Capybara.register_driver driver_name do |app|
26
+ browser_options = ::Selenium::WebDriver::Chrome::Options.new(args: args)
27
+ browser_options.add_preference(:download, prompt_for_download: false, default_directory: SoManyDevices::DownloadsHelper::PATH.to_s)
28
+ browser_options.add_preference(:browser, set_download_behavior: {behavior: "allow"})
29
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
32
30
  end
33
31
  end
34
32
  end
@@ -10,21 +10,18 @@ Gem::Specification.new do |spec|
10
10
  spec.description = "This incomplete but very satisfying list of devices, will help you run your app on so many devices!"
11
11
  spec.homepage = "https://github.com/renuo/so_many_devices"
12
12
  spec.license = "MIT"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
13
+ spec.required_ruby_version = ">= 3.3.0"
14
14
 
15
- spec.metadata["homepage_uri"] = spec.homepage
16
- spec.metadata["source_code_uri"] = "https://github.com/renuo/so_many_devices"
17
- spec.metadata["changelog_uri"] = "https://github.com/renuo/so_many_devices/blob/main/CHANGELOG.md"
15
+ spec.metadata["source_code_uri"] = spec.homepage
16
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
18
17
 
19
- # Specify which files should be added to the gem when it is released.
20
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
- spec.files = Dir.chdir(File.expand_path("..", __FILE__)) do
22
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.files = Dir.chdir(__dir__) do
19
+ `git ls-files -z`.split("\x0").reject do |f|
20
+ (File.expand_path(f) == __FILE__) ||
21
+ f.start_with?(*%w[bin/ spec/ logo/ .git .github .semaphore .rspec .ruby-version Gemfile])
22
+ end
23
23
  end
24
- spec.bindir = "exe"
25
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
24
  spec.require_paths = ["lib"]
27
25
 
28
26
  spec.add_dependency "capybara", ">= 3.0"
29
- spec.add_development_dependency "standard"
30
27
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: so_many_devices
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Rodi
8
- autorequire:
9
- bindir: exe
8
+ bindir: bin
10
9
  cert_chain: []
11
- date: 2023-01-25 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: capybara
@@ -24,20 +23,6 @@ dependencies:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
25
  version: '3.0'
27
- - !ruby/object:Gem::Dependency
28
- name: standard
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
26
  description: This incomplete but very satisfying list of devices, will help you run
42
27
  your app on so many devices!
43
28
  email:
@@ -46,33 +31,22 @@ executables: []
46
31
  extensions: []
47
32
  extra_rdoc_files: []
48
33
  files:
49
- - ".gitignore"
50
- - ".rspec"
51
- - ".semaphore/main-deploy.yml"
52
- - ".semaphore/semaphore.yml"
53
- - ".travis.yml"
54
34
  - CHANGELOG.md
55
35
  - CODE_OF_CONDUCT.md
56
- - Gemfile
57
36
  - LICENSE.txt
58
37
  - README.md
59
38
  - Rakefile
60
- - bin/console
61
- - bin/setup
62
39
  - lib/so_many_devices.rb
63
40
  - lib/so_many_devices.yml
64
41
  - lib/so_many_devices/downloads_helper.rb
65
42
  - lib/so_many_devices/version.rb
66
- - logo/renuo.png
67
43
  - so_many_devices.gemspec
68
44
  homepage: https://github.com/renuo/so_many_devices
69
45
  licenses:
70
46
  - MIT
71
47
  metadata:
72
- homepage_uri: https://github.com/renuo/so_many_devices
73
48
  source_code_uri: https://github.com/renuo/so_many_devices
74
49
  changelog_uri: https://github.com/renuo/so_many_devices/blob/main/CHANGELOG.md
75
- post_install_message:
76
50
  rdoc_options: []
77
51
  require_paths:
78
52
  - lib
@@ -80,15 +54,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
80
54
  requirements:
81
55
  - - ">="
82
56
  - !ruby/object:Gem::Version
83
- version: 2.3.0
57
+ version: 3.3.0
84
58
  required_rubygems_version: !ruby/object:Gem::Requirement
85
59
  requirements:
86
60
  - - ">="
87
61
  - !ruby/object:Gem::Version
88
62
  version: '0'
89
63
  requirements: []
90
- rubygems_version: 3.3.10
91
- signing_key:
64
+ rubygems_version: 4.0.23
92
65
  specification_version: 4
93
66
  summary: A list of configurations for so many devices!
94
67
  test_files: []
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /pkg/
7
- /spec/reports/
8
- /tmp/
9
-
10
- # rspec failure tracking
11
- .rspec_status
12
- Gemfile.lock
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,19 +0,0 @@
1
- version: v1.0
2
- name: main-deploy
3
- agent:
4
- machine:
5
- type: e1-standard-2
6
- os_image: ubuntu1804
7
-
8
- blocks:
9
- - name: main-deploy
10
- task:
11
- secrets:
12
- - name: rubygems-deploy
13
- jobs:
14
- - name: main-deploy
15
- commands:
16
- - checkout --use-cache
17
- - gem build so_many_devices
18
- - chmod 0600 ~/.gem/credentials
19
- - gem push so_many_devices-*.gem
@@ -1,31 +0,0 @@
1
- version: "v1.0"
2
- name: so_many_devices
3
- agent:
4
- machine:
5
- type: e1-standard-2
6
- os_image: ubuntu1804
7
- auto_cancel:
8
- running:
9
- when: "true"
10
-
11
- blocks:
12
- - name: tests
13
- execution_time_limit:
14
- minutes: 10
15
- dependencies: []
16
- task:
17
- env_vars:
18
- - name: RAILS_ENV
19
- value: test
20
- jobs:
21
- - name: tests
22
- commands:
23
- - checkout --use-cache
24
- - cache restore
25
- - bundle install -j 4 --path vendor/bundle
26
- - cache store
27
- - bundle exec standardrb
28
- - bundle exec rspec
29
- promotions:
30
- - name: main
31
- pipeline_file: main-deploy.yml
data/.travis.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- language: ruby
3
- cache: bundler
4
- rvm:
5
- - 2.6.1
6
- before_install: gem install bundler -v 2.1.4
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- # Specify your gem's dependencies in so_many_devices.gemspec
4
- gemspec
5
-
6
- gem "rake", "~> 12.0"
7
- gem "rspec", "~> 3.0"
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "so_many_devices"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here
data/logo/renuo.png DELETED
Binary file