123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- require 'browser_test_helper'
- class IntegrationTest < TestCase
- def test_sipgate
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # change settings
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/sipgate"]')
- sleep 2
- switch(
- css: '.content.active .main .js-switch',
- type: 'on',
- )
- set(
- css: '.content.active .main .js-inboundBlockCallerId input[name=caller_id]',
- value: '041 1234567',
- )
- set(
- css: '.content.active .main .js-inboundBlockCallerId input[name=note]',
- value: 'block spam caller id',
- )
- click(css: '.content.active .main .js-inboundBlockCallerId .js-add')
- click(css: '.content.active .main .js-submit')
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
- )
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="block spam caller id"]',
- )
- click(css: 'a[href="#dashboard"]')
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/sipgate"]')
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
- )
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="block spam caller id"]',
- )
- reload()
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
- )
- exists(
- css: '.content.active .main .js-inboundBlockCallerId [value="block spam caller id"]',
- )
- click(css: '.content.active .main .js-inboundBlockCallerId .js-remove')
- click(css: '.content.active .main .js-submit')
- sleep 6
- switch(
- css: '.content.active .main .js-switch',
- type: 'off',
- )
- reload()
- exists_not(
- css: '.content.active .main .js-inboundBlockCallerId [value="0411234567"]',
- )
- exists_not(
- css: '.content.active .main .js-inboundBlockCallerId [value="block spam caller id"]',
- )
- end
- def test_slack
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # change settings
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/slack"]')
- sleep 2
- switch(
- css: '.content.active .main .js-switch',
- type: 'on',
- )
- click(css: '.content.active .main .checkbox-replacement')
- select(
- css: '.content.active .main select[name="group_ids"]',
- value: 'Users',
- )
- set(
- css: '.content.active .main input[name="webhook"]',
- value: 'http://some_url/webhook/123',
- )
- set(
- css: '.content.active .main input[name="username"]',
- value: 'someuser',
- )
- click(css: '.content.active .main .js-submit')
- match(
- css: '.content.active .main select[name="group_ids"]',
- value: 'Users',
- )
- match(
- css: '.content.active .main input[name="webhook"]',
- value: 'http://some_url/webhook/123',
- )
- match(
- css: '.content.active .main input[name="username"]',
- value: 'someuser',
- )
- click(css: 'a[href="#dashboard"]')
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/slack"]')
- match(
- css: '.content.active .main select[name="group_ids"]',
- value: 'Users',
- )
- match(
- css: '.content.active .main input[name="webhook"]',
- value: 'http://some_url/webhook/123',
- )
- match(
- css: '.content.active .main input[name="username"]',
- value: 'someuser',
- )
- reload()
- match(
- css: '.content.active .main select[name="group_ids"]',
- value: 'Users',
- )
- match(
- css: '.content.active .main input[name="webhook"]',
- value: 'http://some_url/webhook/123',
- )
- match(
- css: '.content.active .main input[name="username"]',
- value: 'someuser',
- )
- switch(
- css: '.content.active .main .js-switch',
- type: 'off',
- )
- end
- def test_clearbit
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # change settings
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/clearbit"]')
- sleep 2
- switch(
- css: '.content.active .main .js-switch',
- type: 'on',
- )
- set(
- css: '.content.active .main input[name="api_key"]',
- value: 'some_api_key',
- )
- set(
- css: '.content.active .main .js-userSync .js-new [name="source"]',
- value: 'source1',
- )
- set(
- css: '.content.active .main .js-userSync .js-new [name="destination"]',
- value: 'destination1',
- )
- click(css: '.content.active .main .js-userSync .js-add')
- click(css: '.content.active .main .js-submit')
- click(css: 'a[href="#dashboard"]')
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/clearbit"]')
- match(
- css: '.content.active .main input[name="api_key"]',
- value: 'some_api_key',
- )
- exists(
- css: '.content.active .main .js-userSync [value="source1"]',
- )
- exists(
- css: '.content.active .main .js-userSync [value="destination1"]',
- )
- reload()
- match(
- css: '.content.active .main input[name="api_key"]',
- value: 'some_api_key',
- )
- exists(
- css: '.content.active .main .js-userSync [value="source1"]',
- )
- exists(
- css: '.content.active .main .js-userSync [value="destination1"]',
- )
- switch(
- css: '.content.active .main .js-switch',
- type: 'off',
- )
- set(
- css: '.content.active .main input[name="api_key"]',
- value: '-empty-',
- )
- click(css: '.content.active .main .js-submit')
- reload()
- match_not(
- css: '.content.active .main input[name="api_key"]',
- value: 'some_api_key',
- )
- match(
- css: '.content.active .main input[name="api_key"]',
- value: '-empty-',
- )
- exists(
- css: '.content.active .main .js-userSync [value="source1"]',
- )
- exists(
- css: '.content.active .main .js-userSync [value="destination1"]',
- )
- end
- def test_icinga
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- # change settings
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/icinga"]')
- sleep 2
- switch(
- css: '.content.active .main .js-switch',
- type: 'on',
- )
- set(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'some@othersender.com',
- )
- select(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'no',
- )
- click(css: '.content.active .main .js-submit')
- match(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'some@othersender.com',
- )
- match(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'no',
- )
- click(css: 'a[href="#dashboard"]')
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/integration"]')
- click(css: 'a[href="#system/integration/icinga"]')
- match(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'some@othersender.com',
- )
- match(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'no',
- )
- reload()
- match(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'some@othersender.com',
- )
- match(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'no',
- )
- switch(
- css: '.content.active .main .js-switch',
- type: 'off',
- )
- set(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'icinga@monitoring.example.com',
- )
- select(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'yes',
- )
- click(css: '.content.active .main .js-submit')
- match(
- css: '.content.active .main input[name="icinga_sender"]',
- value: 'icinga@monitoring.example.com',
- )
- match(
- css: '.content.active .main select[name="icinga_auto_close"]',
- value: 'yes',
- )
- end
- end
|