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()
def test(): jsxe.setStartingFiles([['Untitled-1']]) treeview.expand('/Document Root/default_element') treeview.choose('/Document Root/default_element/default_node') treeview.setValue('This is a test') treeview.assertTree([ [ 'Document Root', 'default_element', 'This is a test' ] ]) jsxe.setView('Source View') sourceview.assertText("""<?xml version="1.0" encoding="UTF-8"?> <default_element>This is a test</default_element>""") close()
def test(): jsxe.setStartingFiles([['Untitled-1']]) treeview.choose('/Document Root/default_element') treeview.addAttribute('test1', '123') treeview.assertAttributes([['test1', '123']]) treeview.addAttribute('test2', '124') treeview.assertAttributes([['test1', '123'], ['test2', '124']]) treeview.removeAttribute(0) treeview.assertAttributes([['test2', '124']]) treeview.setAttribute('blah', '1234', 0) treeview.assertAttributes([['blah', '1234']]) close()
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()
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()
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()
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()
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()