rutl 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +16 -1
- data/.rubocop.yml +11 -9
- data/.rubocop_todo.yml +93 -0
- data/README.md +8 -7
- data/lib/rutl/interface/base_interface.rb +2 -6
- data/lib/rutl/interface/chrome_interface.rb +1 -1
- data/lib/rutl/interface/firefox_interface.rb +1 -0
- data/lib/rutl/interface/null_interface.rb +0 -3
- data/lib/rutl/utilities.rb +2 -0
- data/lib/rutl/version.rb +1 -1
- data/rutl.gemspec +7 -10
- metadata +37 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 91f41b74e68fe36acb46dd525f7f375f18d3939d5a7fc15c1972ff443af6125e
|
|
4
|
+
data.tar.gz: 1a2d184998b8f3f18532ece3f353059cbd616e8f7a419c4331c8dfc10fc40d59
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a91637e9662ede93d7991261f44dde9299d0b04482ab25ce8d952fc2f16e4df210452c120642f816a373f4c565287ee16aa57033d0d3c609b23a07f5a9cd17f
|
|
7
|
+
data.tar.gz: 93a535c70dbd92121f461bbcea341c3dea2c9d23ac33ae6f5bdcd2658efe1dacf3feb048012412577d6a5726ecf5ca3ce535b76524a48789f92dffebcdf6e8ac
|
data/.circleci/config.yml
CHANGED
|
@@ -36,7 +36,22 @@ jobs:
|
|
|
36
36
|
- ./vendor/bundle
|
|
37
37
|
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
- run:
|
|
40
|
+
name: Install the latest firefox
|
|
41
|
+
command: |
|
|
42
|
+
sudo apt-get remove firefox-mozilla-build &&
|
|
43
|
+
sudo sh -c "echo 'deb http://ftp.hr.debian.org/debian sid main' >> /etc/apt/sources.list" &&
|
|
44
|
+
sudo apt-get update &&
|
|
45
|
+
sudo apt-get remove binutils
|
|
46
|
+
sudo apt-get install -t sid firefox &&
|
|
47
|
+
firefox --version
|
|
48
|
+
|
|
49
|
+
- run:
|
|
50
|
+
name: Install geckodriver
|
|
51
|
+
command: |
|
|
52
|
+
sudo wget https://github.com/mozilla/geckodriver/releases/download/v0.20.1/geckodriver-v0.20.1-linux64.tar.gz
|
|
53
|
+
sudo tar xf geckodriver-v0.20.1-linux64.tar.gz -C /usr/local/bin
|
|
54
|
+
|
|
40
55
|
- run:
|
|
41
56
|
name: run tests
|
|
42
57
|
command: |
|
data/.rubocop.yml
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
|
2
|
+
|
|
3
|
+
require: rubocop-rspec
|
|
4
|
+
# drewcoo-cops has to go after rubocop-rspec because otherwise it diables
|
|
5
|
+
# drewcoo-cops.
|
|
6
|
+
# There are also a bunch of warnigs spewed about the RSpec cops listed
|
|
7
|
+
# in the todo file so it looks like we're not playing well with rubocop-rspec
|
|
8
|
+
# either.
|
|
9
|
+
# Check this in for now and TODO: figure this out tomorrow.
|
|
10
|
+
require: drewcoo-cops
|
|
11
|
+
|
|
1
12
|
AllCops:
|
|
2
13
|
DefaultFormatter: progress
|
|
3
14
|
DisplayCopNames: true
|
|
4
15
|
DisplayStyleGuide: true
|
|
5
16
|
ExtraDetails: true
|
|
6
|
-
|
|
7
|
-
Metrics/BlockLength:
|
|
8
|
-
Enabled: false
|
|
9
|
-
|
|
10
|
-
Metrics/MethodLength:
|
|
11
|
-
Enabled: false
|
|
12
|
-
|
|
13
|
-
Style/BracesAroundHashParameters:
|
|
14
|
-
Enabled: false
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config`
|
|
3
|
+
# on 2018-05-26 12:34:26 -0700 using RuboCop version 0.56.0.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 1
|
|
10
|
+
Metrics/AbcSize:
|
|
11
|
+
Max: 16
|
|
12
|
+
|
|
13
|
+
# Offense count: 3
|
|
14
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
|
15
|
+
Metrics/BlockLength:
|
|
16
|
+
Max: 48
|
|
17
|
+
|
|
18
|
+
# Offense count: 4
|
|
19
|
+
# Configuration parameters: CountComments.
|
|
20
|
+
Metrics/MethodLength:
|
|
21
|
+
Max: 19
|
|
22
|
+
|
|
23
|
+
# Offense count: 1
|
|
24
|
+
Naming/AccessorMethodName:
|
|
25
|
+
Exclude:
|
|
26
|
+
- 'lib/rutl/interface/null_interface.rb'
|
|
27
|
+
|
|
28
|
+
# Offense count: 1
|
|
29
|
+
RSpec/ExampleLength:
|
|
30
|
+
Exclude:
|
|
31
|
+
- 'spec/chrome_interface_spec.rb'
|
|
32
|
+
|
|
33
|
+
# Offense count: 2
|
|
34
|
+
RSpec/ExpectActual:
|
|
35
|
+
Exclude:
|
|
36
|
+
- 'spec/null_interface_spec.rb'
|
|
37
|
+
- 'spec/rutl_spec.rb'
|
|
38
|
+
|
|
39
|
+
# Offense count: 1
|
|
40
|
+
RSpec/MultipleExpectations:
|
|
41
|
+
Exclude:
|
|
42
|
+
- 'spec/chrome_interface_spec.rb'
|
|
43
|
+
|
|
44
|
+
# Offense count: 4
|
|
45
|
+
# Cop supports --auto-correct.
|
|
46
|
+
# Configuration parameters: EnforcedStyle.
|
|
47
|
+
# SupportedStyles: braces, no_braces, context_dependent
|
|
48
|
+
Style/BracesAroundHashParameters:
|
|
49
|
+
Exclude:
|
|
50
|
+
- 'spec/pages/internet_login_page.rb'
|
|
51
|
+
- 'spec/pages/page1.rb'
|
|
52
|
+
|
|
53
|
+
# Offense count: 1
|
|
54
|
+
Style/ClassVars:
|
|
55
|
+
Exclude:
|
|
56
|
+
- 'lib/rutl/base_page.rb'
|
|
57
|
+
|
|
58
|
+
# Offense count: 4
|
|
59
|
+
Style/MethodMissingSuper:
|
|
60
|
+
Exclude:
|
|
61
|
+
- 'lib/rutl/base_page.rb'
|
|
62
|
+
- 'lib/rutl/browser.rb'
|
|
63
|
+
- 'lib/rutl/interface/base_interface.rb'
|
|
64
|
+
- 'spec/spec_helper.rb'
|
|
65
|
+
|
|
66
|
+
# Offense count: 1
|
|
67
|
+
# Cop supports --auto-correct.
|
|
68
|
+
Style/PerlBackrefs:
|
|
69
|
+
Exclude:
|
|
70
|
+
- 'lib/rutl/browser.rb'
|
|
71
|
+
|
|
72
|
+
# Offense count: 1
|
|
73
|
+
# Cop supports --auto-correct.
|
|
74
|
+
# Configuration parameters: EnforcedStyle.
|
|
75
|
+
# SupportedStyles: implicit, explicit
|
|
76
|
+
Style/RescueStandardError:
|
|
77
|
+
Exclude:
|
|
78
|
+
- 'lib/rutl/utilities.rb'
|
|
79
|
+
|
|
80
|
+
# Offense count: 3
|
|
81
|
+
# Cop supports --auto-correct.
|
|
82
|
+
# Configuration parameters: AllowIfMethodIsEmpty.
|
|
83
|
+
Style/SingleLineMethods:
|
|
84
|
+
Exclude:
|
|
85
|
+
- 'lib/rutl/base_page.rb'
|
|
86
|
+
|
|
87
|
+
# Offense count: 1
|
|
88
|
+
# Cop supports --auto-correct.
|
|
89
|
+
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist.
|
|
90
|
+
# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym
|
|
91
|
+
Style/TrivialAccessors:
|
|
92
|
+
Exclude:
|
|
93
|
+
- 'lib/rutl/base_page.rb'
|
data/README.md
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
[](https://coveralls.io/github/drewcoo/rutl?branch=master)
|
|
6
6
|
[](https://badge.fury.io/rb/rutl)
|
|
7
7
|
|
|
8
|
-
This is the Ruby Ui Test Library, or RUTL. Not to be confused with
|
|
9
|
-
https://www.rutles.org/
|
|
8
|
+
This is the Ruby Ui Test Library, or RUTL. Not to be confused with [The Rutles](https://www.rutles.org/).
|
|
10
9
|
|
|
11
10
|
Framework goals:
|
|
12
11
|
* Define what's on a page in an easy, flexible way. Easy page objects!
|
|
@@ -39,22 +38,22 @@ TODO: Write usage instructions here
|
|
|
39
38
|
|
|
40
39
|
## Roadmap
|
|
41
40
|
Coming up soon in almost no order:
|
|
42
|
-
* Make browser tests work on TravisCI.
|
|
43
41
|
* A test framework should have better tests. Goes with next bullet.
|
|
44
42
|
* Flesh out null interface/driver. Make them do what a real browser does.
|
|
45
|
-
* Make geckodriver work. Geckodriver-helper is failing me.
|
|
46
43
|
* Restructure tests to handle fake browsers and real browsers. Same structure?
|
|
47
|
-
* Make this work with pages in some other location so we can use it as a gem.
|
|
48
|
-
* Make work with TravisCI.
|
|
44
|
+
* Make this work with pages files in some other location so we can use it as a gem.
|
|
49
45
|
* Put more info in this readme.
|
|
50
46
|
* Take screenshots.
|
|
51
47
|
* Diff screenshots. Make this smart so we don't have to be experts.
|
|
52
|
-
* InternetExplorerDriver
|
|
48
|
+
* The webdriver gem should already include InternetExplorerDriver. Maybe run tests on AppVeyor.
|
|
53
49
|
* Other browser drivers? Look at https://github.com/fnando/browser
|
|
54
50
|
* Get this working with Appium:
|
|
55
51
|
* Make TK app to test on desktops and test it.
|
|
52
|
+
* Can Ruby TK create accesible apps?
|
|
56
53
|
* Make Android example app and get this to work.
|
|
54
|
+
* Corboba?
|
|
57
55
|
* Same with iPhone.
|
|
56
|
+
* Same Cordoba test app?
|
|
58
57
|
* Others?
|
|
59
58
|
* Spidering page object maker.
|
|
60
59
|
* Possibly pair the null browser with auto-generated pages for ______?
|
|
@@ -66,10 +65,12 @@ Coming up soon in almost no order:
|
|
|
66
65
|
## Development
|
|
67
66
|
|
|
68
67
|
Set everything up:
|
|
68
|
+
|
|
69
69
|
1. Check out the repo.
|
|
70
70
|
2. `cd` to the repo.
|
|
71
71
|
3. `bundle install`
|
|
72
72
|
4. `bundle exec rake`
|
|
73
|
+
|
|
73
74
|
Great! You've checked out the code, installed everything and run the tests.
|
|
74
75
|
|
|
75
76
|
Rubocop. I still have to tweak what I want it to complain about.
|
|
@@ -12,11 +12,7 @@ class BaseInterface
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
attr_reader :pages
|
|
15
|
-
|
|
16
|
-
# Child classes must implement current_page
|
|
17
|
-
|
|
18
15
|
attr_accessor :driver
|
|
19
|
-
|
|
20
16
|
attr_accessor :interface
|
|
21
17
|
|
|
22
18
|
def initialize(pages:)
|
|
@@ -27,7 +23,7 @@ class BaseInterface
|
|
|
27
23
|
|
|
28
24
|
def goto(input)
|
|
29
25
|
# TODO: KLUDGY. Fix. Modifier if usage bombs here. *shrug*
|
|
30
|
-
@driver.interface = @interface if
|
|
26
|
+
@driver.interface = @interface if @interface.class.to_s == 'NullInterface'
|
|
31
27
|
input = find_page(input) unless input.methods.include?(:url)
|
|
32
28
|
|
|
33
29
|
@driver.navigate.to input.url
|
|
@@ -59,7 +55,7 @@ class BaseInterface
|
|
|
59
55
|
target_states.each do |state|
|
|
60
56
|
next unless state.url == current_page.url
|
|
61
57
|
page = find_page(state, true)
|
|
62
|
-
return
|
|
58
|
+
return page if page.loaded?
|
|
63
59
|
end
|
|
64
60
|
raise current_page.to_s if current_page.class == InternetLoggedInPage
|
|
65
61
|
false
|
|
@@ -14,7 +14,7 @@ class ChromeInterface < BaseInterface
|
|
|
14
14
|
options.add_argument('--disable-popup-blocking')
|
|
15
15
|
options.add_argument('--disable-translate')
|
|
16
16
|
# Run headless on TravisCI
|
|
17
|
-
if '
|
|
17
|
+
if ENV['TRAVIS'] == 'true'
|
|
18
18
|
options.add_argument('--disable-gpu')
|
|
19
19
|
options.add_argument('--headless ')
|
|
20
20
|
options.add_argument('--no-sandbox')
|
|
@@ -13,6 +13,7 @@ class FirefoxInterface < BaseInterface
|
|
|
13
13
|
options.add_argument('--ignore-certificate-errors')
|
|
14
14
|
options.add_argument('--disable-popup-blocking')
|
|
15
15
|
options.add_argument('--disable-translate')
|
|
16
|
+
options.add_argument('--headless') if ENV['TRAVIS'] == 'true'
|
|
16
17
|
@driver = Selenium::WebDriver.for :firefox, options: options
|
|
17
18
|
super
|
|
18
19
|
end
|
data/lib/rutl/utilities.rb
CHANGED
data/lib/rutl/version.rb
CHANGED
data/rutl.gemspec
CHANGED
|
@@ -15,8 +15,6 @@ Gem::Specification.new do |spec|
|
|
|
15
15
|
spec.homepage = 'https://github.com/drewcoo/rutl'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
17
|
|
|
18
|
-
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
19
|
-
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
20
18
|
if spec.respond_to?(:metadata)
|
|
21
19
|
spec.metadata['allowed_push_host'] = 'https://rubygems.org/gems/rutl'
|
|
22
20
|
else
|
|
@@ -24,23 +22,22 @@ Gem::Specification.new do |spec|
|
|
|
24
22
|
'public gem pushes.'
|
|
25
23
|
end
|
|
26
24
|
|
|
27
|
-
spec.files
|
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
28
26
|
f.match(%r{^(test|spec|features)/})
|
|
29
27
|
end
|
|
30
|
-
spec.bindir
|
|
31
|
-
spec.executables
|
|
28
|
+
spec.bindir = 'exe'
|
|
29
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
32
30
|
spec.require_paths = ['lib']
|
|
33
31
|
|
|
34
32
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
spec.add_development_dependency 'coveralls' #@, require: false
|
|
39
|
-
#spec.add_development_dependency 'geckodriver-helper', '~> 0.20'
|
|
33
|
+
spec.add_development_dependency 'coveralls'
|
|
34
|
+
spec.add_development_dependency 'drewcoo-cops'
|
|
40
35
|
spec.add_development_dependency 'gem-release'
|
|
41
36
|
spec.add_development_dependency 'rake', '~> 12.3'
|
|
42
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
43
38
|
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.3'
|
|
44
39
|
spec.add_development_dependency 'rubocop', '~> 0.55'
|
|
40
|
+
spec.add_development_dependency 'rubocop-rspec'
|
|
45
41
|
spec.add_development_dependency 'selenium-webdriver', '~> 3.12'
|
|
42
|
+
spec.add_development_dependency 'webdrivers', '~> 3.0'
|
|
46
43
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rutl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Drew Cooper
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-05-
|
|
11
|
+
date: 2018-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -25,21 +25,21 @@ dependencies:
|
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.15'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
|
-
name:
|
|
28
|
+
name: coveralls
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - "
|
|
31
|
+
- - ">="
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: '
|
|
33
|
+
version: '0'
|
|
34
34
|
type: :development
|
|
35
35
|
prerelease: false
|
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
37
|
requirements:
|
|
38
|
-
- - "
|
|
38
|
+
- - ">="
|
|
39
39
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: '
|
|
40
|
+
version: '0'
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
|
-
name:
|
|
42
|
+
name: drewcoo-cops
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
45
|
- - ">="
|
|
@@ -122,6 +122,20 @@ dependencies:
|
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0.55'
|
|
125
|
+
- !ruby/object:Gem::Dependency
|
|
126
|
+
name: rubocop-rspec
|
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
|
128
|
+
requirements:
|
|
129
|
+
- - ">="
|
|
130
|
+
- !ruby/object:Gem::Version
|
|
131
|
+
version: '0'
|
|
132
|
+
type: :development
|
|
133
|
+
prerelease: false
|
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
+
requirements:
|
|
136
|
+
- - ">="
|
|
137
|
+
- !ruby/object:Gem::Version
|
|
138
|
+
version: '0'
|
|
125
139
|
- !ruby/object:Gem::Dependency
|
|
126
140
|
name: selenium-webdriver
|
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,6 +150,20 @@ dependencies:
|
|
|
136
150
|
- - "~>"
|
|
137
151
|
- !ruby/object:Gem::Version
|
|
138
152
|
version: '3.12'
|
|
153
|
+
- !ruby/object:Gem::Dependency
|
|
154
|
+
name: webdrivers
|
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
|
156
|
+
requirements:
|
|
157
|
+
- - "~>"
|
|
158
|
+
- !ruby/object:Gem::Version
|
|
159
|
+
version: '3.0'
|
|
160
|
+
type: :development
|
|
161
|
+
prerelease: false
|
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
+
requirements:
|
|
164
|
+
- - "~>"
|
|
165
|
+
- !ruby/object:Gem::Version
|
|
166
|
+
version: '3.0'
|
|
139
167
|
description: DANGER!!! DO NOT USE YET!!! This is a UI library under construction and
|
|
140
168
|
only name-squatting for the moment.
|
|
141
169
|
email:
|
|
@@ -149,6 +177,7 @@ files:
|
|
|
149
177
|
- ".gitignore"
|
|
150
178
|
- ".rspec"
|
|
151
179
|
- ".rubocop.yml"
|
|
180
|
+
- ".rubocop_todo.yml"
|
|
152
181
|
- ".travis.yml"
|
|
153
182
|
- Gemfile
|
|
154
183
|
- LICENSE.txt
|