Added browser test for invalid API key.
This commit is contained in:
parent
edf565bd4d
commit
896f33b4ce
1 changed files with 20 additions and 4 deletions
|
@ -11,8 +11,6 @@ class OtrsImportBrowserTest < TestCase
|
||||||
fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT_KEY - hint IMPORT_BT_OTRS_ENDPOINT_KEY='01234567899876543210'"
|
fail "ERROR: Need IMPORT_BT_OTRS_ENDPOINT_KEY - hint IMPORT_BT_OTRS_ENDPOINT_KEY='01234567899876543210'"
|
||||||
end
|
end
|
||||||
|
|
||||||
import_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']}"
|
|
||||||
|
|
||||||
@browser = browser_instance
|
@browser = browser_instance
|
||||||
location(url: browser_url)
|
location(url: browser_url)
|
||||||
|
|
||||||
|
@ -24,13 +22,31 @@ class OtrsImportBrowserTest < TestCase
|
||||||
|
|
||||||
click(css: '.js-otrs-link')
|
click(css: '.js-otrs-link')
|
||||||
|
|
||||||
|
invalid_key_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=31337"
|
||||||
|
|
||||||
|
set(
|
||||||
|
css: '#otrs-link',
|
||||||
|
value: invalid_key_url
|
||||||
|
)
|
||||||
|
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
watch_for(
|
||||||
|
css: '.otrs-link-error',
|
||||||
|
value: 'Invalid API key.',
|
||||||
|
)
|
||||||
|
|
||||||
|
import_url = "#{ENV['IMPORT_BT_OTRS_ENDPOINT']};Key=#{ENV['IMPORT_BT_OTRS_ENDPOINT_KEY']}"
|
||||||
set(
|
set(
|
||||||
css: '#otrs-link',
|
css: '#otrs-link',
|
||||||
value: import_url
|
value: import_url
|
||||||
)
|
)
|
||||||
|
|
||||||
exists(
|
sleep 5
|
||||||
css: 'svg.icon-checkmark'
|
|
||||||
|
watch_for_disappear(
|
||||||
|
css: '.otrs-link-error',
|
||||||
|
value: 'Invalid API key.',
|
||||||
)
|
)
|
||||||
|
|
||||||
click(css: '.js-migration-start')
|
click(css: '.js-migration-start')
|
||||||
|
|
Loading…
Reference in a new issue