chemlab 0.1.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f82c920b4402cead6b7bced74d33d7517d6af16df04c93e8b50c852a691c7ead
4
- data.tar.gz: 9934077c6073531b4251c3839ff3b02faa736642165039db57039ebdd4849b1c
3
+ metadata.gz: 2f0b5037bcd95b14883e19ae66a22f4a217d7f7039f8415e5c4b3a83cbde48a4
4
+ data.tar.gz: 1adda9dc72c6e0cba6d591d480400ad9814d1a48240f8f6de8a6bb1c7b400c18
5
5
  SHA512:
6
- metadata.gz: 4db0c48669a8f13199bd35760cf890ed76c4d4ff2e83897a062ad14424b4b3960ac7be2dcf055f41643ceb0931eebccea638bfa93789a36659f450129de445e0
7
- data.tar.gz: 7c756ff0d2fb485b0a394f07ce84309e08c5a80b5e94854d11523ff1e9ec73ac2f3af2f0570963ad7ec4f2ce609884f0e83b95e56d07462479561c4e1499d3f5
6
+ metadata.gz: 9809aa90b7ac8430e7b1e437cffb8ba29f8399f02f8444df0442fc566bfc5c2ee2e658bc9366068e794da81ac3b497b313b8ae185f0f1d470f563375946f68d6
7
+ data.tar.gz: cb791af4b7fd2c0ee1befc8e0f915a075f88c516a6dae65d18c2a89921af0632866a053e677823e4a30ab2a946594eb5f93ec15fcea552726ffe2340dedf58ee
@@ -16,6 +16,16 @@ module Chemlab
16
16
  @browser = Runtime::Browser.new(browser)
17
17
  end
18
18
 
19
+ attr_reader :libraries
20
+ # Specify which libraries to load
21
+ def libraries=(libraries = [])
22
+ @libraries = Chemlab.const_set('Vendor', Module.new)
23
+
24
+ libraries.each do |library|
25
+ @libraries.const_set(library.to_s, library)
26
+ end
27
+ end
28
+
19
29
  # Call RSpec.configure for additional configuration
20
30
  def configure_rspec
21
31
  RSpec.configure do |rspec|
@@ -8,6 +8,7 @@ module Chemlab
8
8
  link
9
9
  checkbox
10
10
  image
11
+ radio
11
12
  ].freeze
12
13
 
