def test():
	jsxe.setStartingFiles([['schema-test.xml']])
	treeview.assertTree([ [ 'Document Root', 'doc', 'para' ] ])
	treeview.expand('/Document Root/doc')
	

	click('Tools')
	click('Options...')

	window('Global Options')
	select('Validate if DTD or Schema Available', 'true')
	select('Format XML output', 'true')
	select('Soft tabs #{emulated with spaces#}', 'true')
	click('OK')
	close()

	treeview.expand('/Document Root/doc')
	treeview.removeNode('/Document Root/doc/para')
	treeview.assertTree([ [ 'Document Root', 'doc' ] ])

	treeview.addElementNodeByName('/Document Root/doc', "para")

	window('Edit Node')
	select('EditTagDialog$AttributeTable', 'true', 'Set,0')
	select('EditTagDialog$AttributeTable', 'center', 'Value,0')
	click('OK')
	close()

	treeview.choose('/Document Root/doc/para')
	treeview.assertTree([ [ 'Document Root', 'doc', 'para' ] ])
	treeview.assertAttributes([ ['align', 'center'] ])
	close()
示例#2
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])
    treeview.expand('/Document Root/default_element')
    treeview.removeNode('/Document Root/default_element/default_node')
    treeview.assertTree([['Document Root', 'default_element']])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([['Document Root', 'default_element', 'new_element']])

    treeview.addTextNode('/Document Root/default_element')
    treeview.assertTree(
        [['Document Root', 'default_element', 'new_element', 'New Text Node']])

    treeview.addCDATANode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'new_element', 'New Text Node',
        'New CDATA Section'
    ]])

    treeview.addPINode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'new_element', 'New Text Node',
        'New CDATA Section', 'Instruction'
    ]])

    treeview.addCommentNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'new_element', 'New Text Node',
        'New CDATA Section', 'Instruction', 'New Comment'
    ]])

    treeview.addAttribute('TEST', 'TEST2')
    treeview.assertAttributes([['TEST', 'TEST2']])

    click('File')
    click('Reload')

    window('Document Modified')
    click('Yes')
    close()

    treeview.choose('/Document Root/default_element')
    treeview.assertTree([['Document Root', 'default_element', 'default_node']])
    treeview.assertAttributes([])
    close()
示例#3
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])
    treeview.expand('/Document Root/default_element')
    treeview.removeNode('/Document Root/default_element/default_node')
    treeview.assertTree([['Document Root', 'default_element']])

    treeview.addCDATANode('/Document Root/default_element')
    treeview.assertTree(
        [['Document Root', 'default_element', 'New CDATA Section']])

    treeview.choose('/Document Root/default_element/New CDATA Section')
    treeview.setValue('CDATA Test 123 ]')
    treeview.assertTree(
        [['Document Root', 'default_element', 'CDATA Test 123 ]']])

    jsxe.setView('Source View')
    sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element><![CDATA[CDATA Test 123 ]]]></default_element>""")
    close()
示例#4
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])
    treeview.expand('/Document Root/default_element')
    treeview.removeNode('/Document Root/default_element/default_node')
    treeview.assertTree([['Document Root', 'default_element']])

    treeview.addPINode('/Document Root/default_element')
    treeview.assertTree([['Document Root', 'default_element', 'Instruction']])

    treeview.renameNode('/Document Root/default_element/Instruction',
                        'SQLSELECT')
    treeview.assertTree([['Document Root', 'default_element', 'SQLSELECT']])

    treeview.choose('/Document Root/default_element/SQLSELECT')
    treeview.setValue('SELECT * FROM BLAH')

    jsxe.setView('Source View')

    sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element><?SQLSELECT SELECT * FROM BLAH?></default_element>""")
    close()
