chemlab-library-gitlab 0.1.2 → 0.3.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: 2b4e2b3946fef05633847245425614d5004e72cdd241603bd2fcbc86a4ce3ee4
4
- data.tar.gz: 6adf3cef1ec62d576269e7b78c7ff4bf541d433c8dc0e84fdd81c4b3c026523b
3
+ metadata.gz: 30821fc01c0f8e1691aadebbcdbb4d2e886e54e3f17d036248a3c04e893600c9
4
+ data.tar.gz: a18473605dca2fc4dffc4750a9362c38b612400e403ef8c2d201e45a856a9c96
5
5
  SHA512:
6
- metadata.gz: 5954531be7647ef9983d3f06f174e478f54c2a427016be7f188bcb5b9e718657e72b25781f13066ed105de94d4b4fd5fed792eb521164c86e1b6b805298f90f8
7
- data.tar.gz: 49c2ef0e20512e996b052d019696d677f2f30361e21fc018698193dd0f10e02624bbe18edf11b3c48ea8c4c8f485921bf6b1b50dcf1222c8d48db98680c29c89
6
+ metadata.gz: 544723f16c6920fe46de36f589d0555cd49601bcd6be51d47ecb9b5c10b971667d0091a04723f319181710ddba7ff22886f7f669fa8e92e138c6b39867340346
7
+ data.tar.gz: 193e9acadf9c47f9204c02d184ef5f1c2ce490044c6d787fce02562676cbad93f0fec7859439649fbde32c476a3f1667d19abc301cc0331f634e24bb9f00ff10
@@ -10,11 +10,27 @@ module Gitlab
10
10
  text_field :password_field
11
11
  button :sign_in_button
12
12
 
13
- def sign_in_as(username:, password:)
13
+ button :accept_terms, text: 'Accept terms'
14
+
15
+ # password change tab
16
+ text_field :password_confirmation_field
17
+ button :change_password_button
18
+
19
+ # Sign in using a given username and password
20
+ # @note this will also automatically accept terms if prompted
21
+ # @param [String] username the username to sign in with
22
+ # @param [String] password the password to sign in with
23
+ # @example
24
+ # Page::Main::Login.perform do |login|
25
+ # login.sign_in_as(username: 'username', password: 'password')
26
+ # login.sign_in_as(username: 'username', password: 'password', accept_terms: false)
27
+ # end
28
+ def sign_in_as(username:, password:, accept_terms: true)
14
29
  self.login_field = username
15
30
  self.password_field = password
16
31
 
17
32
  sign_in_button
33
+ self.accept_terms if accept_terms && accept_terms?
18
34
  end
19
35
  end
20
36
  end
@@ -95,6 +95,88 @@ module Gitlab
95
95
  def sign_in_button?
96
96
  # This is a stub, used for indexing. The method is dynamically generated.
97
97
  end
