capycon 0.1.1
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/.idea/.gitignore +2 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/capy_con.iml +19 -0
- data/.idea/dictionaries/mesut.xml +7 -0
- data/.idea/inspectionProfiles/Project_Default.xml +8 -0
- data/.idea/inspectionProfiles/profiles_settings.xml +5 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vcs.xml +6 -0
- data/.rspec +3 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +93 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/capy_con-0.1.1.gem +0 -0
- data/capycon.gemspec +38 -0
- data/lib/capycon.rb +34 -0
- data/lib/capycon/version.rb +3 -0
- data/lib/loading_script.rb +161 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c47e560be9f0115c9c83aad814dd1c64f1c745ee0c87e21ba1fb7d2852ff9ee4
|
4
|
+
data.tar.gz: 6144f26730042172b20120c36e597d01e7378f870f3d2d67b22e90f7e336c2a8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6021dc5a42f423d7f2046d41500742f14041a75c0353d866ae9ed1c973ce19c991cb746cf3da8f5cb631ce3f2185641f427e5bbc3d4aa6b760158997ef7560ff
|
7
|
+
data.tar.gz: f7e18e454a79486669a404c2c8de09290335e6b0ae02d0130b684b5678e1fe6add4201d8947f0aa1f87d83ded458c13b44a522927edd61189d17e5afda6316ac
|
data/.gitignore
ADDED
data/.idea/.gitignore
ADDED
data/.idea/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build capy_con-0.1.1.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install capy_con-0.1.1.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install capy_con-0.1.1.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.1 and build and push capy_con-0.1.1.gem to TODO: Set to 'http://mygemserver.com'" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
data/.idea/capy_con.iml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$" />
|
8
|
+
<orderEntry type="jdk" jdkName="rbenv: 2.6.5" jdkType="RUBY_SDK" />
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.17.3, rbenv: 2.6.5) [gem]" level="application" />
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.6.5) [gem]" level="application" />
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v12.3.3, rbenv: 2.6.5) [gem]" level="application" />
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, rbenv: 2.6.5) [gem]" level="application" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.1, rbenv: 2.6.5) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.1, rbenv: 2.6.5) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, rbenv: 2.6.5) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.2, rbenv: 2.6.5) [gem]" level="application" />
|
18
|
+
</component>
|
19
|
+
</module>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<component name="InspectionProjectProfileManager">
|
2
|
+
<profile version="1.0">
|
3
|
+
<option name="myName" value="Project Default" />
|
4
|
+
<inspection_tool class="RubyResolve" enabled="false" level="WARNING" enabled_by_default="false">
|
5
|
+
<option name="warnImplicitResults" value="false" />
|
6
|
+
</inspection_tool>
|
7
|
+
</profile>
|
8
|
+
</component>
|
data/.idea/misc.xml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="JavaScriptSettings">
|
4
|
+
<option name="languageLevel" value="ES6" />
|
5
|
+
</component>
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="rbenv: 2.4.4" project-jdk-type="RUBY_SDK" />
|
7
|
+
</project>
|
data/.idea/modules.xml
ADDED
data/.idea/vcs.xml
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.5
|
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 gunesmes@gmail.com. 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
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Mesut Güneş
|
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,93 @@
|
|
1
|
+
# CapyCon
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capycon`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'capycon'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install capycon
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
run capybara on the console
|
26
|
+
|
27
|
+
```shell script
|
28
|
+
~/P/p/c/capy_con (master ⚡→☡) pry
|
29
|
+
[1] pry(main)> require "capycon"
|
30
|
+
|
31
|
+
|
32
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
33
|
+
* *
|
34
|
+
* capycon - CAPYBARA CONSOLE *
|
35
|
+
* *
|
36
|
+
* Default driver is :driver_iphone6_vertical_visible *
|
37
|
+
* To set the site name as environment variable: *
|
38
|
+
* echo 'export SITE_NAME=http://www.github.com' >> ~/.bash_profile *
|
39
|
+
* *
|
40
|
+
* To set the driver as environment variable: *
|
41
|
+
* echo 'export DRIVER=driver_chrome_visible' >> ~/.bash_profile *
|
42
|
+
* OR *
|
43
|
+
* You can set the driver by one of the following options *
|
44
|
+
* *
|
45
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
46
|
+
|
47
|
+
Capybara.current_driver = :driver_chrome_visible
|
48
|
+
Capybara.current_driver = :driver_chrome_fullscreen_headless
|
49
|
+
Capybara.current_driver = :driver_iphone6_vertical_visible
|
50
|
+
Capybara.current_driver = :driver_iphone6_vertical_headless
|
51
|
+
Capybara.current_driver = :driver_iphone6_horizontal_visible
|
52
|
+
Capybara.current_driver = :driver_iphone6_horizontal_headless
|
53
|
+
Capybara.current_driver = :driver_iphone6plus_vertical_headless
|
54
|
+
Capybara.current_driver = :driver_iphone6plus_horizontal_headless
|
55
|
+
Capybara.current_driver = :driver_ipad_vertical_visible
|
56
|
+
Capybara.current_driver = :driver_ipad_horizontal_visible
|
57
|
+
Capybara.current_driver = :driver_ipad_vertical_headless
|
58
|
+
Capybara.current_driver = :driver_ipad_horizontal_headless
|
59
|
+
Capybara.current_driver = :driver_samsungs6_vertical_headless
|
60
|
+
Capybara.current_driver = :driver_samsungs6_horizontal_headless
|
61
|
+
Capybara.current_driver = :driver_samsungsTabA_horizontal_headless
|
62
|
+
Capybara.current_driver = :driver_samsungsTabA_vertical_headless
|
63
|
+
Capybara.current_driver = :driver_desktop_headless
|
64
|
+
=> true
|
65
|
+
[2] pry(main)> Capybara.current_driver = :driver_chrome_visible
|
66
|
+
=> :driver_chrome_visible
|
67
|
+
[3] pry(main)> visit "/"
|
68
|
+
=> nil
|
69
|
+
[4] pry(main)> find(".js-site-search-form > label > input").send_keys "capycon"
|
70
|
+
=> #<Capybara::Node::Element tag="input" path="/HTML/BODY[1]/DIV[1]/HEADER[1]/DIV[1]/DIV[2]/DIV[2]/DIV[1]/DIV[1]/DIV[1]/FORM[1]/LABEL[1]/INPUT[1]">
|
71
|
+
[5] pry(main)> find(".js-site-search-form > label > input").send_keys :return
|
72
|
+
=> Obsolete #<Capybara::Node::Element>
|
73
|
+
[6] pry(main)> page.has_content? "gunesmes/capycon"
|
74
|
+
=> true
|
75
|
+
```
|
76
|
+
|
77
|
+
## Development
|
78
|
+
|
79
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
80
|
+
|
81
|
+
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).
|
82
|
+
|
83
|
+
## Contributing
|
84
|
+
|
85
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/capycon. 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.
|
86
|
+
|
87
|
+
## License
|
88
|
+
|
89
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
90
|
+
|
91
|
+
## Code of Conduct
|
92
|
+
|
93
|
+
Everyone interacting in the CapyCon project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/capycon/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "capycon"
|
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
data/capy_con-0.1.1.gem
ADDED
Binary file
|
data/capycon.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "capycon/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "capycon"
|
8
|
+
spec.version = Capycon::VERSION
|
9
|
+
spec.authors = ["Mesut Güneş"]
|
10
|
+
spec.email = ["gunesmes@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Run Capybara in the console without Ruby on Rails project}
|
13
|
+
spec.description = %q{Before writing your test for your automation project which is not written by ROR, you can test the steps with Capycon via your terminal}
|
14
|
+
spec.homepage = "https://rubygems.org/capycon"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
# if spec.respond_to?(:metadata)
|
20
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
# else
|
22
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
23
|
+
# "public gem pushes."
|
24
|
+
# end
|
25
|
+
|
26
|
+
# Specify which files should be added to the gem when it is released.
|
27
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
28
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
29
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
30
|
+
end
|
31
|
+
spec.bindir = "exe"
|
32
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
33
|
+
spec.require_paths = ["lib"]
|
34
|
+
|
35
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
36
|
+
spec.add_development_dependency "rake", "~> 12.3"
|
37
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
38
|
+
end
|
data/lib/capycon.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'capycon/version'
|
4
|
+
|
5
|
+
module Capycon
|
6
|
+
hello =
|
7
|
+
''"\n
|
8
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
9
|
+
* *
|
10
|
+
* capycon - CAPYBARA CONSOLE *
|
11
|
+
* *
|
12
|
+
* Default driver is :driver_iphone6_vertical_visible *
|
13
|
+
* To set the site name as environment variable: *
|
14
|
+
* echo 'export SITE_NAME=http://www.github.com' >> ~/.bash_profile *
|
15
|
+
* *
|
16
|
+
* To set the driver as environment variable: *
|
17
|
+
* echo 'export DRIVER=driver_chrome_visible' >> ~/.bash_profile *
|
18
|
+
* OR *
|
19
|
+
* You can set the driver by one of the following options *
|
20
|
+
* *
|
21
|
+
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
22
|
+
\n"''
|
23
|
+
|
24
|
+
load 'loading_script.rb'
|
25
|
+
|
26
|
+
puts hello
|
27
|
+
Capybara.drivers.each do |key, value|
|
28
|
+
if key.to_s.include?('driver')
|
29
|
+
puts " Capybara.current_driver = :#{key.to_s}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
visit '/'
|
34
|
+
end
|
@@ -0,0 +1,161 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'capybara'
|
4
|
+
require 'capybara/dsl'
|
5
|
+
require 'selenium-webdriver'
|
6
|
+
|
7
|
+
Capybara.app_host = ENV['SITE_NAME'] || 'http://www.testrisk.com'
|
8
|
+
driver = (ENV['DRIVER']).to_sym unless ENV['DRIVER'].nil?
|
9
|
+
Capybara.default_selector = :css
|
10
|
+
Capybara.default_max_wait_time = 30
|
11
|
+
Capybara.ignore_hidden_elements = true
|
12
|
+
Capybara.save_path = File.dirname(__FILE__) + '/media'
|
13
|
+
|
14
|
+
Capybara.current_driver = driver || :driver_iphone6_vertical_visible
|
15
|
+
|
16
|
+
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
17
|
+
# * * * * * * * * * * D R I V E R S * * * * * * * * * * *
|
18
|
+
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
19
|
+
Capybara.register_driver :driver_chrome_visible do |app|
|
20
|
+
args = %w[--disable-infobars --disable-notifications]
|
21
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
22
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
23
|
+
end
|
24
|
+
|
25
|
+
Capybara.register_driver :driver_chrome_fullscreen_headless do |app|
|
26
|
+
args = %w[--start-fullscreen --disable-infobars --disable-notifications]
|
27
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
28
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
29
|
+
end
|
30
|
+
|
31
|
+
Capybara.register_driver :driver_iphone6_vertical_visible do |app|
|
32
|
+
size = '375,667'
|
33
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
34
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}"]
|
35
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
36
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
37
|
+
end
|
38
|
+
|
39
|
+
Capybara.register_driver :driver_iphone6_vertical_headless do |app|
|
40
|
+
size = '375,667'
|
41
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
42
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
43
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
44
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
45
|
+
end
|
46
|
+
|
47
|
+
Capybara.register_driver :driver_iphone6_horizontal_visible do |app|
|
48
|
+
size = '667,375'
|
49
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
50
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}"]
|
51
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
52
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
53
|
+
end
|
54
|
+
|
55
|
+
Capybara.register_driver :driver_iphone6_horizontal_headless do |app|
|
56
|
+
size = '667,375'
|
57
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
58
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
59
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
60
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
61
|
+
end
|
62
|
+
|
63
|
+
Capybara.register_driver :driver_iphone6plus_vertical_headless do |app|
|
64
|
+
size = '414,738'
|
65
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
66
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
67
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
68
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
69
|
+
end
|
70
|
+
|
71
|
+
Capybara.register_driver :driver_iphone6plus_horizontal_headless do |app|
|
72
|
+
size = '667,375'
|
73
|
+
user_agent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
74
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
75
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
76
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
77
|
+
end
|
78
|
+
|
79
|
+
Capybara.register_driver :driver_ipad_vertical_visible do |app|
|
80
|
+
size = '768,1024'
|
81
|
+
user_agent = 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
82
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}"]
|
83
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
84
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
85
|
+
end
|
86
|
+
|
87
|
+
Capybara.register_driver :driver_ipad_horizontal_visible do |app|
|
88
|
+
size = '1024,768'
|
89
|
+
user_agent = 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
90
|
+
args = ["--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}"]
|
91
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
92
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
93
|
+
end
|
94
|
+
|
95
|
+
Capybara.register_driver :driver_ipad_vertical_headless do |app|
|
96
|
+
size = '768,1024'
|
97
|
+
user_agent = 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
98
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
99
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
100
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
101
|
+
end
|
102
|
+
|
103
|
+
Capybara.register_driver :driver_ipad_horizontal_headless do |app|
|
104
|
+
size = '1024,768'
|
105
|
+
user_agent = 'Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1'
|
106
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
107
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
108
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
109
|
+
end
|
110
|
+
|
111
|
+
Capybara.register_driver :driver_samsungs6_vertical_headless do |app|
|
112
|
+
size = '360,640'
|
113
|
+
user_agent = 'Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36'
|
114
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
115
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
116
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
117
|
+
end
|
118
|
+
|
119
|
+
Capybara.register_driver :driver_samsungs6_horizontal_headless do |app|
|
120
|
+
size = '640,360'
|
121
|
+
user_agent = 'Mozilla/5.0 (Linux; Android 6.0.1; SM-G920V Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.98 Mobile Safari/537.36'
|
122
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
123
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
124
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
125
|
+
end
|
126
|
+
|
127
|
+
Capybara.register_driver :driver_samsungsTabA_horizontal_headless do |app|
|
128
|
+
size = '1024,600'
|
129
|
+
user_agent = 'Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T550 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Safari/537.36'
|
130
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
131
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
132
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
133
|
+
end
|
134
|
+
|
135
|
+
Capybara.register_driver :driver_samsungsTabA_vertical_headless do |app|
|
136
|
+
size = '600,1024'
|
137
|
+
user_agent = 'Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T550 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Safari/537.36'
|
138
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
139
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
140
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
141
|
+
end
|
142
|
+
|
143
|
+
Capybara.register_driver :driver_desktop_headless do |app|
|
144
|
+
args = %w[--window-size=1280,1696 --disable-infobars --disable-notifications --no-sandbox --headless]
|
145
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
146
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
147
|
+
end
|
148
|
+
|
149
|
+
Capybara.register_driver :driver_samsungsTabA_vertical_headless do |app|
|
150
|
+
size = '600,1024'
|
151
|
+
user_agent = 'Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T550 Build/LRX22G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Safari/537.36'
|
152
|
+
args = ['--no-sandbox', '--headless', "--window-size=#{size}", '--use-mobile-user-agent', '--disable-infobars', '--disable-notifications', "--user-agent=#{user_agent}", '--no-sandbox', '--headless']
|
153
|
+
options = Selenium::WebDriver::Chrome::Options.new(args: args)
|
154
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
|
155
|
+
end
|
156
|
+
|
157
|
+
default_verbose = $VERBOSE
|
158
|
+
$VERBOSE = nil
|
159
|
+
include Capybara::DSL
|
160
|
+
$VERBOSE = default_verbose
|
161
|
+
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capycon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Mesut Güneş
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.16'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.16'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '12.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '12.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Before writing your test for your automation project which is not written
|
56
|
+
by ROR, you can test the steps with Capycon via your terminal
|
57
|
+
email:
|
58
|
+
- gunesmes@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".idea/.gitignore"
|
65
|
+
- ".idea/.rakeTasks"
|
66
|
+
- ".idea/capy_con.iml"
|
67
|
+
- ".idea/dictionaries/mesut.xml"
|
68
|
+
- ".idea/inspectionProfiles/Project_Default.xml"
|
69
|
+
- ".idea/inspectionProfiles/profiles_settings.xml"
|
70
|
+
- ".idea/misc.xml"
|
71
|
+
- ".idea/modules.xml"
|
72
|
+
- ".idea/vcs.xml"
|
73
|
+
- ".rspec"
|
74
|
+
- ".ruby-version"
|
75
|
+
- ".travis.yml"
|
76
|
+
- CODE_OF_CONDUCT.md
|
77
|
+
- Gemfile
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- bin/console
|
82
|
+
- bin/setup
|
83
|
+
- capy_con-0.1.1.gem
|
84
|
+
- capycon.gemspec
|
85
|
+
- lib/capycon.rb
|
86
|
+
- lib/capycon/version.rb
|
87
|
+
- lib/loading_script.rb
|
88
|
+
homepage: https://rubygems.org/capycon
|
89
|
+
licenses:
|
90
|
+
- MIT
|
91
|
+
metadata: {}
|
92
|
+
post_install_message:
|
93
|
+
rdoc_options: []
|
94
|
+
require_paths:
|
95
|
+
- lib
|
96
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
requirements: []
|
107
|
+
rubygems_version: 3.1.2
|
108
|
+
signing_key:
|
109
|
+
specification_version: 4
|
110
|
+
summary: Run Capybara in the console without Ruby on Rails project
|
111
|
+
test_files: []
|