qa.rb 13.9 KB
Newer Older
1 2
# frozen_string_literal: true

3
$: << File.expand_path(File.dirname(__FILE__))
4

5 6
Encoding.default_external = 'UTF-8'

7 8 9
require_relative '../lib/gitlab'
require_relative '../config/initializers/0_inject_enterprise_edition_module'

10 11 12 13 14
module QA
  ##
  # GitLab QA runtime classes, mostly singletons.
  #
  module Runtime
15
    autoload :Release, 'qa/runtime/release'
16 17
    autoload :User, 'qa/runtime/user'
    autoload :Namespace, 'qa/runtime/namespace'
18
    autoload :Scenario, 'qa/runtime/scenario'
19
    autoload :Browser, 'qa/runtime/browser'
20
    autoload :Env, 'qa/runtime/env'
21
    autoload :Address, 'qa/runtime/address'
M
Mark Lapierre 已提交
22
    autoload :Path, 'qa/runtime/path'
23
    autoload :Feature, 'qa/runtime/feature'
M
Mark Lapierre 已提交
24
    autoload :Fixtures, 'qa/runtime/fixtures'
M
Mark Lapierre 已提交
25
    autoload :Logger, 'qa/runtime/logger'
26 27 28 29 30

    module API
      autoload :Client, 'qa/runtime/api/client'
      autoload :Request, 'qa/runtime/api/request'
    end
31 32

    module Key
33
      autoload :Base, 'qa/runtime/key/base'
34
      autoload :RSA, 'qa/runtime/key/rsa'
35 36
      autoload :ECDSA, 'qa/runtime/key/ecdsa'
      autoload :ED25519, 'qa/runtime/key/ed25519'
37
    end
38 39
  end

40 41 42
  ##
  # GitLab QA fabrication mechanisms
  #
L
Lin Jen-Shin 已提交
43 44 45
  module Resource
    autoload :ApiFabricator, 'qa/resource/api_fabricator'
    autoload :Base, 'qa/resource/base'
46

L
Lin Jen-Shin 已提交
47 48 49 50 51 52 53 54 55 56
    autoload :Sandbox, 'qa/resource/sandbox'
    autoload :Group, 'qa/resource/group'
    autoload :Issue, 'qa/resource/issue'
    autoload :Project, 'qa/resource/project'
    autoload :Label, 'qa/resource/label'
    autoload :MergeRequest, 'qa/resource/merge_request'
    autoload :ProjectImportedFromGithub, 'qa/resource/project_imported_from_github'
    autoload :MergeRequestFromFork, 'qa/resource/merge_request_from_fork'
    autoload :DeployKey, 'qa/resource/deploy_key'
    autoload :DeployToken, 'qa/resource/deploy_token'
57
    autoload :ProtectedBranch, 'qa/resource/protected_branch'
L
Lin Jen-Shin 已提交
58 59 60 61 62 63
    autoload :CiVariable, 'qa/resource/ci_variable'
    autoload :Runner, 'qa/resource/runner'
    autoload :PersonalAccessToken, 'qa/resource/personal_access_token'
    autoload :KubernetesCluster, 'qa/resource/kubernetes_cluster'
    autoload :User, 'qa/resource/user'
    autoload :ProjectMilestone, 'qa/resource/project_milestone'
64
    autoload :Members, 'qa/resource/members'
L
Lin Jen-Shin 已提交
65 66 67 68
    autoload :Wiki, 'qa/resource/wiki'
    autoload :File, 'qa/resource/file'
    autoload :Fork, 'qa/resource/fork'
    autoload :SSHKey, 'qa/resource/ssh_key'
69
    autoload :Snippet, 'qa/resource/snippet'
T
Tomislav Nikic 已提交
70
    autoload :ProjectMember, 'qa/resource/project_member'
71

M
Mark Lapierre 已提交
72 73 74 75 76
    module Events
      autoload :Base, 'qa/resource/events/base'
      autoload :Project, 'qa/resource/events/project'
    end