98
+
99
+ # @note Defined as +button :accept_terms+
100
+ # Clicks +accept_terms+
101
+ def accept_terms
102
+ # This is a stub, used for indexing. The method is dynamically generated.
103
+ end
104
+
105
+ # @example
106
+ # Gitlab::Page::Main::Login.perform do |login|
107
+ # expect(login.accept_terms_element).to exist
108
+ # end
109
+ # @return [Watir::Button] The raw +Button+ element
110
+ def accept_terms_element
111
+ # This is a stub, used for indexing. The method is dynamically generated.
112
+ end
113
+
114
+ # @example
115
+ # Gitlab::Page::Main::Login.perform do |login|
116
+ # expect(login).to be_accept_terms
117
+ # end
118
+ # @return [Boolean] true if the +accept_terms+ element is present on the page
119
+ def accept_terms?
120
+ # This is a stub, used for indexing. The method is dynamically generated.
121
+ end
122
+
123
+ # @note Defined as +text_field :password_confirmation_field+
124
+ # @return [String] The text content or value of +password_confirmation_field+
125
+ def password_confirmation_field
126
+ # This is a stub, used for indexing. The method is dynamically generated.
127
+ end
128
+
129
+ # Set the value of password_confirmation_field
130
+ # @example
131
+ # Gitlab::Page::Main::Login.perform do |login|
132
+ # login.password_confirmation_field = 'value'
133
+ # end
134
+ # @param value [String] The value to set.
135
+ def password_confirmation_field=(value)
136
+ # This is a stub, used for indexing. The method is dynamically generated.
137
+ end
138
+
139
+ # @example
140
+ # Gitlab::Page::Main::Login.perform do |login|
141
+ # expect(login.password_confirmation_field_element).to exist
142
+ # end
143
+ # @return [Watir::TextField] The raw +TextField+ element
144
+ def password_confirmation_field_element
145
+ # This is a stub, used for indexing. The method is dynamically generated.
146
+ end
147
+
148
+ # @example
149
+ # Gitlab::Page::Main::Login.perform do |login|
150
+ # expect(login).to be_password_confirmation_field
151
+ # end
152
+ # @return [Boolean] true if the +password_confirmation_field+ element is present on the page
153
+ def password_confirmation_field?
154
+ # This is a stub, used for indexing. The method is dynamically generated.
155
+ end
156
+
157
+ # @note Defined as +button :change_password_button+
158
+ # Clicks +change_password_button+
159
+ def change_password_button
160
+ # This is a stub, used for indexing. The method is dynamically generated.
161
+ end
162
+
163
+ # @example
164
+ # Gitlab::Page::Main::Login.perform do |login|
165
+ # expect(login.change_password_button_element).to exist
166
+ # end
167
+ # @return [Watir::Button] The raw +Button+ element
168
+ def change_password_button_element
169
+ # This is a stub, used for indexing. The method is dynamically generated.
170
+ end
171
+
172
+ # @example
173
+ # Gitlab::Page::Main::Login.perform do |login|
174
+ # expect(login).to be_change_password_button
175
+ # end
176
+ # @return [Boolean] true if the +change_password_button+ element is present on the page
177
+ def change_password_button?
178
+ # This is a stub, used for indexing. The method is dynamically generated.
179
+ end
98
180
  end
99
181
  end
100
182
  end
data/lib/gitlab.rb CHANGED
@@ -1,22 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'chemlab/library'
4
+
3
5
  # Chemlab Page Libraries for GitLab
4
6
  module Gitlab
7
+ include Chemlab::Library
8
+
5
9
  module Page
6
10
  module Main
7
11
  autoload :Login, 'gitlab/page/main/login'
8
- autoload :SignUp, 'gitlab/page/main/sign_up'
9
12
  end
10
13
 
11
14
  module Subscriptions
12
15
  autoload :New, 'gitlab/page/subscriptions/new'
13
16
  end
14
17
 
15
- module Admin
16
- autoload :Dashboard, 'gitlab/page/admin/dashboard'
17
- autoload :Subscription, 'gitlab/page/admin/subscription'
18
- end
19
-
20
18
  module Group
21
19
  module Settings
22
20
  autoload :Billing, 'gitlab/page/group/settings/billing'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chemlab-library-gitlab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.3.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: 2021-09-14 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chemlab
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.7'
19
+ version: '0.9'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.7'
26
+ version: '0.9'
27
27
  description:
28
28
  email:
29
29
  - quality@gitlab.com
@@ -32,16 +32,10 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - lib/gitlab.rb
35
- - lib/gitlab/page/admin/dashboard.rb
36
- - lib/gitlab/page/admin/dashboard.stub.rb
37
- - lib/gitlab/page/admin/subscription.rb
38
- - lib/gitlab/page/admin/subscription.stub.rb
39
35
  - lib/gitlab/page/group/settings/billing.rb
40
36
  - lib/gitlab/page/group/settings/billing.stub.rb
