trabajo-afectivo/test/browser/preferences_language_test.rb

338 lines
6.6 KiB
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2013-02-21 21:56:32 +00:00
require 'browser_test_helper'
2016-09-05 13:18:22 +00:00
class PreferencesLanguageTest < TestCase
2016-02-16 19:34:37 +00:00
def test_lang_change
2015-02-22 22:20:05 +00:00
@browser = browser_instance
login(
username: 'master@example.com',
password: 'test',
url: browser_url,
2015-02-22 22:20:05 +00:00
)
tasks_close_all()
# start ticket create
ticket_create(
data: {
customer: 'nicole',
group: 'Users',
title: 'preferences lang check #1',
body: 'preferences lang check #1',
},
do_not_submit: true,
)
# start ticket zoom
2015-04-27 19:56:07 +00:00
ticket_create(
data: {
customer: 'nicole',
group: 'Users',
title: 'preferences lang check #2',
body: 'preferences lang check #2',
},
)
# start user profile
user_open_by_search(
value: 'Nicole',
)
# start organization profile
organization_open_by_search(
value: 'Zammad Foundation',
)
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
2015-02-22 22:20:05 +00:00
select(
Refactoring: Bindings and namespaces improves memory usage and resolved ghost bindings. * Renamed controllers `@bind` and `@unbind` to `@controllerBind` and `@controllerUnbind` to not overwrite spine's methods to take advantage of spine's binding/unbinding and cleanup features. * Cleanup of controller namespaces `App.ObserverController` -> `App.ControllerObserver`, `App.ObserverActionRow` -> `App.ControllerObserverActionRow` and `App.WizardModal` -> `App.ControllerWizardModal` * Moved to named local controller names to have better trace backs/debugging (e. g. `class Index` to `class UserIndex`). * Splited `app/assets/javascripts/app/controllers/_application_controller.coffee` into separate files under `app/assets/javascripts/app/controllers/_application_controller/*.coffee` to have better trace backs/debugging. * Moved classes with executed code from `app/assets/javascripts/app/controllers/widget/*.coffee` into `app/assets/javascripts/app/controllers/_plugin/` from now `app/assets/javascripts/app/controllers/widget/*.coffee` will only contain UI widgets like popovers. * Refactored second argument of `@navigate`. Old version was only `true` to hide `@navigate` redirect from browser back list. Now we introduced params instant of boolean argument. Now we support: * `hideCurrentLocationFromHistory: true` -> hide redirect from browser back list (old `true` argument) * `emptyEl: true` -> will empty `@el` before redirect to new location * `removeEl: true` -> will remove `@el` before redirect to new location
2021-01-29 12:22:19 +00:00
css: '.js-language [name="locale"]',
value: 'Deutsch',
2015-02-22 22:20:05 +00:00
)
click(css: '.content.active button[type="submit"]')
2015-02-22 22:20:05 +00:00
watch_for(
css: 'body',
value: 'Sprache',
2015-02-22 22:20:05 +00:00
)
# check language in navbar
watch_for(
css: '.js-menu',
value: 'Übersicht'
)
# check language in dashboard
click(css: '.js-menu a[href="#dashboard"]')
watch_for(
css: '.content.active',
2015-06-23 17:50:11 +00:00
value: 'Meine Statistik'
)
# check language in overview
click(css: '.js-menu a[href="#ticket/view"]')
watch_for(
css: '.content.active',
value: 'Meine'
)
verify_title(
value: 'Meine zugewiesenen',
)
# check language in ticket create
2015-03-08 21:34:14 +00:00
open_task(
data: {
title: 'Anruf',
2015-03-08 21:34:14 +00:00
}
)
verify_task(
data: {
title: 'Anruf',
}
)
open_task(
data: {
title: 'preferences lang check #1',
}
)
watch_for(
css: '.content.active',
value: 'kunde'
)
watch_for(
css: '.content.active',
value: 'priorität'
)
watch_for(
css: '.content.active [data-name="body"]',
value: 'preferences lang check #1'
)
verify_title(
value: 'anruf',
)
# check language in ticket zoom
2015-03-08 21:34:14 +00:00
open_task(
data: {
title: 'preferences lang check #2',
2015-03-08 21:34:14 +00:00
}
)
watch_for(
css: '.content.active',
value: 'erstellt'
)
watch_for(
css: '.content.active',
value: 'priorität'
)
# check language in user profile
open_task(
data: {
title: 'Nicole',
}
)
watch_for(
css: '.content.active',
value: 'notiz'
)
watch_for(
css: '.content.active',
value: 'e-mail'
)
watch_for(
css: '.content.active',
value: 'aktion'
)
# check language in organization profile
open_task(
data: {
title: 'Zammad',
}
)
watch_for(
css: '.content.active',
value: 'notiz'
)
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
2015-02-22 22:20:05 +00:00
select(
Refactoring: Bindings and namespaces improves memory usage and resolved ghost bindings. * Renamed controllers `@bind` and `@unbind` to `@controllerBind` and `@controllerUnbind` to not overwrite spine's methods to take advantage of spine's binding/unbinding and cleanup features. * Cleanup of controller namespaces `App.ObserverController` -> `App.ControllerObserver`, `App.ObserverActionRow` -> `App.ControllerObserverActionRow` and `App.WizardModal` -> `App.ControllerWizardModal` * Moved to named local controller names to have better trace backs/debugging (e. g. `class Index` to `class UserIndex`). * Splited `app/assets/javascripts/app/controllers/_application_controller.coffee` into separate files under `app/assets/javascripts/app/controllers/_application_controller/*.coffee` to have better trace backs/debugging. * Moved classes with executed code from `app/assets/javascripts/app/controllers/widget/*.coffee` into `app/assets/javascripts/app/controllers/_plugin/` from now `app/assets/javascripts/app/controllers/widget/*.coffee` will only contain UI widgets like popovers. * Refactored second argument of `@navigate`. Old version was only `true` to hide `@navigate` redirect from browser back list. Now we introduced params instant of boolean argument. Now we support: * `hideCurrentLocationFromHistory: true` -> hide redirect from browser back list (old `true` argument) * `emptyEl: true` -> will empty `@el` before redirect to new location * `removeEl: true` -> will remove `@el` before redirect to new location
2021-01-29 12:22:19 +00:00
css: '.js-language [name="locale"]',
value: 'English (United States)',
2015-02-22 22:20:05 +00:00
)
click(css: '.content.active button[type="submit"]')
2015-02-28 10:40:23 +00:00
sleep 2
2015-02-22 22:20:05 +00:00
watch_for(
css: 'body',
value: 'Language',
2015-02-22 22:20:05 +00:00
)
# check language in navbar
watch_for(
css: '.js-menu',
value: 'Overview'
)
# check language in dashboard
click(css: '.js-menu a[href="#dashboard"]')
watch_for(
css: '.content.active',
2015-06-23 17:50:11 +00:00
value: 'My Stats'
)
# check language in overview
click(css: '.js-menu a[href="#ticket/view"]')
watch_for(
css: '.content.active',
value: 'My'
)
verify_title(
value: 'My assig',
)
# check language in ticket create
2015-03-08 21:34:14 +00:00
open_task(
data: {
title: 'Call',
2015-03-08 21:34:14 +00:00
}
)
verify_task(
data: {
title: 'Call',
}
)
open_task(
data: {
title: 'preferences lang check #1',
}
)
watch_for(
css: '.content.active',
value: 'customer'
)
watch_for(
css: '.content.active',
value: 'priority'
)
watch_for(
css: '.content.active [data-name="body"]',
value: 'preferences lang check #1'
)
verify_title(
value: 'call',
)
# check language in ticket zoom
2015-03-08 21:34:14 +00:00
open_task(
data: {
title: 'preferences lang check #2',
2015-03-08 21:34:14 +00:00
}
)
watch_for(
css: '.content.active',
value: 'create'
)
watch_for(
css: '.content.active',
value: 'priority'
)
# check language in user profile
open_task(
data: {
title: 'Nicole',
}
)
watch_for(
css: '.content.active',
value: 'note'
)
watch_for(
css: '.content.active',
value: 'email'
)
# check language in organization profile
open_task(
data: {
title: 'Zammad',
}
)
watch_for(
css: '.content.active',
value: 'note'
)
watch_for(
css: '.content.active',
value: 'action'
)
# switch to de again
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
2015-11-30 12:13:27 +00:00
sleep 4
2015-02-22 22:20:05 +00:00
select(
Refactoring: Bindings and namespaces improves memory usage and resolved ghost bindings. * Renamed controllers `@bind` and `@unbind` to `@controllerBind` and `@controllerUnbind` to not overwrite spine's methods to take advantage of spine's binding/unbinding and cleanup features. * Cleanup of controller namespaces `App.ObserverController` -> `App.ControllerObserver`, `App.ObserverActionRow` -> `App.ControllerObserverActionRow` and `App.WizardModal` -> `App.ControllerWizardModal` * Moved to named local controller names to have better trace backs/debugging (e. g. `class Index` to `class UserIndex`). * Splited `app/assets/javascripts/app/controllers/_application_controller.coffee` into separate files under `app/assets/javascripts/app/controllers/_application_controller/*.coffee` to have better trace backs/debugging. * Moved classes with executed code from `app/assets/javascripts/app/controllers/widget/*.coffee` into `app/assets/javascripts/app/controllers/_plugin/` from now `app/assets/javascripts/app/controllers/widget/*.coffee` will only contain UI widgets like popovers. * Refactored second argument of `@navigate`. Old version was only `true` to hide `@navigate` redirect from browser back list. Now we introduced params instant of boolean argument. Now we support: * `hideCurrentLocationFromHistory: true` -> hide redirect from browser back list (old `true` argument) * `emptyEl: true` -> will empty `@el` before redirect to new location * `removeEl: true` -> will remove `@el` before redirect to new location
2021-01-29 12:22:19 +00:00
css: '.js-language [name="locale"]',
value: 'Deutsch',
2015-02-22 22:20:05 +00:00
)
click(css: '.content.active button[type="submit"]')
2015-03-21 14:55:50 +00:00
sleep 4
2015-02-22 22:20:05 +00:00
watch_for(
css: 'body',
value: 'Sprache',
2015-02-22 22:20:05 +00:00
)
2015-11-30 12:13:27 +00:00
sleep 6
# check if language is still used after reload
2015-02-22 22:20:05 +00:00
reload()
2015-11-30 12:13:27 +00:00
sleep 2
2015-03-05 10:40:36 +00:00
2015-02-22 22:20:05 +00:00
watch_for(
css: 'body',
value: 'Sprache',
2015-02-22 22:20:05 +00:00
)
# check language in navbar
watch_for(
css: '.js-menu',
value: 'Übersicht'
)
# check language in dashboard
click(css: '.js-menu a[href="#dashboard"]')
watch_for(
css: '.content.active',
2015-06-23 17:50:11 +00:00
value: 'Meine Statistik'
)
# check language in overview
click(css: '.js-menu a[href="#ticket/view"]')
watch_for(
css: '.content.active',
value: 'Meine'
)
# switch to en again
click(css: 'a[href="#current_user"]')
click(css: 'a[href="#profile"]')
click(css: 'a[href="#profile/language"]')
select(
Refactoring: Bindings and namespaces improves memory usage and resolved ghost bindings. * Renamed controllers `@bind` and `@unbind` to `@controllerBind` and `@controllerUnbind` to not overwrite spine's methods to take advantage of spine's binding/unbinding and cleanup features. * Cleanup of controller namespaces `App.ObserverController` -> `App.ControllerObserver`, `App.ObserverActionRow` -> `App.ControllerObserverActionRow` and `App.WizardModal` -> `App.ControllerWizardModal` * Moved to named local controller names to have better trace backs/debugging (e. g. `class Index` to `class UserIndex`). * Splited `app/assets/javascripts/app/controllers/_application_controller.coffee` into separate files under `app/assets/javascripts/app/controllers/_application_controller/*.coffee` to have better trace backs/debugging. * Moved classes with executed code from `app/assets/javascripts/app/controllers/widget/*.coffee` into `app/assets/javascripts/app/controllers/_plugin/` from now `app/assets/javascripts/app/controllers/widget/*.coffee` will only contain UI widgets like popovers. * Refactored second argument of `@navigate`. Old version was only `true` to hide `@navigate` redirect from browser back list. Now we introduced params instant of boolean argument. Now we support: * `hideCurrentLocationFromHistory: true` -> hide redirect from browser back list (old `true` argument) * `emptyEl: true` -> will empty `@el` before redirect to new location * `removeEl: true` -> will remove `@el` before redirect to new location
2021-01-29 12:22:19 +00:00
css: '.js-language [name="locale"]',
value: 'English (United States)',
)
click(css: '.content.active button[type="submit"]')
sleep 2
watch_for(
css: 'body',
value: 'Language',
)
2013-02-21 21:56:32 +00:00
end
end