cloud_test 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0e54f6db87dc6d73250de4fe7b8421047f82d27258c19ca183ba96d5b49fd223
4
+ data.tar.gz: f8bb10fb48dbdfd5f5bd92b340ce2cd849cf0883b2c6b474f4e01f048f4637ce
5
+ SHA512:
6
+ metadata.gz: d49edd847bb9cd38ce64da6d3d00dd504155a47dbe01bc3359001703b85e16a0513454e679ea64cd5ee24e0724b23b18c061161b3642476ff1207b849eabcfe1
7
+ data.tar.gz: 00ae253946c212896116ec06e1700278f643a4bd927180cfedab4de39a4db37a1ee2941fc2c273c08cc6ccec1ee25055ea4cb58ff5b9d2fae883391d96bb427b
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /.idea/
@@ -0,0 +1 @@
1
+ 2.5
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.0
7
+ before_install: gem install bundler -v 2.0.1
@@ -0,0 +1,38 @@
1
+ #Changelog
2
+
3
+ ## 1.0.7
4
+
5
+ - bug fixes for browserstack
6
+ ## 1.0.6
7
+
8
+ - rename `cloud_test start` to `cloud_test cucumber`
9
+ - rename sample cucumber tag `@cloudtest` to `@cloud_test`
10
+ - improve the upload api, make it more explicit with named params
11
+ ## 1.0.5
12
+
13
+ - improve the README.md
14
+ ## 1.0.4
15
+
16
+ - add CHANGELOG.md
17
+
18
+ ## 1.0.3
19
+
20
+ - improve provider specific sample configuration
21
+
22
+ ## 1.0.2
23
+
24
+ - some bug fixes in the crossbrowsertesting configuration sample file
25
+
26
+ ## 1.0.1
27
+
28
+ - Bug fixes for crossbrowsertesting
29
+
30
+ ## 1.0
31
+
32
+ - Github realese
33
+ - add `cloud_test -v` command
34
+
35
+ ## 0.11.5
36
+
37
+ - add `cloud_test generate -p PROVIDER` option
38
+ - upload the fail status to crossbrowsertesting dashboard
@@ -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 philipp.haeusele@makandra.de. 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 [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in cloud_test.gemspec
4
+ gemspec
5
+ gem 'browserstack-local'
6
+ gem 'cucumber', '~> 1.3.20'
@@ -0,0 +1,83 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cloud_test (1.0.7)
5
+ capybara
6
+ cucumber
7
+ thor
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ addressable (2.6.0)
13
+ public_suffix (>= 2.0.2, < 4.0)
14
+ aruba (0.14.10)
15
+ childprocess (>= 0.6.3, < 1.1.0)
16
+ contracts (~> 0.9)
17
+ cucumber (>= 1.3.19)
18
+ ffi (~> 1.9)
19
+ rspec-expectations (>= 2.99)
20
+ thor (~> 0.19)
21
+ browserstack-local (1.3.0)
22
+ builder (3.2.3)
23
+ capybara (3.26.0)
24
+ addressable
25
+ mini_mime (>= 0.1.3)
26
+ nokogiri (~> 1.8)
27
+ rack (>= 1.6.0)
28
+ rack-test (>= 0.6.3)
29
+ regexp_parser (~> 1.5)
30
+ xpath (~> 3.2)
31
+ childprocess (1.0.1)
32
+ rake (< 13.0)
33
+ contracts (0.16.0)
34
+ cucumber (1.3.20)
35
+ builder (>= 2.1.2)
36
+ diff-lcs (>= 1.1.3)
37
+ gherkin (~> 2.12)
38
+ multi_json (>= 1.7.5, < 2.0)
39
+ multi_test (>= 0.1.2)
40
+ diff-lcs (1.3)
41
+ ffi (1.11.1)
42
+ gherkin (2.12.2)
43
+ multi_json (~> 1.3)
44
+ mini_mime (1.0.2)
45
+ mini_portile2 (2.4.0)
46
+ minitest (5.11.3)
47
+ multi_json (1.13.1)
48
+ multi_test (0.1.2)
49
+ nokogiri (1.10.3)
50
+ mini_portile2 (~> 2.4.0)
51
+ public_suffix (3.1.1)
52
+ rack (2.0.7)
53
+ rack-test (1.1.0)
54
+ rack (>= 1.0, < 3)
55
+ rake (10.5.0)
56
+ regexp_parser (1.6.0)
57
+ rspec-expectations (3.8.4)
58
+ diff-lcs (>= 1.2.0, < 2.0)
59
+ rspec-support (~> 3.8.0)
60
+ rspec-support (3.8.2)
61
+ rubyzip (1.2.3)
62
+ selenium-webdriver (3.142.3)
63
+ childprocess (>= 0.5, < 2.0)
64
+ rubyzip (~> 1.2, >= 1.2.2)
65
+ thor (0.20.3)
66
+ xpath (3.2.0)
67
+ nokogiri (~> 1.8)
68
+
69
+ PLATFORMS
70
+ ruby
71
+
72
+ DEPENDENCIES
73
+ aruba
74
+ browserstack-local
75
+ bundler (~> 2.0)
76
+ cloud_test!
77
+ cucumber (~> 1.3.20)
78
+ minitest (~> 5.0)
79
+ rake (~> 10.0)
80
+ selenium-webdriver
81
+
82
+ BUNDLED WITH
83
+ 2.0.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Philipp Häusele
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.
@@ -0,0 +1,184 @@
1
+ # cloud_test
2
+
3
+ cloud_test enables local Cloud-Testing for a number of providers:
4
+ - Browserstack
5
+ - CrossBrowserTesting
6
+ - saucelabs
7
+ - lambdatest
8
+
9
+ The intention of this gem is to quickly enable Cloud-Testing with minimal setup required.
10
+ It assumes your are using capybara and selenium.
11
+
12
+ ## Installation
13
+
14
+ Add this line to your application's Gemfile:
15
+
16
+ ```ruby
17
+ gem 'cloud_test'
18
+ ```
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ Or install it yourself as:
25
+
26
+ $ gem install cloud_test
27
+ ## Configuration
28
+ You can configure cloud_test in the
29
+
30
+ config/cloud_test.yml file
31
+
32
+ The minimal config includes a 'key' and a 'user' value (which may be or not be
33
+ the login credentials for the chosen provider), as well
34
+ as 'provider' value.
35
+ Additional key/value pairs are possible, for example to configure the browser.
36
+
37
+ - [Browserstack Configurator](https://www.browserstack.com/automate/capabilities)
38
+ - [CrossBrowserTesting Capabilities](https://help.crossbrowsertesting.com/selenium-testing/getting-started/crossbrowsertesting-automation-capabilities/)
39
+ - [Saucelabs Configurator](https://wiki.saucelabs.com/display/DOCS/Platform+Configurator#/)
40
+ - [lambdatest Capability Generator](https://www.lambdatest.com/capabilities-generator/)
41
+
42
+ You can generate the following example config file to the config folder with:
43
+
44
+ [bundle exec] cloud_test generate [-p PROVIDER]
45
+
46
+ Example cloud_test.config.yml:
47
+
48
+ #config/cloud_test.yml
49
+ provider: "browserstack"
50
+ user: "username" # these may not be the login credentials
51
+ key: "password"
52
+ cloud_test_debug: false
53
+ common_caps:
54
+ "acceptSslCerts": true # allow self signed certificates
55
+ browserstack: #optional block
56
+ "browserstack.local": true
57
+ "browserstack.debug": true # Visual log
58
+ browsers:
59
+ IE:
60
+ "browser": "IE"
61
+ "browser_version": "11.0"
62
+ "os": "Windows"
63
+ "os_version": "7"
64
+ CHROME:
65
+ "browser": "chrome"
66
+ "browser_version": "75.0"
67
+ "os": "Windows"
68
+ cucumber_tag: "@cloudtest"
69
+
70
+ You can choose a specific browser configuration by setting the CLOUD_TEST
71
+ env variable to your preconfigured browser settings by:
72
+
73
+ export CLOUD_TEST=<BROWSER_CONFIG>
74
+ # or
75
+ CLOUD_TEST=<BROWSER_CONFIG> cucumber
76
+ The _provider_ Hash can include specific configuration only for that provider,
77
+ common_caps and browser_caps are provider independent.
78
+
79
+ NOTE: Theses capabilities may still be slightly different for each provider.
80
+ If you set the cloud_test_debug key to true cloud_test will display some additional
81
+ details.
82
+
83
+ And these are the defaults and possible env variable settings:
84
+
85
+ [bundle exec] cloud_test list-default-caps PROVIDER
86
+ # will show something like this:
87
+
88
+ ENV['CLOUDTEST_PROJECT'] || # folder name
89
+ ENV['CLOUDTEST_BUILD'] || `git rev-parse HEAD` # HEAD commit hash
90
+ ENV['CLOUDTEST_NAME'] || `git log -1 --pretty=%B` # HEAD commit message
91
+ ENV['CLOUDTEST_OS'] || '10'
92
+ ENV['CLOUDTEST_PLATFORM'] || 'WINDOWS'
93
+ ENV['CLOUDTEST_BROWSER'] || 'CHROME'
94
+
95
+ Additionally you can do a dry run and show the "real" capabilities:
96
+
97
+ [bundle exec] cloud_test list-caps PROVIDER
98
+
99
+ ## Usage
100
+ You do need a config file, read the configuration section above first.
101
+ You need to run the specific tunnel app for each provider in order to setup local testing.
102
+ Links:
103
+
104
+ - Browserstack tunnel should be installed as a
105
+ [gem](https://github.com/browserstack/browserstack-local-ruby),
106
+ so add gem 'browserstack-local' to your gemfile. ([Tunnel Binary](https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal-linux-x64))
107
+ - [CrossBrowserTesting tunnel](https://github.com/crossbrowsertesting/cbt-tunnel-nodejs/releases)
108
+ - [Saucelabs tunnel](https://wiki.saucelabs.com/display/DOCS/Setting+Up+Sauce+Connect+Proxy)
109
+ - [Lambdatest tunnel](https://s3.amazonaws.com/lambda-tunnel/LT_Linux.zip)
110
+
111
+ Download the one for your provider and operating system.
112
+ Extract the executable and run it. The command should be similar to:
113
+
114
+ ./<path_to>/<tunnel> -u <username> -k <password|apikey>
115
+
116
+ To enable Cloud_Testing you need to set the ENV['CLOUD_TEST'] variable to any value.
117
+
118
+ export CLOUD_TEST=IE
119
+ # or
120
+ CLOUD_TEST=IE cucumber
121
+ The value can be a browser_caps configuration key (e.g. IE, chrome, my_ie_browser_config), and must be defined in the config file.
122
+
123
+
124
+ Additionally you need to require 'cloud_test' and set the capybara driver in the
125
+ features/support/cloud_test.rb file as follows, it can be generated automatically if you run:
126
+
127
+ [bundle exec] cloud_test generate [-p PROVIDER]
128
+
129
+
130
+ require 'cloud_test'
131
+
132
+ if CloudTest.enabled?
133
+ Before do
134
+ Capybara.current_driver = :cloud_test
135
+ end
136
+ After do |scenario|
137
+ if scenario.failed?
138
+ CloudTest.upload_status_to_provider true, page.driver.browser.session_id, scenario.exception
139
+ end
140
+ end
141
+ end
142
+ NOTE: cloud_test registers a Capybara driver named ':cloud_test'.
143
+
144
+ The After hook updates the status in the dashboard of your provider.
145
+ Currently this is implemented for browserstack and crossbrowsertesting.
146
+
147
+ If you want to test your whether your login credentials work, you can use the
148
+ following command:
149
+
150
+ [bundle exec] cloud_test test-connection
151
+
152
+ To automate things even further you can define a cucumber tag in the config file
153
+ (default: '@cloudtest'), tag all scenarios you wish to run and run the following command:
154
+
155
+ [bundle exec] cloud_test cucumber [-q]
156
+ This command will run all tagged scenarios sequantially with all browser configurations
157
+ defined in the 'browsers' list in your config file. It runs the following command for each browser:
158
+
159
+ CLOUD_TEST=<browser_config_name> bundle exec cucumber -t <cucumber_tag>
160
+ You can also use the following command to execute your own test-command:
161
+
162
+ [bundle exec] cloud_test each [-q] <run> <your> <test-suite>
163
+
164
+ You can get a list of all available commands with a description if you run:
165
+
166
+ [bundle exec] cloud_test
167
+
168
+ ## Development
169
+
170
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
171
+
172
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, 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).
173
+
174
+ ## Contributing
175
+
176
+ Bug reports and pull requests are welcome on GitHub at https://github.com/makandra/cloud_test. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
177
+
178
+ ## License
179
+
180
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
181
+
182
+ ## Code of Conduct
183
+
184
+ Everyone interacting in the Cloudtest project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/cloud_test/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test