41
37
  - lib/gitlab/page/main/login.rb
42
38
  - lib/gitlab/page/main/login.stub.rb
43
- - lib/gitlab/page/main/sign_up.rb
44
- - lib/gitlab/page/main/sign_up.stub.rb
45
39
  - lib/gitlab/page/subscriptions/new.rb
46
40
  - lib/gitlab/page/subscriptions/new.stub.rb
47
41
  homepage: https://gitlab.com/
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Admin
6
- class Dashboard < Chemlab::Page
7
- path '/admin'
8
-
9
- h2 :users_in_license
10
- h2 :billable_users
11
- h3 :number_of_users
12
- end
13
- end
14
- end
15
- end
@@ -1,81 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Admin
6
- module Dashboard
7
- # @note Defined as +h2 :users_in_license+
8
- # @return [String] The text content or value of +users_in_license+
9
- def users_in_license
10
- # This is a stub, used for indexing. The method is dynamically generated.
11
- end
12
-
13
- # @example
14
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
15
- # expect(dashboard.users_in_license_element).to exist
16
- # end
17
- # @return [Watir::H2] The raw +H2+ element
18
- def users_in_license_element
19
- # This is a stub, used for indexing. The method is dynamically generated.
20
- end
21
-
22
- # @example
23
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
24
- # expect(dashboard).to be_users_in_license
25
- # end
26
- # @return [Boolean] true if the +users_in_license+ element is present on the page
27
- def users_in_license?
28
- # This is a stub, used for indexing. The method is dynamically generated.
29
- end
30
-
31
- # @note Defined as +h2 :billable_users+
32
- # @return [String] The text content or value of +billable_users+
33
- def billable_users
34
- # This is a stub, used for indexing. The method is dynamically generated.
35
- end
36
-
37
- # @example
38
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
39
- # expect(dashboard.billable_users_element).to exist
40
- # end
41
- # @return [Watir::H2] The raw +H2+ element
42
- def billable_users_element
43
- # This is a stub, used for indexing. The method is dynamically generated.
44
- end
45
-
46
- # @example
47
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
48
- # expect(dashboard).to be_billable_users
49
- # end
50
- # @return [Boolean] true if the +billable_users+ element is present on the page
51
- def billable_users?
52
- # This is a stub, used for indexing. The method is dynamically generated.
53
- end
54
-
55
- # @note Defined as +h3 :number_of_users+
56
- # @return [String] The text content or value of +number_of_users+
57
- def number_of_users
58
- # This is a stub, used for indexing. The method is dynamically generated.
59
- end
60
-
61
- # @example
62
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
63
- # expect(dashboard.number_of_users_element).to exist
64
- # end
65
- # @return [Watir::H3] The raw +H3+ element
66
- def number_of_users_element
67
- # This is a stub, used for indexing. The method is dynamically generated.
68
- end
69
-
70
- # @example
71
- # Gitlab::Page::Admin::Dashboard.perform do |dashboard|
72
- # expect(dashboard).to be_number_of_users
73
- # end
74
- # @return [Boolean] true if the +number_of_users+ element is present on the page
75
- def number_of_users?
76
- # This is a stub, used for indexing. The method is dynamically generated.
77
- end
78
- end
79
- end
80
- end
81
- end
@@ -1,13 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Admin
6
- class Subscription < Chemlab::Page
7
- path '/admin/subscription'
8
-
9
- h2 :users_in_subscription
10
- end
11
- end
12
- end
13
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Admin
6
- module Subscription
7
- # @note Defined as +h2 :users_in_subscription+
8
- # @return [String] The text content or value of +users_in_subscription+
9
- def users_in_subscription
10
- # This is a stub, used for indexing. The method is dynamically generated.
11
- end
12
-
13
- # @example
14
- # Gitlab::Page::Admin::Subscription.perform do |subscription|
15
- # expect(subscription.users_in_subscription_element).to exist
16
- # end
17
- # @return [Watir::H2] The raw +H2+ element
18
- def users_in_subscription_element
19
- # This is a stub, used for indexing. The method is dynamically generated.
20
- end
21
-
22
- # @example
23
- # Gitlab::Page::Admin::Subscription.perform do |subscription|
24
- # expect(subscription).to be_users_in_subscription
25
- # end
26
- # @return [Boolean] true if the +users_in_subscription+ element is present on the page
27
- def users_in_subscription?
28
- # This is a stub, used for indexing. The method is dynamically generated.
29
- end
30
- end
31
- end
32
- end
33
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Main
6
- class SignUp < Chemlab::Page
7
- path '/users/sign_up'
8
-
9
- # TODO: Refactor data-qa-selectors to be more terse
10
- text_field :first_name, 'data-qa-selector': 'new_user_first_name_field'
11
- text_field :last_name, 'data-qa-selector': 'new_user_last_name_field'
12
-
13
- text_field :username, 'data-qa-selector': 'new_user_username_field'
14
-
15
- text_field :email, 'data-qa-selector': 'new_user_email_field'
16
- text_field :password, 'data-qa-selector': 'new_user_password_field'
17
-
18
- button :register, 'data-qa-selector': 'new_user_register_button'
19
-
20
- # Register a user
21
- # @param [Resource::User] user the user to register
22
- def register_user(user)
23
- raise ArgumentError, 'User must be of type Resource::User' unless user.is_a? ::QA::Resource::User
24
-
25
- self.first_name = user.first_name
26
- self.last_name = user.last_name
27
- self.username = user.username
28
- self.email = user.email
29
- self.password = user.password
30
-
31
- self.register
32
- end
33
- end
34
- end
35
- end
36
- end
@@ -1,203 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Gitlab
4
- module Page
5
- module Main
6
- module SignUp
7
- # @note Defined as +text_field :first_name+
8
- # @return [String] The text content or value of +first_name+
9
- def first_name
10
- # This is a stub, used for indexing. The method is dynamically generated.
11
- end
12
-
13
- # Set the value of first_name
14
- # @example
15
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
16
- # sign_up.first_name = 'value'
17
- # end
18
- # @param value [String] The value to set.
19
- def first_name=(value)
20
- # This is a stub, used for indexing. The method is dynamically generated.
21
- end
22
-
23
- # @example
24
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
25
- # expect(sign_up.first_name_element).to exist
26
- # end
27
- # @return [Watir::TextField] The raw +TextField+ element
28
- def first_name_element
29
- # This is a stub, used for indexing. The method is dynamically generated.
30
- end
31
-
32
- # @example
33
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
34
- # expect(sign_up).to be_first_name
35
- # end
36
- # @return [Boolean] true if the +first_name+ element is present on the page
37
- def first_name?
38
- # This is a stub, used for indexing. The method is dynamically generated.
39
- end
40
-
41
- # @note Defined as +text_field :last_name+
42
- # @return [String] The text content or value of +last_name+
43
- def last_name
44
- # This is a stub, used for indexing. The method is dynamically generated.
45
- end
46
-
47
- # Set the value of last_name
48
- # @example
49
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
50
- # sign_up.last_name = 'value'
51
- # end
52
- # @param value [String] The value to set.
53
- def last_name=(value)
54
- # This is a stub, used for indexing. The method is dynamically generated.
55
- end
56
-
57
- # @example
58
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
59
- # expect(sign_up.last_name_element).to exist
60
- # end
61
- # @return [Watir::TextField] The raw +TextField+ element
62
- def last_name_element
63
- # This is a stub, used for indexing. The method is dynamically generated.
64
- end
65
-
66
- # @example
67
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
68
- # expect(sign_up).to be_last_name
69
- # end
70
- # @return [Boolean] true if the +last_name+ element is present on the page
71
- def last_name?
72
- # This is a stub, used for indexing. The method is dynamically generated.
73
- end
74
-
75
- # @note Defined as +text_field :username+
76
- # @return [String] The text content or value of +username+
77
- def username
78
- # This is a stub, used for indexing. The method is dynamically generated.
79
- end
80
-
81
- # Set the value of username
82
- # @example
83
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
84
- # sign_up.username = 'value'
85
- # end
86
- # @param value [String] The value to set.
87
- def username=(value)
88
- # This is a stub, used for indexing. The method is dynamically generated.
89
- end
90
-
91
- # @example
92
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
93
- # expect(sign_up.username_element).to exist
94
- # end
95
- # @return [Watir::TextField] The raw +TextField+ element
96
- def username_element
97
- # This is a stub, used for indexing. The method is dynamically generated.
98
- end
99
-
100
- # @example
101
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
102
- # expect(sign_up).to be_username
103
- # end
104
- # @return [Boolean] true if the +username+ element is present on the page
105
- def username?
106
- # This is a stub, used for indexing. The method is dynamically generated.
107
- end
108
-
109
- # @note Defined as +text_field :email+
110
- # @return [String] The text content or value of +email+
111
- def email
112
- # This is a stub, used for indexing. The method is dynamically generated.
113
- end
114
-
115
- # Set the value of email
116
- # @example
117
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
118
- # sign_up.email = 'value'
119
- # end
120
- # @param value [String] The value to set.
121
- def email=(value)
122
- # This is a stub, used for indexing. The method is dynamically generated.
123
- end
124
-
125
- # @example
126
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
127
- # expect(sign_up.email_element).to exist
128
- # end
129
- # @return [Watir::TextField] The raw +TextField+ element
130
- def email_element
131
- # This is a stub, used for indexing. The method is dynamically generated.
132
- end
133
-
134
- # @example
135
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
136
- # expect(sign_up).to be_email
137
- # end
138
- # @return [Boolean] true if the +email+ element is present on the page
139
- def email?
140
- # This is a stub, used for indexing. The method is dynamically generated.
141
- end
142
-
143
- # @note Defined as +text_field :password+
144
- # @return [String] The text content or value of +password+
145
- def password
146
- # This is a stub, used for indexing. The method is dynamically generated.
147
- end
148
-
149
- # Set the value of password
150
- # @example
151
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
152
- # sign_up.password = 'value'
153
- # end
154
- # @param value [String] The value to set.
155
- def password=(value)
156
- # This is a stub, used for indexing. The method is dynamically generated.
157
- end
158
-
159
- # @example
160
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
161
- # expect(sign_up.password_element).to exist
162
- # end
163
- # @return [Watir::TextField] The raw +TextField+ element
164
- def password_element
165
- # This is a stub, used for indexing. The method is dynamically generated.
166
- end
167
-
168
- # @example
169
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
170
- # expect(sign_up).to be_password
171
- # end
172
- # @return [Boolean] true if the +password+ element is present on the page
173
- def password?
174
- # This is a stub, used for indexing. The method is dynamically generated.
175
- end
176
-
177
- # @note Defined as +button :register+
178
- # Clicks +register+
179
- def register
180
- # This is a stub, used for indexing. The method is dynamically generated.
181
- end
182
-
183
- # @example
184
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
185
- # expect(sign_up.register_element).to exist
186
- # end
187
- # @return [Watir::Button] The raw +Button+ element
188
- def register_element
189
- # This is a stub, used for indexing. The method is dynamically generated.
190
- end
191
-
192
- # @example
193
- # Gitlab::Page::Main::SignUp.perform do |sign_up|
194
- # expect(sign_up).to be_register
195
- # end
196
- # @return [Boolean] true if the +register+ element is present on the page
197
- def register?
198
- # This is a stub, used for indexing. The method is dynamically generated.
199
- end
200
- end
201
- end
202
- end
203
- end