This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
did some refactoring, fixing, and test writing
- Loading branch information
Showing
6 changed files
with
158 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,99 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
kinchan (0.1.0) | ||
kinchan (0.3.0) | ||
require_all (~> 3.0.0) | ||
selenium-webdriver (~> 3.142.6) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
ast (2.4.1) | ||
backport (1.1.2) | ||
benchmark (0.1.0) | ||
childprocess (3.0.0) | ||
diff-lcs (1.3) | ||
diff-lcs (1.4.4) | ||
e2mmap (0.1.0) | ||
jaro_winkler (1.5.4) | ||
kwalify (0.7.2) | ||
maruku (0.7.3) | ||
mini_portile2 (2.4.0) | ||
nokogiri (1.10.10) | ||
mini_portile2 (~> 2.4.0) | ||
parallel (1.19.2) | ||
parser (2.7.2.0) | ||
ast (~> 2.4.1) | ||
psych (3.1.0) | ||
rainbow (3.0.0) | ||
rake (13.0.1) | ||
reek (6.0.1) | ||
kwalify (~> 0.7.0) | ||
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1) | ||
psych (~> 3.1.0) | ||
rainbow (>= 2.0, < 4.0) | ||
regexp_parser (1.8.1) | ||
require_all (3.0.0) | ||
reverse_markdown (2.0.0) | ||
nokogiri | ||
rexml (3.2.4) | ||
rspec (3.9.0) | ||
rspec-core (~> 3.9.0) | ||
rspec-expectations (~> 3.9.0) | ||
rspec-mocks (~> 3.9.0) | ||
rspec-core (3.9.1) | ||
rspec-support (~> 3.9.1) | ||
rspec-expectations (3.9.0) | ||
rspec-core (3.9.3) | ||
rspec-support (~> 3.9.3) | ||
rspec-expectations (3.9.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.9.0) | ||
rspec-mocks (3.9.1) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.9.0) | ||
rspec-support (3.9.2) | ||
rubyzip (2.0.0) | ||
rspec-support (3.9.3) | ||
rubocop (0.93.0) | ||
parallel (~> 1.10) | ||
parser (>= 2.7.1.5) | ||
rainbow (>= 2.2.2, < 4.0) | ||
regexp_parser (>= 1.8) | ||
rexml | ||
rubocop-ast (>= 0.6.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (>= 1.4.0, < 2.0) | ||
rubocop-ast (0.7.1) | ||
parser (>= 2.7.1.5) | ||
ruby-progressbar (1.10.1) | ||
rubyzip (2.3.0) | ||
selenium-webdriver (3.142.7) | ||
childprocess (>= 0.5, < 4.0) | ||
rubyzip (>= 1.2.2) | ||
solargraph (0.39.17) | ||
backport (~> 1.1) | ||
benchmark | ||
bundler (>= 1.17.2) | ||
e2mmap | ||
jaro_winkler (~> 1.5) | ||
maruku (~> 0.7, >= 0.7.3) | ||
nokogiri (~> 1.9, >= 1.9.1) | ||
parser (~> 2.3) | ||
reverse_markdown (>= 1.0.5, < 3) | ||
rubocop (~> 0.52) | ||
thor (~> 1.0) | ||
tilt (~> 2.0) | ||
yard (~> 0.9, >= 0.9.24) | ||
thor (1.0.1) | ||
tilt (2.0.10) | ||
unicode-display_width (1.7.0) | ||
yard (0.9.25) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
kinchan! | ||
rake (~> 13.0) | ||
reek (~> 6.0) | ||
rspec (~> 3.9.0) | ||
rubocop (~> 0.9) | ||
solargraph | ||
|
||
BUNDLED WITH | ||
2.1.2 | ||
2.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Kinchan | ||
VERSION = '0.2.0' | ||
VERSION = '0.3.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require_relative '../../lib/kinchan' | ||
|
||
module Google | ||
class VisitHomePage < Kinchan::Task | ||
def execute(browser) | ||
browser.navigate.to 'https://www.google.com' | ||
end | ||
end | ||
|
||
class ExecuteSearch < Kinchan::Task | ||
def initialize(**options) | ||
super | ||
|
||
@query = options[:query] | ||
end | ||
|
||
def execute(browser) | ||
browser.find_element(:name, 'q')&.send_keys(@query) # input the query | ||
browser.find_element(:id, 'tsf')&.submit # submit the search form | ||
end | ||
end | ||
|
||
module HighLevel | ||
class SearchForTerm < Kinchan::Task | ||
def initialize(**options) | ||
super | ||
|
||
@before_tasks << { task: :VisitHomePage } | ||
@after_tasks << { task: :ExecuteSearch, options: options } | ||
end | ||
end | ||
end | ||
end |