123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- require 'browser_test_helper'
- class PreferencesLanguageTest < TestCase
- def test_lang_change
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- 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
- 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"]')
- select(
- css: '.language_item [name="locale"]',
- value: 'Deutsch',
- )
- click(css: '.content.active button[type="submit"]')
- watch_for(
- css: 'body',
- value: 'Sprache',
- )
- # 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',
- 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
- open_task(
- data: {
- title: 'Anruf',
- }
- )
- 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
- open_task(
- data: {
- title: 'preferences lang check #2',
- }
- )
- 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"]')
- select(
- css: '.language_item [name="locale"]',
- value: 'English (United States)',
- )
- click(css: '.content.active button[type="submit"]')
- sleep 2
- watch_for(
- css: 'body',
- value: 'Language',
- )
- # 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',
- 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
- open_task(
- data: {
- title: 'Call',
- }
- )
- 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
- open_task(
- data: {
- title: 'preferences lang check #2',
- }
- )
- 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"]')
- sleep 4
- select(
- css: '.language_item [name="locale"]',
- value: 'Deutsch',
- )
- click(css: '.content.active button[type="submit"]')
- sleep 4
- watch_for(
- css: 'body',
- value: 'Sprache',
- )
- sleep 6
- # check if language is still used after reload
- reload()
- sleep 2
- watch_for(
- css: 'body',
- value: 'Sprache',
- )
- # 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',
- 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(
- css: '.language_item [name="locale"]',
- value: 'English (United States)',
- )
- click(css: '.content.active button[type="submit"]')
- sleep 2
- watch_for(
- css: 'body',
- value: 'Language',
- )
- end
- end
|