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 +4 -4
- data/lib/chemlab.rb +23 -11
- data/lib/chemlab/configuration.rb +1 -1
- data/lib/chemlab/element.rb +1 -0
- data/lib/chemlab/page.rb +1 -1
- data/lib/chemlab/runtime/browser.rb +7 -8
- data/lib/chemlab/version.rb +1 -1
- metadata +21 -49
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00a1c588841cfdf0f8573076066f50bd4786315f4c71e5c665c8b2da6458653b
|
4
|
+
data.tar.gz: 612c4d98d9a4fe30c586993f0983843c2828fb4345cd2105c3747c5ca06de600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/chemlab/element.rb
CHANGED
data/lib/chemlab/page.rb
CHANGED
@@ -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.
|
17
|
+
Chemlab.configuration.browser.navigate_to(page_class.path)
|
20
18
|
end
|
21
19
|
|
22
|
-
def navigate_to(
|
23
|
-
@session
|
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(
|
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
|
data/lib/chemlab/version.rb
CHANGED
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.
|
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:
|
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:
|
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:
|
124
|
-
type: :
|
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:
|
102
|
+
version: '3.7'
|
131
103
|
- !ruby/object:Gem::Dependency
|
132
|
-
name:
|
104
|
+
name: rspec-retry
|
133
105
|
requirement: !ruby/object:Gem::Requirement
|
134
106
|
requirements:
|
135
107
|
- - "~>"
|
136
108
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
138
|
-
type: :
|
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:
|
116
|
+
version: 0.6.1
|
145
117
|
- !ruby/object:Gem::Dependency
|
146
|
-
name:
|
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:
|
152
|
-
type: :
|
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:
|
130
|
+
version: 0.4.1
|
159
131
|
- !ruby/object:Gem::Dependency
|
160
|
-
name:
|
132
|
+
name: nokogiri
|
161
133
|
requirement: !ruby/object:Gem::Requirement
|
162
134
|
requirements:
|
163
135
|
- - "~>"
|
164
136
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
166
|
-
type: :
|
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:
|
144
|
+
version: 1.10.9
|
173
145
|
- !ruby/object:Gem::Dependency
|
174
|
-
name:
|
146
|
+
name: rake
|
175
147
|
requirement: !ruby/object:Gem::Requirement
|
176
148
|
requirements:
|
177
149
|
- - "~>"
|
178
150
|
- !ruby/object:Gem::Version
|
179
|
-
version:
|
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:
|
158
|
+
version: 12.3.0
|
187
159
|
- !ruby/object:Gem::Dependency
|
188
160
|
name: selenium-webdriver
|
189
161
|
requirement: !ruby/object:Gem::Requirement
|