chemlab 0.2.0 → 0.5.0

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: 73e83a84ab7f922018db0d907b81f78c94db589fc76ec38fbef6b9ddeda4dd75
4
- data.tar.gz: e5c5de40de3781d65bd1ae9a08b1a60edf59e3e08fd18ad34fadc5fd87537234
3
+ metadata.gz: 00a1c588841cfdf0f8573076066f50bd4786315f4c71e5c665c8b2da6458653b
4
+ data.tar.gz: 612c4d98d9a4fe30c586993f0983843c2828fb4345cd2105c3747c5ca06de600
5
5
  SHA512:
6
- metadata.gz: 48258bdf4fb43b50f7a92aca8c889656c9e137b83b016c7f65a4462415272fcdac4836e8445b2c0704055159702e1b0b8fcd485111be6cd27abaac9ecaac0b07
7
- data.tar.gz: cc20189ed0de8989635305e004070c25deec1f3f6a2ac3d5124ed6ddb99750b2ff29e912fa25c8f90cff0db15fa7f4180a22de982ecb0ee38f9b18b3df13e1f3
6
+ metadata.gz: 70c8e8a197a50706ca69372bdb5a24e2dc14649e9acbc93078bfbbc43a511b7afeccdfa532910c07e19791517d0d5b92eaaea1439f6f26a8a3cd0ec545047c48
7
+ data.tar.gz: 817a087756bb8ff415c68cd7feaff9443adfde8881d7c0a44e05de15840ee03220215a32554ea52163713f29c978e6583d31640e53a065942d79ad0e1547d2dc
data/lib/chemlab.rb CHANGED
@@ -2,20 +2,11 @@
2
2
 
3
3
  require 'watir'
4
4
 
5
- require 'chemlab/configuration'
6
- require 'chemlab/attributable'
7
- require 'chemlab/runtime/env'
8
- require 'chemlab/runtime/browser'
9
- require 'chemlab/element'
10
- require 'chemlab/component'
11
- require 'chemlab/page'
12
- require 'chemlab/support/api'
13
- require 'chemlab/api_fabricator'
14
- require 'chemlab/resource'
15
-
16
5
  # Chemlaboratory
17
6
  module Chemlab
18
7
 
8
+ autoload :Version, 'chemlab/version'
9
+
19
10
  # Yields the global configuration to a block.
20
11
  # @yield [Configuration] global configuration
21
12
  #
@@ -37,4 +28,25 @@ module Chemlab
37
28
  def self.configuration
38
29
  @configuration ||= Chemlab::Configuration.new
39
30
  end
31
+
32
+ autoload :Configuration, 'chemlab/configuration'
33
+ autoload :Attributable, 'chemlab/attributable'
34
+
35
+ autoload :Element, 'chemlab/element'
36
+ autoload :Component, 'chemlab/component'
37
+ autoload :Page, 'chemlab/page'
38
+
39
+ autoload :ApiFabricator, 'chemlab/api_fabricator'
40
+ autoload :Resource, 'chemlab/resource'
41
+
42
+ # Runtime modules
43
+ module Runtime
44
+ autoload :Env, 'chemlab/runtime/env'
45
+ autoload :Browser, 'chemlab/runtime/browser'
46
+ end
47
+
48
+ # Support modules
49
+ module Support
50
+ autoload :API, 'chemlab/support/api'
51
+ end
40
52
  end
@@ -18,7 +18,7 @@ module Chemlab
18
18
 
19
19
  attr_reader :libraries
20
20
  # Specify which libraries to load
21
- def libraries=(libraries=[])
21
+ def libraries=(libraries = [])
22
22
  @libraries = Chemlab.const_set('Vendor', Module.new)
23
23
 
24
24
  libraries.each do |library|
@@ -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 + 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.2.0'
4
+ VERSION = '0.5.0'
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.2.0
4
+ version: 0.5.0
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-08 00:00:00.000000000 Z
11
+ date: 2021-04-28 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