123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- require 'browser_test_helper'
- class SettingTest < TestCase
- def test_setting
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # make sure, that we have english frontend
- 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
- # change settings
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#settings/security"]')
- click(css: 'a[href="#third_party_auth"]')
- sleep 2
- switch(
- css: '.content.active .js-setting[data-name="auth_facebook"]',
- type: 'off',
- )
- browser2 = browser_instance
- location(
- browser: browser2,
- url: browser_url,
- )
- watch_for(
- browser: browser2,
- css: 'body',
- value: 'login',
- )
- match_not(
- browser: browser2,
- css: 'body',
- value: 'facebook',
- )
- # set yes
- switch(
- css: '.content.active .js-setting[data-name="auth_facebook"]',
- type: 'on',
- )
- # set key and secret
- set(
- css: '[data-name="auth_facebook_credentials"] input[name=app_id]',
- value: 'id_test1234äöüß',
- )
- set(
- css: '[data-name="auth_facebook_credentials"] input[name=app_secret]',
- value: 'secret_test1234äöüß',
- )
- click( css: '[data-name="auth_facebook_credentials"] button[type=submit]')
- watch_for(
- css: '#notify',
- value: 'update successful',
- )
- sleep 4
- match(
- css: '[data-name="auth_facebook_credentials"] input[name=app_id]',
- value: 'id_test1234äöüß',
- )
- match(
- css: '[data-name="auth_facebook_credentials"] input[name=app_secret]',
- value: 'secret_test1234äöüß',
- )
- # verify login page
- sleep 2
- watch_for(
- browser: browser2,
- css: 'body',
- value: 'facebook',
- )
- # set key and secret again
- set(
- css: '[data-name="auth_facebook_credentials"] input[name=app_id]',
- value: '---',
- )
- set(
- css: '[data-name="auth_facebook_credentials"] input[name=app_secret]',
- value: '---',
- )
- click(css: '[data-name="auth_facebook_credentials"] button[type=submit]')
- watch_for(
- css: '#notify',
- value: 'update successful',
- )
- sleep 4
- match(
- css: '[data-name="auth_facebook_credentials"] input[name=app_id]',
- value: '---',
- )
- match(
- css: '[data-name="auth_facebook_credentials"] input[name=app_secret]',
- value: '---',
- )
- reload()
- click(css: 'a[href="#settings/security"]')
- click(css: 'a[href="#third_party_auth"]')
- watch_for(
- css: '[data-name="auth_facebook_credentials"] input[name=app_id]',
- value: '---',
- )
- watch_for(
- css: '[data-name="auth_facebook_credentials"] input[name=app_secret]',
- value: '---',
- )
- sleep 2
- switch(
- css: '.content.active .js-setting[data-name="auth_facebook"]',
- type: 'off',
- )
- sleep 2
- watch_for(
- browser: browser2,
- css: 'body',
- value: 'login',
- )
- match_not(
- browser: browser2,
- css: 'body',
- value: 'facebook',
- )
- end
- def test_product_name
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- verify_title(value: 'Zammad Test System')
- click(css: 'a[href="#manage"]')
- click(css: '.content.active a[href="#settings/branding"]')
- set(
- css: '.content.active [name="product_name"]',
- value: 'ABC App',
- )
- click(css: '.content.active #product_name button[type=submit]')
- sleep 2
- verify_title(value: 'ABC App')
- set(
- css: '.content.active [name="product_name"]',
- value: 'Zammad Test System',
- )
- click(css: '.content.active #product_name button[type=submit]')
- sleep 2
- verify_title(value: 'Zammad Test System')
- end
- end
|