Maintenance: Port maintenance app version test to capybara.

This commit is contained in:
Dominik Klein 2021-10-06 10:34:15 +02:00
parent 45cbbde2be
commit c1cb4fdd43
3 changed files with 15 additions and 44 deletions

View file

@ -50,7 +50,6 @@ if [ "$LEVEL" == '1' ]; then
rm test/browser/first_steps_test.rb
rm test/browser/integration_test.rb
rm test/browser/keyboard_shortcuts_test.rb
# test/browser/maintenance_app_version_test.rb
# test/browser/maintenance_session_message_test.rb
# test/browser/manage_test.rb
# test/browser/monitoring_test.rb
@ -108,7 +107,6 @@ elif [ "$LEVEL" == '2' ]; then
rm test/browser/first_steps_test.rb
rm test/browser/integration_test.rb
rm test/browser/keyboard_shortcuts_test.rb
rm test/browser/maintenance_app_version_test.rb
rm test/browser/maintenance_session_message_test.rb
rm test/browser/manage_test.rb
rm test/browser/monitoring_test.rb
@ -166,7 +164,6 @@ elif [ "$LEVEL" == '3' ]; then
rm test/browser/first_steps_test.rb
rm test/browser/integration_test.rb
rm test/browser/keyboard_shortcuts_test.rb
rm test/browser/maintenance_app_version_test.rb
rm test/browser/maintenance_session_message_test.rb
rm test/browser/manage_test.rb
rm test/browser/monitoring_test.rb
@ -224,7 +221,6 @@ elif [ "$LEVEL" == '4' ]; then
rm test/browser/first_steps_test.rb
rm test/browser/integration_test.rb
rm test/browser/keyboard_shortcuts_test.rb
rm test/browser/maintenance_app_version_test.rb
rm test/browser/maintenance_session_message_test.rb
rm test/browser/manage_test.rb
rm test/browser/monitoring_test.rb
@ -281,7 +277,6 @@ elif [ "$LEVEL" == '5' ]; then
rm test/browser/first_steps_test.rb
rm test/browser/integration_test.rb
rm test/browser/keyboard_shortcuts_test.rb
rm test/browser/maintenance_app_version_test.rb
rm test/browser/maintenance_session_message_test.rb
rm test/browser/manage_test.rb
rm test/browser/monitoring_test.rb
@ -341,7 +336,6 @@ elif [ "$LEVEL" == '6' ]; then
# test/browser/first_steps_test.rb
# test/browser/integration_test.rb
# test/browser/keyboard_shortcuts_test.rb
rm test/browser/maintenance_app_version_test.rb
rm test/browser/maintenance_session_message_test.rb
rm test/browser/manage_test.rb
rm test/browser/monitoring_test.rb

View file

@ -0,0 +1,15 @@
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
require 'rails_helper'
RSpec.describe 'Maintenance App Version', type: :system do
it 'check that new version is present' do
page.execute_script 'App.Event.trigger("maintenance", {type:"app_version", app_version:"1234:false"} )'
expect(page).to have_no_text('new version')
page.execute_script 'App.Event.trigger("maintenance", {type:"app_version", app_version:"1234:true"} )'
expect(page).to have_text('new version')
end
end

View file

@ -1,38 +0,0 @@
# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
require 'browser_test_helper'
class MaintenanceAppVersionTest < TestCase
def test_app_version
@browser = browser_instance
login(
username: 'admin@example.com',
password: 'test',
url: browser_url,
)
sleep 8
execute(
js: 'App.Event.trigger("maintenance", {type:"app_version", app_version:"1234:false"} )',
)
sleep 8
match_not(
css: 'body',
value: 'new version',
)
execute(
js: 'App.Event.trigger("maintenance", {type:"app_version", app_version:"1235:true"}) ',
)
sleep 5
match(
css: 'body',
value: 'new version',
)
end
end