regressy_common 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d0bdb902629f2fd3eb055547a5970a8916dbeb4f
4
+ data.tar.gz: ee07ce5dad9a894352e8ae047f4ee8bed7936bea
5
+ SHA512:
6
+ metadata.gz: d62f0142ddba157553f087ea7e3b918fc162abb6ea3f19dfad72cba4cb936e4b418954bb410470fd8c1b5811bde70f0075d25b1b9d1b8a9a1bf6bb3d30fc86e8
7
+ data.tar.gz: c2539c7c19a9f71d70ea03ef4afa5d71c0138f95cfe1cfc45d1717a547c77255a487962bcd8baf568b25e7404e9ccf15be42b8fdcf2e233a397b0a63e54f799b
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in regressy_common.gemspec
6
+ gemspec
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # RegressyCommon
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/regressy_common`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'regressy_common'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install regressy_common
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ 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).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/regressy_common.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "regressy_common"
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,8 @@
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
@@ -0,0 +1,47 @@
1
+ require "regressy_common/version"
2
+
3
+ module RegressyCommon
4
+ class Error < StandardError; end
5
+
6
+ module Checker
7
+ def assert_element_present?(how, what)
8
+ assert_with_timeout(failure_message(how, what)) do
9
+ @driver.find_element(how, what).displayed?
10
+ end
11
+ end
12
+
13
+ def assert_elements_present?(how, what, index)
14
+ assert_with_timeout(failure_message(how, what, index)) do
15
+ unless @driver.find_elements(how, what)[index].nil?
16
+ @driver.find_elements(how, what)[index].displayed?
17
+ end
18
+ end
19
+ end
20
+
21
+ def assert_element_enabled?(how, what)
22
+ assert_with_timeout(failure_message(how, what)) do
23
+ result = @driver.find_element(how, what).enabled?
24
+ end
25
+ end
26
+
27
+ def assert_with_timeout(message, timeout_value=10)
28
+ @test_case.instance_eval do # assert count 集計のため、test_case で実行する
29
+ assert_block message do
30
+ begin
31
+ Selenium::WebDriver::Wait.new(:timeout => timeout_value).until do
32
+ yield
33
+ end
34
+ rescue => e
35
+ logger.info e.message
36
+ false
37
+ end
38
+ end
39
+ end
40
+ end
41
+
42
+ def failure_message(*params)
43
+ "#{caller[0][/`([^']*)'/, 1]} is failed. #{params}"
44
+ end
45
+ end
46
+
47
+ end
@@ -0,0 +1,3 @@
1
+ module RegressyCommon
2
+ VERSION = "0.2.0"
3
+ end
@@ -0,0 +1,40 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "regressy_common/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "regressy_common"
8
+ spec.version = RegressyCommon::VERSION
9
+ spec.authors = ["Minoru Nagasaka"]
10
+ spec.email = ["minoru.nagasaka@gmail.com"]
11
+
12
+ spec.summary = %q{common checker for regressy scripts}
13
+ #spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "https://github.com/gorogit/regressy.git"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ if spec.respond_to?(:metadata)
19
+ # spec.metadata["allowed_push_host"] = "http://nohost.net"
20
+
21
+ spec.metadata["homepage_uri"] = spec.homepage
22
+ spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
23
+ spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
24
+ else
25
+ raise "RubyGems 2.0 or newer is required to protect against " \
26
+ "public gem pushes."
27
+ end
28
+
29
+ # Specify which files should be added to the gem when it is released.
30
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
31
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
32
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
33
+ end
34
+ spec.bindir = "exe"
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
+ spec.require_paths = ["lib"]
37
+
38
+ spec.add_development_dependency "bundler", "~> 1.17"
39
+ spec.add_development_dependency "rake", "~> 10.0"
40
+ end
metadata ADDED
@@ -0,0 +1,82 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: regressy_common
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Minoru Nagasaka
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-01-21 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.17'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.17'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description:
42
+ email:
43
+ - minoru.nagasaka@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - README.md
50
+ - Rakefile
51
+ - bin/console
52
+ - bin/setup
53
+ - lib/regressy_common.rb
54
+ - lib/regressy_common/version.rb
55
+ - regressy_common.gemspec
56
+ homepage: https://github.com/gorogit/regressy.git
57
+ licenses: []
58
+ metadata:
59
+ homepage_uri: https://github.com/gorogit/regressy.git
60
+ source_code_uri: 'TODO: Put your gem''s public repo URL here.'
61
+ changelog_uri: 'TODO: Put your gem''s CHANGELOG.md URL here.'
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.6.13
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: common checker for regressy scripts
82
+ test_files: []