77
    module Repository
M
Mark Lapierre 已提交
78
      autoload :Commit, 'qa/resource/repository/commit'
L
Lin Jen-Shin 已提交
79 80 81
      autoload :Push, 'qa/resource/repository/push'
      autoload :ProjectPush, 'qa/resource/repository/project_push'
      autoload :WikiPush, 'qa/resource/repository/wiki_push'
82 83 84
    end

    module Settings
L
Lin Jen-Shin 已提交
85
      autoload :HashedStorage, 'qa/resource/settings/hashed_storage'
86 87 88
    end
  end

89 90 91 92 93 94 95
  ##
  # GitLab QA Scenarios
  #
  module Scenario
    ##
    # Support files
    #
96
    autoload :Bootable, 'qa/scenario/bootable'
97 98
    autoload :Actable, 'qa/scenario/actable'
    autoload :Template, 'qa/scenario/template'
99
    autoload :SharedAttributes, 'qa/scenario/shared_attributes'
100 101 102 103 104

    ##
    # Test scenario entrypoints.
    #
    module Test
105
      autoload :Instance, 'qa/scenario/test/instance'
106 107 108 109
      module Instance
        autoload :All, 'qa/scenario/test/instance/all'
        autoload :Smoke, 'qa/scenario/test/instance/smoke'
      end
R
Richard Clamp 已提交
110 111

      module Integration
112
        autoload :Github, 'qa/scenario/test/integration/github'
S
Sanad Liaquat 已提交
113 114
        autoload :LDAPNoTLS, 'qa/scenario/test/integration/ldap_no_tls'
        autoload :LDAPTLS, 'qa/scenario/test/integration/ldap_tls'
S
Sanad Liaquat 已提交
115
        autoload :InstanceSAML, 'qa/scenario/test/integration/instance_saml'
116
        autoload :OAuth, 'qa/scenario/test/integration/oauth'
117
        autoload :Kubernetes, 'qa/scenario/test/integration/kubernetes'
R
Richard Clamp 已提交
118
        autoload :Mattermost, 'qa/scenario/test/integration/mattermost'
119
        autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage'
R
Richard Clamp 已提交
120
      end
121 122

      module Sanity
123
        autoload :Framework, 'qa/scenario/test/sanity/framework'
124 125
        autoload :Selectors, 'qa/scenario/test/sanity/selectors'
      end
126 127 128 129 130 131 132 133 134 135
    end
  end

  ##
  # Classes describing structure of GitLab, pages, menus etc.
  #
  # Needed to execute click-driven-only black-box tests.
  #
  module Page
    autoload :Base, 'qa/page/base'
136 137
    autoload :View, 'qa/page/view'
    autoload :Element, 'qa/page/element'
138
    autoload :Validator, 'qa/page/validator'
139
    autoload :Validatable, 'qa/page/validatable'
140 141

    module Main
142
      autoload :Login, 'qa/page/main/login'
S
sliaquat 已提交
143
      autoload :Menu, 'qa/page/main/menu'
144
      autoload :OAuth, 'qa/page/main/oauth'
145
      autoload :SignUp, 'qa/page/main/sign_up'
146 147
    end

148 149 150 151
    module Settings
      autoload :Common, 'qa/page/settings/common'
    end

152
    module Dashboard
153
      autoload :Projects, 'qa/page/dashboard/projects'
154
      autoload :Groups, 'qa/page/dashboard/groups'
155 156 157 158 159 160

      module Snippet
        autoload :New, 'qa/page/dashboard/snippet/new'
        autoload :Index, 'qa/page/dashboard/snippet/index'
        autoload :Show, 'qa/page/dashboard/snippet/show'
      end
161 162 163
    end

    module Group
164
      autoload :New, 'qa/page/group/new'
165
      autoload :Show, 'qa/page/group/show'
166 167 168 169 170 171
      autoload :Menu, 'qa/page/group/menu'

      module SubMenus
        autoload :Common, 'qa/page/group/sub_menus/common'
        autoload :Members, 'qa/page/group/sub_menus/members'
      end