13
14
  SELECTABLES = %i[
data/lib/chemlab/page.rb CHANGED
@@ -4,7 +4,7 @@ module Chemlab
4
4
  # Representation of a Page on the UI
5
5
  class Page < Component
6
6
 
7
- attribute :url
7
+ attribute :path
8
8
 
9
9
  def visit
10
10
  Runtime::Browser.navigate_to(self.class)
@@ -1,36 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'active_support/configurable'
4
-
5
3
  module Chemlab
6
4
  module Runtime
7
5
  # The browser configurator
8
6
  class Browser
9
7
  extend SingleForwardable
10
- include ActiveSupport::Configurable
11
8
  attr_accessor :session
12
9
  attr_reader :browser_options
13
10
 
14
11
  def initialize(browser_options)
15
12
  @browser_options = browser_options
13
+ @session = Session.new(browser_options)
16
14
  end
17
15
 
18
16
  def self.navigate_to(page_class)
19
- Chemlab.configuration.browser.navigate_to(page_class.url)
17
+ Chemlab.configuration.browser.navigate_to(page_class.path)
20
18
  end
21
19
 
22
- def navigate_to(url)
23
- @session = Chemlab.configuration.browser.session ||= Session.new(url, browser_options)
20
+ def navigate_to(path)
21
+ @session ||= Chemlab.configuration.browser.session
22
+ @session.engine.goto(Chemlab.configuration.base_url + path)
24
23
  end
25
24
 
26
25
  # An individual session
27
26
  class Session
28
27
  attr_reader :engine
29
28
 
30
- def initialize(url, browser)
29
+ def initialize(browser)
31
30
  @engine = Watir::Browser.new(*browser)
32
31
 
33
- @engine.goto(Chemlab.configuration.base_url)
32
+ # @engine.goto(Chemlab.configuration.base_url)
34
33
  end
35
34
 
36
35
  def current_url
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chemlab
4
- VERSION = '0.1.0'
4
+ VERSION = '0.4.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chemlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GitLab Quality
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-07 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -87,103 +87,75 @@ dependencies:
87
87
  - !ruby/object:Gem::Version
88
88
  version: 0.9.1
89
89
  - !ruby/object:Gem::Dependency
90
- name: activesupport
91
- requirement: !ruby/object:Gem::Requirement
92
- requirements:
93
- - - "~>"
94
- - !ruby/object:Gem::Version
95
- version: 6.0.2.2
96
- type: :runtime
97
- prerelease: false
98
- version_requirements: !ruby/object:Gem::Requirement
99
- requirements:
100
- - - "~>"
101
- - !ruby/object:Gem::Version
102
- version: 6.0.2.2
103
- - !ruby/object:Gem::Dependency
104
- name: airborne
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: 0.2.13
110
- type: :runtime
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: 0.2.13
117
- - !ruby/object:Gem::Dependency
118
- name: nokogiri
90
+ name: rspec
119
91
  requirement: !ruby/object:Gem::Requirement
120
92
  requirements:
121
93
  - - "~>"
122
94
  - !ruby/object:Gem::Version
123
- version: 1.10.9
124
- type: :runtime
95
+ version: '3.7'
96
+ type: :development
125
97
  prerelease: false
126
98
  version_requirements: !ruby/object:Gem::Requirement
127
99
  requirements:
128
100
  - - "~>"
129
101
  - !ruby/object:Gem::Version
130
- version: 1.10.9
102
+ version: '3.7'
131
103
  - !ruby/object:Gem::Dependency
132
- name: rake
104
+ name: rspec-retry
133
105
  requirement: !ruby/object:Gem::Requirement
134
106
  requirements:
135
107
  - - "~>"
136
108
  - !ruby/object:Gem::Version
137
- version: 12.3.0
138
- type: :runtime
109
+ version: 0.6.1
110
+ type: :development
139
111
  prerelease: false
140
112
  version_requirements: !ruby/object:Gem::Requirement
141
113
  requirements:
142
114
  - - "~>"
143
115
  - !ruby/object:Gem::Version
144
- version: 12.3.0
116
+ version: 0.6.1
145
117
  - !ruby/object:Gem::Dependency
146
- name: rspec
118
+ name: rspec_junit_formatter
147
119
  requirement: !ruby/object:Gem::Requirement
148
120
  requirements:
149
121
  - - "~>"
150
122
  - !ruby/object:Gem::Version
151
- version: '3.7'
152
- type: :runtime
123
+ version: 0.4.1
124
+ type: :development
153
125
  prerelease: false
154
126
  version_requirements: !ruby/object:Gem::Requirement
155
127
  requirements:
156
128
  - - "~>"
157
129
  - !ruby/object:Gem::Version
158
- version: '3.7'
130
+ version: 0.4.1
159
131
  - !ruby/object:Gem::Dependency
160
- name: rspec-retry
132
+ name: nokogiri
161
133
  requirement: !ruby/object:Gem::Requirement
162
134
  requirements:
163
135
  - - "~>"
164
136
  - !ruby/object:Gem::Version
165
- version: 0.6.1
166
- type: :runtime
137
+ version: 1.10.9
138
+ type: :development
167
139
  prerelease: false
168
140
  version_requirements: !ruby/object:Gem::Requirement
169
141
  requirements:
170
142
  - - "~>"
171
143
  - !ruby/object:Gem::Version
172
- version: 0.6.1
144
+ version: 1.10.9
173
145
  - !ruby/object:Gem::Dependency
174
- name: rspec_junit_formatter
146
+ name: rake
175
147
  requirement: !ruby/object:Gem::Requirement
176
148
  requirements:
177
149
  - - "~>"
178
150
  - !ruby/object:Gem::Version
179
- version: 0.4.1
151
+ version: 12.3.0
180
152
  type: :runtime
181
153
  prerelease: false
182
154
  version_requirements: !ruby/object:Gem::Requirement
183
155
  requirements:
184
156
  - - "~>"
185
157
  - !ruby/object:Gem::Version
186
- version: 0.4.1
158
+ version: 12.3.0
187
159
  - !ruby/object:Gem::Dependency
188
160
  name: selenium-webdriver
189
161
  requirement: !ruby/object:Gem::Requirement