so_many_devices 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +6 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +94 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/so_many_devices.rb +23 -0
- data/lib/so_many_devices.yml +30 -0
- data/lib/so_many_devices/version.rb +3 -0
- data/logo/renuo.png +0 -0
- data/so_many_devices.gemspec +27 -0
- metadata +62 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a4563bbece97b6bd3ec50f380fc87a52098e4fc70b80bfe6c894e3e3fe1d7d22
|
4
|
+
data.tar.gz: ffcfe67293875045e902364d374786ee67bdcaa1b00125dbb52146785bfdfca3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d3ab569ad319c3ed04f50d614041bc40500e7116145be28df9ad49565c28fd3a34bafc6d3f88f09e12a26d1f7a44656279863bd757f7f44480d04c49a81de2d
|
7
|
+
data.tar.gz: e77cb90c14a71bcf687ed62895601ce862daeaac9b17f236973b0f69c08c989a7d268d979fc5de25fe9e41c49ae76d9b759a6f50e58c3290afa556918cc1ec45
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at alessandro.rodi@renuo.ch. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Alessandro Rodi
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# So Many Devices! 🕺
|
2
|
+
|
3
|
+
This gem provides a list of Capybara Selenium configurations that you can use.
|
4
|
+
Probably useful to run your system tests on different devices.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
Here is how you can use it in RSpec but you can, of course, use it wherever you want:
|
9
|
+
|
10
|
+
Add this line to your application's Gemfile, in group tests:
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
group :test do
|
14
|
+
gem 'so_many_devices'
|
15
|
+
end
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle install
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install so_many_devices
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
In your `rails_helper.rb` you can configure your preferred device for tests:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
config.before(:each, type: :system, js: true) do
|
32
|
+
driven_by :iphone_6_7_8
|
33
|
+
end
|
34
|
+
```
|
35
|
+
|
36
|
+
You can always use the headless version of each device by appending `_headless` to the device name.
|
37
|
+
|
38
|
+
```ruby
|
39
|
+
config.before(:each, type: :system, js: true) do
|
40
|
+
driven_by :iphone_6_7_8_headless
|
41
|
+
end
|
42
|
+
```
|
43
|
+
|
44
|
+
We use it to run our system tests on so many devices! Here is our standard configuration:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
config.before(:each, type: :system, js: true) do
|
48
|
+
driven_by ENV['SELENIUM_DRIVER'].to_sym
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
and then we can run
|
53
|
+
|
54
|
+
```sh
|
55
|
+
SELENIUM_DRIVER=iphone_6_7_8_headless bundle exec rspec --pattern "**/system/**/*_spec.rb"
|
56
|
+
SELENIUM_DRIVER=selenium_chrome_headless bundle exec rspec --pattern "**/system/**/*_spec.rb"
|
57
|
+
```
|
58
|
+
|
59
|
+
of course, your tests need to run on so many devices!
|
60
|
+
|
61
|
+
## Available devices
|
62
|
+
|
63
|
+
Check [the YML file containing all the devices](./lib/so_many_devices/so_many_devices.yml). So many!
|
64
|
+
|
65
|
+
## Development
|
66
|
+
|
67
|
+
After checking out the repo, run `bin/setup` to install dependencies.
|
68
|
+
Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
69
|
+
|
70
|
+
To install this gem onto your local machine, run `bundle exec rake install`.
|
71
|
+
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`,
|
72
|
+
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).
|
73
|
+
|
74
|
+
## Contributing
|
75
|
+
|
76
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/renuo/so_many_devices.
|
77
|
+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/renuo/so_many_devices/blob/master/CODE_OF_CONDUCT.md).
|
78
|
+
|
79
|
+
Do you think our devices are not that many? 😡
|
80
|
+
|
81
|
+
Please contribute by adding more devices to the list, so that they can be even more...many...😕...and the next person coming cannot say "they are not that many..."
|
82
|
+
|
83
|
+
## License
|
84
|
+
|
85
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
86
|
+
|
87
|
+
## Code of Conduct
|
88
|
+
|
89
|
+
Everyone interacting in the SoManyDevices project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/renuo/so_many_devices/blob/master/CODE_OF_CONDUCT.md).
|
90
|
+
|
91
|
+
|
92
|
+
## Special Thanks
|
93
|
+
|
94
|
+
[![Renuo AG](/logo/renuo.png)](https://renuo.ch)
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
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
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "so_many_devices/version"
|
2
|
+
|
3
|
+
module SoManyDevices
|
4
|
+
class Error < StandardError;
|
5
|
+
end
|
6
|
+
|
7
|
+
devices = YAML::load_file(File.join(__dir__, 'so_many_devices.yml'))
|
8
|
+
|
9
|
+
devices.each do |device_name, options|
|
10
|
+
standard_args = ['--disable-site-isolation-trials']
|
11
|
+
headless_args = ['--headless', '--disable-site-isolation-trials']
|
12
|
+
headless_args << '--disable-gpu' if Gem.win_platform?
|
13
|
+
|
14
|
+
[[device_name.to_sym, standard_args], ["#{device_name}_headless".to_sym, headless_args]].each do |device_name, args|
|
15
|
+
Capybara.register_driver device_name.to_sym do |app|
|
16
|
+
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
17
|
+
'goog:chromeOptions' => { args: args, mobileEmulation: options }
|
18
|
+
)
|
19
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
iphone_6_7_8:
|
2
|
+
deviceMetrics:
|
3
|
+
width: 375
|
4
|
+
height: 667
|
5
|
+
pixelRatio: 2.0
|
6
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"
|
7
|
+
iphone_5_se:
|
8
|
+
deviceMetrics:
|
9
|
+
width: 320
|
10
|
+
height: 568
|
11
|
+
pixelRatio: 2.0
|
12
|
+
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1"
|
13
|
+
ipad:
|
14
|
+
deviceMetrics:
|
15
|
+
width: 768
|
16
|
+
height: 1024
|
17
|
+
pixelRatio: 2.0
|
18
|
+
userAgent: "Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1"
|
19
|
+
nexus5:
|
20
|
+
deviceMetrics:
|
21
|
+
width: 360
|
22
|
+
height: 640
|
23
|
+
pixelRatio: 3.0
|
24
|
+
userAgent: "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Mobile Safari/537.36"
|
25
|
+
pixel3:
|
26
|
+
deviceMetrics:
|
27
|
+
width: 393
|
28
|
+
height: 768
|
29
|
+
pixelRatio: 2.75
|
30
|
+
userAgent: "Mozilla/5.0 (Linux; Android 9.0; Pixel3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Mobile Safari/537.36"
|
data/logo/renuo.png
ADDED
Binary file
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require_relative 'lib/so_many_devices/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "so_many_devices"
|
5
|
+
spec.version = SoManyDevices::VERSION
|
6
|
+
spec.authors = ["Alessandro Rodi"]
|
7
|
+
spec.email = ["coorasse@gmail.com"]
|
8
|
+
|
9
|
+
spec.summary = %q{A list of configurations for so many devices!}
|
10
|
+
spec.description = %q{This incomplete but very satisfying list of devices, will help you run your app on so many devices!}
|
11
|
+
spec.homepage = "https://github.com/renuo/so_many_devices"
|
12
|
+
spec.license = "MIT"
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
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/CHANGELOG.md"
|
18
|
+
|
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)/}) }
|
23
|
+
end
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: so_many_devices
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alessandro Rodi
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: This incomplete but very satisfying list of devices, will help you run
|
14
|
+
your app on so many devices!
|
15
|
+
email:
|
16
|
+
- coorasse@gmail.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- ".gitignore"
|
22
|
+
- ".rspec"
|
23
|
+
- ".travis.yml"
|
24
|
+
- CODE_OF_CONDUCT.md
|
25
|
+
- Gemfile
|
26
|
+
- LICENSE.txt
|
27
|
+
- README.md
|
28
|
+
- Rakefile
|
29
|
+
- bin/console
|
30
|
+
- bin/setup
|
31
|
+
- lib/so_many_devices.rb
|
32
|
+
- lib/so_many_devices.yml
|
33
|
+
- lib/so_many_devices/version.rb
|
34
|
+
- logo/renuo.png
|
35
|
+
- so_many_devices.gemspec
|
36
|
+
homepage: https://github.com/renuo/so_many_devices
|
37
|
+
licenses:
|
38
|
+
- MIT
|
39
|
+
metadata:
|
40
|
+
homepage_uri: https://github.com/renuo/so_many_devices
|
41
|
+
source_code_uri: https://github.com/renuo/so_many_devices
|
42
|
+
changelog_uri: https://github.com/renuo/so_many_devices/CHANGELOG.md
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: 2.3.0
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubygems_version: 3.0.1
|
59
|
+
signing_key:
|
60
|
+
specification_version: 4
|
61
|
+
summary: A list of configurations for so many devices!
|
62
|
+
test_files: []
|