S
Sanad Liaquat 已提交
172 173 174 175

      module Settings
        autoload :General, 'qa/page/group/settings/general'
      end
176 177
    end

178 179 180
    module File
      autoload :Form, 'qa/page/file/form'
      autoload :Show, 'qa/page/file/show'
J
Jennifer Louie 已提交
181
      autoload :Edit, 'qa/page/file/edit'
182 183 184

      module Shared
        autoload :CommitMessage, 'qa/page/file/shared/commit_message'
J
Jennifer Louie 已提交
185 186
        autoload :CommitButton, 'qa/page/file/shared/commit_button'
        autoload :Editor, 'qa/page/file/shared/editor'
187 188 189
      end
    end

190 191 192
    module Project
      autoload :New, 'qa/page/project/new'
      autoload :Show, 'qa/page/project/show'
F
Filipe Freire 已提交
193
      autoload :Activity, 'qa/page/project/activity'
S
sliaquat 已提交
194
      autoload :Menu, 'qa/page/project/menu'
195

196 197 198 199
      module Branches
        autoload :Show, 'qa/page/project/branches/show'
      end

200 201 202 203
      module Commit
        autoload :Show, 'qa/page/project/commit/show'
      end

204 205 206 207
      module Import
        autoload :Github, 'qa/page/project/import/github'
      end

G
Gabriel Mazetto 已提交
208 209 210 211 212
      module Pipeline
        autoload :Index, 'qa/page/project/pipeline/index'
        autoload :Show, 'qa/page/project/pipeline/show'
      end

L
WIP  
Lin Jen-Shin 已提交
213 214 215 216
      module Job
        autoload :Show, 'qa/page/project/job/show'
      end

217
      module Settings
218
        autoload :Common, 'qa/page/project/settings/common'
G
Gabriel Mazetto 已提交
219 220
        autoload :Advanced, 'qa/page/project/settings/advanced'
        autoload :Main, 'qa/page/project/settings/main'
221
        autoload :Repository, 'qa/page/project/settings/repository'
222
        autoload :CICD, 'qa/page/project/settings/ci_cd'
223
        autoload :AutoDevops, 'qa/page/project/settings/auto_devops'
L
Lin Jen-Shin 已提交
224
        autoload :DeployKeys, 'qa/page/project/settings/deploy_keys'
225
        autoload :DeployTokens, 'qa/page/project/settings/deploy_tokens'
226
        autoload :ProtectedBranches, 'qa/page/project/settings/protected_branches'
227
        autoload :CiVariables, 'qa/page/project/settings/ci_variables'
228
        autoload :Runners, 'qa/page/project/settings/runners'
F
Felipe Artur 已提交
229
        autoload :MergeRequest, 'qa/page/project/settings/merge_request'
230
        autoload :Members, 'qa/page/project/settings/members'
231
        autoload :MirroringRepositories, 'qa/page/project/settings/mirroring_repositories'
232
        autoload :VisibilityFeaturesPermissions, 'qa/page/project/settings/visibility_features_permissions'
233
      end
234

235
      module SubMenus
236
        autoload :CiCd, 'qa/page/project/sub_menus/ci_cd'
237
        autoload :Common, 'qa/page/project/sub_menus/common'
238 239
        autoload :Issues, 'qa/page/project/sub_menus/issues'
        autoload :Operations, 'qa/page/project/sub_menus/operations'
240
        autoload :Repository, 'qa/page/project/sub_menus/repository'
241
        autoload :Settings, 'qa/page/project/sub_menus/settings'
J
Jennifer Louie 已提交
242
        autoload :Project, 'qa/page/project/sub_menus/project'
243 244
      end

245 246 247 248 249
      module Issue
        autoload :New, 'qa/page/project/issue/new'
        autoload :Show, 'qa/page/project/issue/show'
        autoload :Index, 'qa/page/project/issue/index'
      end
250

