Maintenance: Also perform browser-based OTRS import test via docker containers...

This commit is contained in:
Martin Gruner 2021-07-21 08:16:29 +00:00
parent d2f4a410ab
commit 09fa75d121
2 changed files with 21 additions and 7 deletions

View file

@ -3,3 +3,15 @@ otrs_chrome:
- .template_browser-integration_import - .template_browser-integration_import
variables: variables:
TEST_FILE: "test/integration/otrs_import_browser_test.rb" TEST_FILE: "test/integration/otrs_import_browser_test.rb"
FF_NETWORK_PER_BUILD: 1 # https://docs.gitlab.com/runner/configuration/feature-flags.html
IMPORT_OTRS_ENDPOINT: "http://zammad-ci-otrsimport-app/otrs/public.pl?Action=ZammadMigrator"
TZ: "Europe/Berlin" # Required for the zammad-ci-otrsimport-app containers
services:
- name: registry.znuny.com/docker/zammad-postgresql:stable
alias: postgresql
- name: registry.znuny.com/docker/zammad-selenium:stable
alias: selenium
- name: registry.znuny.com/docker/zammad-ci-otrsimport-db:otrs6
alias: zammad-ci-otrsimport-db
- name: registry.znuny.com/docker/zammad-ci-otrsimport-app:otrs6
alias: zammad-ci-otrsimport-app

View file

@ -5,13 +5,15 @@ require 'browser_test_helper'
class OtrsImportBrowserTest < TestCase class OtrsImportBrowserTest < TestCase
def test_import def test_import
if !ENV['IMPORT_BT_OTRS_ENDPOINT'] if !ENV['IMPORT_OTRS_ENDPOINT']
raise "ERROR: Need IMPORT_BT_OTRS_ENDPOINT - hint IMPORT_BT_OTRS_ENDPOINT='http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator'" raise "ERROR: Need IMPORT_OTRS_ENDPOINT - hint IMPORT_OTRS_ENDPOINT='http://vz305.demo.znuny.com/otrs/public.pl?Action=ZammadMigrator'"
end end
if !ENV['IMPORT_BT_OTRS_ENDPOINT_KEY'] if !ENV['IMPORT_OTRS_ENDPOINT_KEY']
raise "ERROR: Need IMPORT_BT_OTRS_ENDPOINT_KEY - hint IMPORT_BT_OTRS_ENDPOINT_KEY='01234567899876543210'" raise "ERROR: Need IMPORT_OTRS_ENDPOINT_KEY - hint IMPORT_OTRS_ENDPOINT_KEY='01234567899876543210'"
end end
puts "Using endpoint '#{ENV['IMPORT_OTRS_ENDPOINT']}'."
@browser = browser_instance @browser = browser_instance
location(url: browser_url) location(url: browser_url)
@ -20,7 +22,7 @@ class OtrsImportBrowserTest < TestCase
click(css: '.js-download') click(css: '.js-download')
click(css: '.js-otrs-link') click(css: '.js-otrs-link')
invalid_key_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=31337" invalid_key_url = "#{ENV['IMPORT_OTRS_ENDPOINT']};Key=31337"
set( set(
css: '#otrs-link', css: '#otrs-link',
@ -33,7 +35,7 @@ class OtrsImportBrowserTest < TestCase
value: 'Invalid API key.', value: 'Invalid API key.',
) )
import_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']}" import_url = "#{ENV['IMPORT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_OTRS_ENDPOINT_KEY']}"
set( set(
css: '#otrs-link', css: '#otrs-link',
value: import_url value: import_url