示例#5
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])

    treeview.expand('/Document Root/default_element')
    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree(
        [['Document Root', 'default_element', 'default_node', 'new_element']])

    treeview.addCDATANode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'new_element',
        'New CDATA Section'
    ]])

    treeview.addPINode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'new_element',
        'New CDATA Section', 'Instruction'
    ]])

    treeview.addCommentNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'new_element',
        'New CDATA Section', 'Instruction', 'New Comment'
    ]])

    treeview.addTextNode('/Document Root/default_element/new_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'new_element',
        'New Text Node', 'New CDATA Section', 'Instruction', 'New Comment'
    ]])

    treeview.removeNode('/Document Root/default_element/New CDATA Section')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'new_element',
        'New Text Node', 'Instruction', 'New Comment'
    ]])

    treeview.removeNode('/Document Root/default_element/new_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'default_node', 'Instruction',
        'New Comment'
    ]])

    treeview.removeNode('/Document Root/default_element/Instruction')
    treeview.assertTree(
        [['Document Root', 'default_element', 'default_node', 'New Comment']])
    close()
示例#6
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])

    treeview.expand('/Document Root/default_element')
    treeview.removeNode('/Document Root/default_element/default_node')

    treeview.addElementNode('/Document Root/default_element')
    treeview.renameNode('/Document Root/default_element/new_element',
                        'Default')

    treeview.addElementNode('/Document Root/default_element')

    treeview.renameNode('/Document Root/default_element/new_element',
                        'default')

    jsxe.setView('Source View')

    click('Edit')
    click('Find...')

    window('Search and Replace')
    select('FindComboBox', 'Default')
    select('ReplaceComboBox', 'test1')

    # for some reason we need this for combo box to update selected content
    click('ReplaceComboBox')
    select('Ignore Case', 'true')
    click('Find')
    select('FindComboBox', 'default')
    click('FindComboBox')
    select('Ignore Case', 'false')
    click('Replace&Find')

    jsxe.jsxewindow('Untitled-1')
    sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<test1_element><Default/><default/></default_element>""")

    window('Search and Replace')
    select('FindComboBox', 'Default')
    select('ReplaceComboBox', 'test2')
    click('ReplaceComboBox')
    select('Ignore Case', 'true')
    click('Replace&Find')

    jsxe.jsxewindow('Untitled-1')
    sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<test1_element><Default/><test2/></default_element>""")

    window('Search and Replace')
    select('ReplaceComboBox', 'test3')
    click('ReplaceComboBox')

    click('Replace&Find')

    jsxe.jsxewindow('Untitled-1')

    sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<test1_element><Default/><test2/></test3_element>""")

    click('Cancel')
    close()
    close()
示例#7
0
def test():
    jsxe.setStartingFiles([['Untitled-1']])

    treeview.expand('/Document Root/default_element')
    treeview.removeNode('/Document Root/default_element/default_node')
    treeview.assertTree([['Document Root', 'default_element']])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([['Document Root', 'default_element', 'new_element']])

    treeview.renameNode('/Document Root/default_element/new_element',
                        'element1')
    treeview.assertTree([['Document Root', 'default_element', 'element1']])

    treeview.addElementNode('/Document Root/default_element/element1')
    treeview.assertTree(
        [['Document Root', 'default_element', 'element1', 'new_element']])

    treeview.renameNode('/Document Root/default_element/element1/new_element',
                        'element2')
    treeview.assertTree(
        [['Document Root', 'default_element', 'element1', 'element2']])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2',
        'new_element'
    ]])

    treeview.renameNode('/Document Root/default_element/new_element',
                        'element3')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3'
    ]])

    treeview.addTextNode('/Document Root/default_element/element3')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node'
    ]])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'new_element'
    ]])

    treeview.renameNode('/Document Root/default_element/new_element',
                        'element4')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4'
    ]])

    treeview.addCDATANode('/Document Root/default_element/element4')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section'
    ]])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'new_element'
    ]])

    treeview.renameNode('/Document Root/default_element/new_element',
                        'element5')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'element5'
    ]])

    treeview.addPINode('/Document Root/default_element/element5')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'element5',
        'Instruction'
    ]])

    treeview.addElementNode('/Document Root/default_element')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'element5',
        'Instruction', 'new_element'
    ]])

    #doubleclick('JScrollPane$ScrollBar.')
    #doubleclick('JScrollPane$ScrollBar.')

    treeview.renameNode('/Document Root/default_element/new_element',
                        'element6')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'element5',
        'Instruction', 'element6'
    ]])

    treeview.addCommentNode('/Document Root/default_element/element6')
    treeview.assertTree([[
        'Document Root', 'default_element', 'element1', 'element2', 'element3',
        'New Text Node', 'element4', 'New CDATA Section', 'element5',
        'Instruction', 'element6', 'New Comment'
    ]])

    #doubleclick('JScrollPane$ScrollBar.')

    jsxe.setView('Source View')
    sourceview.assertText('''<?xml version="1.0" encoding="UTF-8"?>
<default_element><element1><element2/></element1><element3>New Text Node</element3><element4><![CDATA[New CDATA Section]]></element4><element5><?Instruction New Processing Instruction?></element5><element6><!--New Comment--></element6></default_element>'''
                          )
示例#8
0
def test():
	jsxe.setStartingFiles([['Untitled-1']])
	
	treeview.expand('/Document Root/default_element')
	treeview.removeNode('/Document Root/default_element/default_node')
	treeview.assertTree([ [ 'Document Root', 'default_element' ] ])
	
	treeview.choose('/Document Root/default_element')
	treeview.assertAttributes([ ])
	treeview.addAttribute('test', 'junk')
	treeview.assertAttributes([ [ 'test', 'junk' ] ])
	
	treeview.addAttribute('test2', 'test Attribute')
	treeview.assertAttributes([ [ 'test', 'junk' ], [ 'test2', 'test Attribute' ] ])
	
	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'new_element' ] ])

	treeview.renameNode('/Document Root/default_element/new_element', 'element1')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1' ] ])
	
	treeview.addTextNode('/Document Root/default_element/element1')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node' ] ])
	
	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'new_element' ] ])
	
	treeview.renameNode('/Document Root/default_element/new_element', 'element2')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2' ] ])
	
	treeview.addTextNode('/Document Root/default_element/element2')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node' ] ])

	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'new_element' ] ])
	
	treeview.renameNode('/Document Root/default_element/new_element', 'element3')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3' ] ])
	
	treeview.addCDATANode('/Document Root/default_element/element3')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'New CDATA Section' ] ])

	treeview.choose('/Document Root/default_element/element3/New CDATA Section')
	treeview.setValue('Test CDATA')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA' ] ])

	treeview.addPINode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction' ] ])
	
	treeview.choose('/Document Root/default_element/Instruction')
	treeview.setValue('Test Instruction')
	
	treeview.addCommentNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'New Comment' ] ])

	treeview.choose('/Document Root/default_element/New Comment')
	treeview.setValue('TEST COMMENT')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'TEST COMMENT' ] ])
	
	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'TEST COMMENT', 'new_element' ] ])
	
	treeview.renameNode('/Document Root/default_element/new_element', 'element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'TEST COMMENT', 'element4' ] ])
	
	treeview.addElementNode('/Document Root/default_element/element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'TEST COMMENT', 'element4', 'new_element' ] ])
	
	treeview.renameNode('/Document Root/default_element/element4/new_element', 'element5')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New Text Node', 'element3', 'Test CDATA', 'Instruction', 'TEST COMMENT', 'element4', 'element5' ] ])
	
	click('Tools')
	click('Options...')
	window('Global Options')
	click('JTree', '//jsxe/XML Document Options')
	select('Format XML output', 'true')
	select('Soft tabs #{emulated with spaces#}', 'false')
	click('OK')
	close()

	jsxe.setView('Source View')
	
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element test="junk" test2="test Attribute">
	<element1>New Text Node</element1>
	<element2>New Text Node</element2>
	<element3><![CDATA[Test CDATA]]></element3>
	<?Instruction Test Instruction?>
	<!--TEST COMMENT-->
	<element4>
		<element5/>
	</element4>
</default_element>""")
	
	close()