251 252 253 254
      module Fork
        autoload :New, 'qa/page/project/fork/new'
      end

D
Dan Davison 已提交
255 256 257 258 259
      module Milestone
        autoload :New, 'qa/page/project/milestone/new'
        autoload :Index, 'qa/page/project/milestone/index'
      end

260
      module Operations
261 262 263 264 265
        module Environments
          autoload :Index, 'qa/page/project/operations/environments/index'
          autoload :Show, 'qa/page/project/operations/environments/show'
        end

266 267 268 269 270 271 272
        module Kubernetes
          autoload :Index, 'qa/page/project/operations/kubernetes/index'
          autoload :Add, 'qa/page/project/operations/kubernetes/add'
          autoload :AddExisting, 'qa/page/project/operations/kubernetes/add_existing'
          autoload :Show, 'qa/page/project/operations/kubernetes/show'
        end
      end
273 274 275 276 277

      module Wiki
        autoload :Edit, 'qa/page/project/wiki/edit'
        autoload :New, 'qa/page/project/wiki/new'
        autoload :Show, 'qa/page/project/wiki/show'
278
        autoload :GitAccess, 'qa/page/project/wiki/git_access'
279
      end
M
Mark Lapierre 已提交
280 281 282 283

      module WebIDE
        autoload :Edit, 'qa/page/project/web_ide/edit'
      end
284 285
    end

286
    module Profile
S
sliaquat 已提交
287
      autoload :Menu, 'qa/page/profile/menu'
288
      autoload :PersonalAccessTokens, 'qa/page/profile/personal_access_tokens'
289
      autoload :SSHKeys, 'qa/page/profile/ssh_keys'
290
      autoload :TwoFactorAuth, 'qa/page/profile/two_factor_auth'
291 292
    end

293
    module Issuable
294
      autoload :Sidebar, 'qa/page/issuable/sidebar'
295 296
    end

D
ddavison 已提交
297 298 299 300
    module Alert
      autoload :AutoDevopsAlert, 'qa/page/alert/auto_devops_alert'
    end

301 302
    module Layout
      autoload :Banner, 'qa/page/layout/banner'
303
      autoload :PerformanceBar, 'qa/page/layout/performance_bar'
304 305
    end

306 307 308 309 310
    module Label
      autoload :New, 'qa/page/label/new'
      autoload :Index, 'qa/page/label/index'
    end

F
Felipe Artur 已提交
311 312
    module MergeRequest
      autoload :New, 'qa/page/merge_request/new'
F
Felipe Artur 已提交
313
      autoload :Show, 'qa/page/merge_request/show'
F
Felipe Artur 已提交
314 315
    end

316
    module Admin
S
sliaquat 已提交
317 318
      autoload :Menu, 'qa/page/admin/menu'

319
      module Settings
320
        autoload :Repository, 'qa/page/admin/settings/repository'
M
Mesut Güneş 已提交
321
        autoload :General, 'qa/page/admin/settings/general'
322
        autoload :MetricsAndProfiling, 'qa/page/admin/settings/metrics_and_profiling'
S
Stan Hu 已提交
323
        autoload :Network, 'qa/page/admin/settings/network'
324 325

        module Component
S
Stan Hu 已提交
326
          autoload :IpLimits, 'qa/page/admin/settings/component/ip_limits'
327
          autoload :RepositoryStorage, 'qa/page/admin/settings/component/repository_storage'
M
Mesut Güneş 已提交
328
          autoload :AccountAndLimit, 'qa/page/admin/settings/component/account_and_limit'
329
          autoload :PerformanceBar, 'qa/page/admin/settings/component/performance_bar'
330
        end
331
      end
332
    end
333 334 335 336 337

    module Mattermost
      autoload :Main, 'qa/page/mattermost/main'
      autoload :Login, 'qa/page/mattermost/login'
    end
338

T
Tomislav Nikic 已提交
339 340 341 342
    module Search
      autoload :Results, 'qa/page/search/results'
    end

