diff options
Diffstat (limited to 'sw/qa/uitest/writer_tests7/tdf137802.py')
-rw-r--r-- | sw/qa/uitest/writer_tests7/tdf137802.py | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf137802.py b/sw/qa/uitest/writer_tests7/tdf137802.py index a4067410f41c..99c6085f29dd 100644 --- a/sw/qa/uitest/writer_tests7/tdf137802.py +++ b/sw/qa/uitest/writer_tests7/tdf137802.py @@ -13,67 +13,65 @@ class tdf137802(UITestCase): def test_tdf137802(self): - self.ui_test.load_file(get_url_for_data_file("tdf137802.odt")) + with self.ui_test.load_file(get_url_for_data_file("tdf137802.odt")): - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") - document = self.ui_test.get_component() + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") + document = self.ui_test.get_component() - self.assertEqual(document.DrawPage.getCount(), 2) - self.assertEqual(AT_PARAGRAPH, document.DrawPage.getByIndex(0).AnchorType) + self.assertEqual(document.DrawPage.getCount(), 2) + self.assertEqual(AT_PARAGRAPH, document.DrawPage.getByIndex(0).AnchorType) - self.xUITest.executeCommand(".uno:JumpToNextFrame") + self.xUITest.executeCommand(".uno:JumpToNextFrame") - self.ui_test.wait_until_child_is_available('metricfield') + self.ui_test.wait_until_child_is_available('metricfield') - self.ui_test.execute_dialog_through_command(".uno:TransformDialog") + self.ui_test.execute_dialog_through_command(".uno:TransformDialog") - xDialog = self.xUITest.getTopFocusWindow() + xDialog = self.xUITest.getTopFocusWindow() - xDialog.getChild('topage').executeAction("CLICK", tuple()) + xDialog.getChild('topage').executeAction("CLICK", tuple()) - xOkBtn = xDialog.getChild("ok") - xOkBtn.executeAction("CLICK", tuple()) + xOkBtn = xDialog.getChild("ok") + xOkBtn.executeAction("CLICK", tuple()) - self.assertEqual(AT_PAGE, document.DrawPage.getByIndex(0).AnchorType) + self.assertEqual(AT_PAGE, document.DrawPage.getByIndex(0).AnchorType) - self.assertEqual(document.DrawPage.getCount(), 2) + self.assertEqual(document.DrawPage.getCount(), 2) - xWriterDoc = self.xUITest.getTopFocusWindow() - xWriterEdit = xWriterDoc.getChild("writer_edit") + xWriterDoc = self.xUITest.getTopFocusWindow() + xWriterEdit = xWriterDoc.getChild("writer_edit") - # When shape 1 is selected, esc key doesn't put the focus back to the document - # because the shape has a textbox. Move the focus to another shape with tab key - # and then use escape - xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) - xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) + # When shape 1 is selected, esc key doesn't put the focus back to the document + # because the shape has a textbox. Move the focus to another shape with tab key + # and then use escape + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"})) + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "ESC"})) - # Wait until the shape is deselected and the cursor is on the document - self.ui_test.wait_until_child_is_available('FontNameBox') + # Wait until the shape is deselected and the cursor is on the document + self.ui_test.wait_until_child_is_available('FontNameBox') - # Delete the second paragraph. Shape 2 is anchored to this paragraph - # so it should be deleted - xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) + # Delete the second paragraph. Shape 2 is anchored to this paragraph + # so it should be deleted + xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "BACKSPACE"})) - self.assertEqual(document.DrawPage.getCount(), 1) + self.assertEqual(document.DrawPage.getCount(), 1) - self.xUITest.executeCommand(".uno:JumpToNextFrame") - self.xUITest.executeCommand(".uno:Delete") + self.xUITest.executeCommand(".uno:JumpToNextFrame") + self.xUITest.executeCommand(".uno:Delete") - self.assertEqual(document.DrawPage.getCount(), 0) + self.assertEqual(document.DrawPage.getCount(), 0) - self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") - self.assertEqual(document.DrawPage.getCount(), 1) + self.assertEqual(document.DrawPage.getCount(), 1) - self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") - self.assertEqual(document.DrawPage.getCount(), 2) + self.assertEqual(document.DrawPage.getCount(), 2) - self.xUITest.executeCommand(".uno:Undo") + self.xUITest.executeCommand(".uno:Undo") - self.assertEqual(AT_PARAGRAPH, document.DrawPage.getByIndex(0).AnchorType) - - self.ui_test.close_doc() + self.assertEqual(AT_PARAGRAPH, document.DrawPage.getByIndex(0).AnchorType) # vim: set shiftwidth=4 softtabstop=4 expandtab: |