示例#9
0
def test():
	jsxe.setStartingFiles([['Untitled-1']])
    
	treeview.expand('/Document Root/default_element')
	treeview.removeNode('/Document Root/default_element/default_node')
	
	treeview.addElementNode('/Document Root/default_element')
	treeview.addElementNode('/Document Root/default_element')
	treeview.addElementNode('/Document Root/default_element')
    
	click('Tools')
	click('Options...')
	window('Global Options')
	click('JTree', '//jsxe/XML Document Options')
	select('Format XML output', 'true')
	click('OK')
	close()

	jsxe.setView('Source View')
	
	click('Edit')
	click('Find...')

	window('Search and Replace')
	select('FindComboBox', 'new_element')
	select('ReplaceComboBox', 'element1')
	# for some reason we need this to for combo box to update selected content
	click('ReplaceComboBox') 

	# sleep(30);

	click('Replace&Find') #this should do nothing

	window('jsXe - Untitled-1')
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element>
	<new_element/>
	<new_element/>
	<new_element/>
</default_element>""")


	window('Search and Replace')
	click('Replace&Find')

	window('jsXe - Untitled-1')
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element>
	<element1/>
	<new_element/>
	<new_element/>
</default_element>""")

	window('Search and Replace')
	click('Replace&Find')

	window('jsXe - Untitled-1')
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element>
	<element1/>
	<element1/>
	<new_element/>