343 344 345 346
    ##
    # Classes describing components that are used by several pages.
    #
    module Component
347
      autoload :ClonePanel, 'qa/page/component/clone_panel'
M
Mark Lapierre 已提交
348
      autoload :LazyLoader, 'qa/page/component/lazy_loader'
349
      autoload :LegacyClonePanel, 'qa/page/component/legacy_clone_panel'
350
      autoload :Dropzone, 'qa/page/component/dropzone'
351
      autoload :GroupsFilter, 'qa/page/component/groups_filter'
352
      autoload :Select2, 'qa/page/component/select2'
M
Mark Lapierre 已提交
353
      autoload :DropdownFilter, 'qa/page/component/dropdown_filter'
354
      autoload :UsersSelect, 'qa/page/component/users_select'
355
      autoload :Note, 'qa/page/component/note'
J
Jennifer Louie 已提交
356
      autoload :ConfirmModal, 'qa/page/component/confirm_modal'
M
Mark Lapierre 已提交
357

358 359 360
      module Issuable
        autoload :Common, 'qa/page/component/issuable/common'
      end
M
Mark Lapierre 已提交
361 362 363 364

      module WebIDE
        autoload :Alert, 'qa/page/component/web_ide/alert'
      end
365
    end
366 367 368 369 370 371 372
  end

  ##
  # Classes describing operations on Git repositories.
  #
  module Git
    autoload :Repository, 'qa/git/repository'
373
    autoload :Location, 'qa/git/location'
374 375
  end

376
  ##
377 378
  # Classes describing services being part of GitLab and how we can interact
  # with these services, like through the shell.
379
  #
380
  module Service
381
    autoload :Shellout, 'qa/service/shellout'
382
    autoload :KubernetesCluster, 'qa/service/kubernetes_cluster'
383 384
    autoload :Omnibus, 'qa/service/omnibus'
    autoload :Runner, 'qa/service/runner'
385 386 387 388 389 390 391

    module ClusterProvider
      autoload :Base, 'qa/service/cluster_provider/base'
      autoload :Gcloud, 'qa/service/cluster_provider/gcloud'
      autoload :Minikube, 'qa/service/cluster_provider/minikube'
      autoload :K3d, 'qa/service/cluster_provider/k3d'
    end
392 393
  end

394 395 396 397 398 399
  ##
  # Classes that make it possible to execute features tests.
  #
  module Specs
    autoload :Config, 'qa/specs/config'
    autoload :Runner, 'qa/specs/runner'
400
    autoload :ParallelRunner, 'qa/specs/parallel_runner'
M
Mark Lapierre 已提交
401 402 403 404

    module Helpers
      autoload :Quarantine, 'qa/specs/helpers/quarantine'
    end
405
  end
S
Sanad Liaquat 已提交
406 407 408 409 410 411 412 413 414 415 416

  ##
  # Classes that describe the structure of vendor/third party application pages
  #
  module Vendor
    module SAMLIdp
      module Page
        autoload :Base, 'qa/vendor/saml_idp/page/base'
        autoload :Login, 'qa/vendor/saml_idp/page/login'
      end
    end
417 418 419 420 421 422 423

    module Github
      module Page
        autoload :Base, 'qa/vendor/github/page/base'
        autoload :Login, 'qa/vendor/github/page/login'
      end
    end
S
Sanad Liaquat 已提交
424
  end
M
Mark Lapierre 已提交
425 426 427 428 429 430 431

  # Classes that provide support to other parts of the framework.
  #
  module Support
    module Page
      autoload :Logging, 'qa/support/page/logging'
    end
S
Sanad Liaquat 已提交
432
    autoload :Api, 'qa/support/api'
M
Mark Lapierre 已提交
433
    autoload :Waiter, 'qa/support/waiter'
S
Sanad Liaquat 已提交
434
    autoload :Retrier, 'qa/support/retrier'
M
Mark Lapierre 已提交
435
  end
436
end
437

438
QA::Runtime::Release.extend_autoloads!