123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- # encoding: utf-8
- require 'browser_test_helper'
- class AdminObjectManagerTest < TestCase
- def test_basic
- name = "some overview #{rand(99_999_999)}"
- @browser = browser_instance
- login(
- username: 'master@example.com',
- password: 'test',
- url: browser_url,
- )
- tasks_close_all()
- click(css: 'a[href="#manage"]')
- click(css: 'a[href="#system/object_manager"]')
- click(css: '#content .js-new')
- modal_ready()
- # already existing
- set(
- css: '.modal input[name="name"]',
- value: 'customer_id',
- )
- set(
- css: '.modal input[name="display"]',
- value: 'Customer Should Not Creatable',
- )
- click(css: '.modal button.js-submit')
- sleep 4
- watch_for(
- css: '.modal',
- value: '(already exists)',
- )
- # invalid name
- set(
- css: '.modal input[name="name"]',
- value: 'some_other_id',
- )
- set(
- css: '.modal input[name="display"]',
- value: 'Should Not Creatable',
- )
- click(css: '.modal button.js-submit')
- sleep 4
- watch_for(
- css: '.modal',
- value: '(are not allowed)',
- )
- # invalid name
- set(
- css: '.modal input[name="name"]',
- value: 'some_other_ids',
- )
- set(
- css: '.modal input[name="display"]',
- value: 'Should Not Creatable',
- )
- click(css: '.modal button.js-submit')
- sleep 4
- watch_for(
- css: '.modal',
- value: '(are not allowed)',
- )
- # invalid name
- set(
- css: '.modal input[name="name"]',
- value: 'some spaces',
- )
- set(
- css: '.modal input[name="display"]',
- value: 'Should Not Creatable',
- )
- click(css: '.modal button.js-submit')
- sleep 4
- watch_for(
- css: '.modal',
- value: '(are not allowed)',
- )
- click(css: '.modal .js-close')
- modal_ready()
- # valid name
- click(css: '#content .js-new')
- modal_ready()
- set(
- css: '.modal input[name="name"]',
- value: 'browser_test1',
- )
- set(
- css: '.modal input[name="display"]',
- value: 'Browser Test 1',
- )
- click(css: '.modal button.js-submit')
- watch_for(
- css: '#content table',
- value: 'browser_test1',
- )
- watch_for(
- css: '#content',
- value: 'Database Update required',
- )
- click(css: '#content .tab-pane.active div.js-execute')
- watch_for(
- css: '.modal',
- value: 'New Version',
- )
- click(css: '.modal button.js-submit')
- # create new ticket
- # update ticket
- # discard new attribute
- watch_for(
- css: '#content table',
- value: 'browser_test1',
- )
- match_not(
- css: '#content',
- value: 'Database Update required',
- )
- click(css: '#content .tab-pane.active table tbody tr:last-child .js-delete')
- sleep 4
- watch_for(
- css: '#content',
- value: 'Database Update required',
- )
- watch_for(
- css: '#content table',
- value: 'browser_test1',
- )
- click(css: '#content .tab-pane.active div.js-execute')
- watch_for(
- css: '.modal',
- value: 'New Version',
- )
- click(css: '.modal button.js-submit')
- sleep 5
- match_not(
- css: '#content',
- value: 'Database Update required',
- )
- match_not(
- css: '#content table',
- value: 'browser_test1',
- )
- end
- end
|