</default_element>""")

	window('Search and Replace')
	click('Replace&Find')

	window('jsXe - Untitled-1')
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element>
	<element1/>
	<element1/>
	<element1/>
</default_element>""")

	window('Search and Replace')
	click('Replace&Find') # should do nothing

	window('jsXe - Untitled-1')
	sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?>
<default_element>
	<element1/>
	<element1/>
	<element1/>
</default_element>""")

	click('Cancel')
	close()
	close()
示例#10
0
def test():
	jsxe.setStartingFiles([['Untitled-1']])
	treeview.expand('/Document Root/default_element')
	treeview.removeNode('/Document Root/default_element/default_node')
	treeview.assertTree([ [ 'Document Root', 'default_element' ] ])
	
	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'new_element' ] ])

	treeview.renameNode('/Document Root/default_element/new_element', 'element1')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1' ] ])

	treeview.addTextNode('/Document Root/default_element/element1')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node' ] ])

	treeview.addCommentNode('/Document Root/default_element/element1')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment' ] ])

	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'new_element' ] ])

	treeview.renameNode('/Document Root/default_element/new_element', 'element2')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2' ] ])

	treeview.addCDATANode('/Document Root/default_element/element2')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section' ] ])

	treeview.addCommentNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'New Comment' ] ])

	treeview.choose('/Document Root/default_element/New Comment')
	treeview.setValue('Comment Node')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node' ] ])

	treeview.addElementNode('/Document Root/default_element')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'new_element' ] ])

	treeview.renameNode('/Document Root/default_element/new_element', 'element3')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3' ] ])

	treeview.addElementNode('/Document Root/default_element/element3')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'new_element' ] ])

	treeview.renameNode('/Document Root/default_element/element3/new_element', 'element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'element4' ] ])

	treeview.addCDATANode('/Document Root/default_element/element3/element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'element4', 'New CDATA Section' ] ])

	treeview.addCommentNode('/Document Root/default_element/element3/element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'element4', 'New CDATA Section', 'New Comment' ] ])

	treeview.addPINode('/Document Root/default_element/element3/element4')
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'element4', 'New CDATA Section', 'New Comment', 'Instruction' ] ])

	#doubleclick('JScrollPane$ScrollBar.')
	#doubleclick('JScrollPane$ScrollBar.')
	click('Tools')
	click('Options...')
	window('Global Options')
	click('JTree', '//jsxe/Tree View Options')
	select('Show comment nodes', 'false')
	click('OK')
	close()
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'element2', 'New CDATA Section', 'element3', 'element4', 'New CDATA Section', 'Instruction' ] ])

	click('Tools')
	click('Options...')
	window('Global Options')
	click('JTree', '//jsxe/Tree View Options')
	select('Show comment nodes', 'true')
	click('OK')
	close()
	treeview.assertTree([ [ 'Document Root', 'default_element', 'element1', 'New Text Node', 'New Comment', 'element2', 'New CDATA Section', 'Comment Node', 'element3', 'element4', 'New CDATA Section', 'New Comment', 'Instruction' ] ])

	close()