123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- require 'browser_test_helper'
- class AdminCalendarSlaTest < TestCase
- def test_calendar
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- calendar_name = "ZZZ some calendar #{rand(99_999_999)}"
- sla_name = "ZZZ some sla #{rand(99_999_999)}"
- timezone = 'Europe/Berlin'
- timezone_verify = 'Europe/Berlin (GMT+2)'
- calendar_create(
- data: {
- name: calendar_name,
- timezone: timezone,
- }
- )
- # got to maintanance
- click(css: '[href="#manage"]')
- click(css: '[href="#system/maintenance"]')
- watch_for(
- css: '.content.active',
- value: 'Enable or disable the maintenance mode',
- timeout: 4,
- )
- # go back
- click(css: '[href="#manage"]')
- click(css: '[href="#manage/calendars"]')
- watch_for(
- css: '.content.active',
- value: calendar_name,
- timeout: 4,
- )
- logout()
- login(
- username: 'master@example.com',
- password: 'test',
- )
- # check if admin exists
- click(css: '[href="#manage"]')
- click(css: '[href="#manage/calendars"]')
- watch_for(
- css: '.content.active',
- value: calendar_name,
- timeout: 4,
- )
- #@browser.execute_script('$(\'.content.active table tr td:contains(" ' + data[:name] + '")\').first().click()')
- @browser.execute_script('$(\'.content.active .main .js-edit\').last().click()')
- modal_ready(browser: @browser)
- watch_for(
- css: '.content.active .modal input[name=name]',
- value: calendar_name,
- timeout: 4,
- )
- watch_for(
- css: '.content.active .modal input.js-input',
- value: Regexp.quote(timezone_verify),
- timeout: 4,
- )
- modal_close()
- sla_create(
- data: {
- name: sla_name,
- calendar: "#{calendar_name} - #{timezone}",
- first_response_time_in_text: 61
- },
- )
- end
- end
|