Sha256: 41231255784ba03c0d3bb19a90c93c78ccc6f573853b4e30b940165495d481a7

Contents?: true

Size: 896 Bytes

Versions: 67

Compression:

Stored size: 896 Bytes

Contents

# HTTP mocking

Some scenario types might require mocking third party services. [Mock server](../../lib/gitlab/qa/component/mock_server.rb) component
can be used for that. It is based on simple http mock server called [smocker](https://smocker.dev/).

## Using

Simple usage example:

```ruby
Component::Gitlab.perform do |gitlab|
  gitlab.network = 'test'
  gitlab.instance do
    Component::MockServer.perform do |mock|
      mock.network = gitlab.network
      mock.instance do
        Component::Specs.perform do
          ...
        end
      end
    end
  end
end
```

Mock server will be accessible from within gitlab or qa test container via `http://smocker.test` url and admin interface will be
accessible via `http://smocker.test:8081`. Refer to [Getting Started](https://smocker.dev/guide/getting-started.html) guide on
how to use the server and define mocked requests and responses.

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
gitlab-qa-15.3.0 docs/developer/http_mocking.md
gitlab-qa-15.2.0 docs/developer/http_mocking.md
gitlab-qa-15.1.0 docs/developer/http_mocking.md
gitlab-qa-15.0.0 docs/developer/http_mocking.md
gitlab-qa-14.21.0 docs/developer/http_mocking.md
gitlab-qa-14.20.0 docs/developer/http_mocking.md
gitlab-qa-14.19.2 docs/developer/http_mocking.md
gitlab-qa-14.19.1 docs/developer/http_mocking.md
gitlab-qa-14.19.0 docs/developer/http_mocking.md
gitlab-qa-14.18.0 docs/developer/http_mocking.md
gitlab-qa-14.17.0 docs/developer/http_mocking.md
gitlab-qa-14.16.0 docs/developer/http_mocking.md
gitlab-qa-14.15.0 docs/developer/http_mocking.md
gitlab-qa-14.14.0 docs/developer/http_mocking.md
gitlab-qa-14.13.0 docs/developer/http_mocking.md
gitlab-qa-14.12.0 docs/developer/http_mocking.md
gitlab-qa-14.11.0 docs/developer/http_mocking.md
gitlab-qa-14.9.0 docs/developer/http_mocking.md
gitlab-qa-14.8.1 docs/developer/http_mocking.md
gitlab-qa-14.8.0 docs/developer/http_mocking.md