Ejemplo n.º 1
0
    def setUp(self):
        """Start the sample application. Open a tab with ownerdraw button."""
        Timings.defaults()

        self.app = Application().start(os.path.join(mfc_samples_folder, u"RebarTest.exe"))
        # open the Help dailog
        self.app.active().type_keys('%h{ENTER}')
Ejemplo n.º 2
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        app = Application()

        path = os.path.split(__file__)[0]
        test_file = os.path.join(path, "test.txt")

        with codecs.open(test_file, mode="rb", encoding='utf-8') as f:
            self.test_data = f.read()
        # remove the BOM if it exists
        self.test_data = self.test_data.replace(repr("\xef\xbb\xbf"), "")
        #self.test_data = self.test_data.encode('utf-8', 'ignore') # XXX: decode raises UnicodeEncodeError even if 'ignore' is used!
        print('self.test_data:')
        print(self.test_data.encode('utf-8', 'ignore'))

        app.start("Notepad.exe " + test_file, timeout=20)

        self.app = app
        self.dlg = app.UntitledNotepad
        self.ctrl = self.dlg.Edit.wrapper_object()

        self.old_pos = self.dlg.rectangle

        self.dlg.move_window(10, 10, 400, 400)
Ejemplo n.º 3
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        app = Application()

        path = os.path.split(__file__)[0]
        test_file = os.path.join(path, "test.txt")

        with codecs.open(test_file, mode="rb", encoding='utf-8') as f:
            self.test_data = f.read()
        # remove the BOM if it exists
        self.test_data = self.test_data.replace(repr("\xef\xbb\xbf"), "")
        #self.test_data = self.test_data.encode('utf-8', 'ignore') # XXX: decode raises UnicodeEncodeError even if 'ignore' is used!
        print('self.test_data:')
        print(self.test_data.encode('utf-8', 'ignore'))

        app.start("Notepad.exe " + test_file, timeout=20)

        self.app = app
        self.dlg = app.UntitledNotepad
        self.ctrl = self.dlg.Edit.WrapperObject()

        self.old_pos = self.dlg.rectangle

        self.dlg.MoveWindow(10, 10, 400, 400)
Ejemplo n.º 4
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application().start(os.path.join(mfc_samples_folder, u"RowList.exe"))

        self.dlg = self.app.RowListSampleApplication
        self.ctrl = self.app.RowListSampleApplication.ListView.wrapper_object()
Ejemplo n.º 5
0
    def setUp(self):
        """Start the sample application. Open a tab with ownerdraw button."""
        Timings.defaults()

        self.app = Application().Start(
            os.path.join(mfc_samples_folder, u"RebarTest.exe"))
        # open the Help dailog
        self.app.active_().type_keys('%h{ENTER}')
Ejemplo n.º 6
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application().start(os.path.join(mfc_samples_folder, u"BCDialogMenu.exe"))
        self.dlg = self.app.BCDialogMenu
        self.app.wait_cpu_usage_lower(threshold=1.5, timeout=30, usage_interval=1)
        self.dlg.wait('ready')
Ejemplo n.º 7
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application()
        self.app.start("Notepad.exe")

        self.dlg = self.app.Notepad
Ejemplo n.º 8
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application().start(os.path.join(mfc_samples_folder, u"RowList.exe"))

        self.dlg = self.app.RowListSampleApplication
        self.ctrl = self.app.RowListSampleApplication.ListView.wrapper_object()
Ejemplo n.º 9
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application()
        self.app.start("Notepad.exe")

        self.dlg = self.app.Notepad
Ejemplo n.º 10
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application()
        self.app.start(os.path.join(mfc_samples_folder, u"CmnCtrl1.exe"))

        self.dlg = self.app.Common_Controls_Sample
        self.ctrl = self.dlg.TreeView.wrapper_object()
Ejemplo n.º 11
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application()
        self.app.start(os.path.join(mfc_samples_folder, u"CmnCtrl1.exe"))

        self.dlg = self.app.Common_Controls_Sample
        self.ctrl = self.dlg.TreeView.wrapper_object()
Ejemplo n.º 12
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        # start the application
        self.app = Application(backend='win32')
        self.app = self.app.start(mfc_app_1)

        self.dlg = self.app.CommonControlsSample
Ejemplo n.º 13
0
 def setUp(self):
     """Set some data and ensure the application is in the state we want"""
     if sys.platform == 'win32':
         Timings.defaults()
         self.app = Application()
         self.app.start(_test_app())
         self.dlg = self.app.mousebuttons
     else:
         self.display = Display()
         self.app = subprocess.Popen("exec " + _test_app(), shell=True)
         time.sleep(1)
Ejemplo n.º 14
0
 def setUp(self):
     """Set some data and ensure the application is in the state we want"""
     if sys.platform == 'win32':
         Timings.defaults()
         self.app = Application()
         self.app.start(_test_app())
         self.dlg = self.app.mousebuttons
     else:
         self.display = Display()
         self.app = subprocess.Popen("exec " + _test_app(), shell=True)
         time.sleep(1)
Ejemplo n.º 15
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.tm = _ready_timeout
        app = Application(backend='win32')
        app.start(os.path.join(mfc_samples_folder, u"TrayMenu.exe"), wait_for_idle=False)
        self.app = app
        self.dlg = app.top_window()
        mouse.move((-500, 200))  # remove the mouse from the screen to avoid side effects
        self.dlg.wait('ready', timeout=self.tm)
Ejemplo n.º 16
0
    def setUp(self):
        """Set some data and ensure the application is in the state we want"""
        Timings.defaults()

        self.app = Application().start(
            os.path.join(mfc_samples_folder, u"BCDialogMenu.exe"))
        self.dlg = self.app.BCDialogMenu
        self.app.wait_cpu_usage_lower(threshold=1.5,
                                      timeout=30,
                                      usage_interval=1)
        self.dlg.wait('ready')
Ejemplo n.º 17
0
 def setUp(self):
     """Set some data and ensure the application is in the state we want"""
     Timings.defaults()
     self.app = Application().start("notepad")
     self.dlghandle = self.app.UntitledNotepad.handle
     self.edit_handle = self.app.UntitledNotepad.Edit.handle
Ejemplo n.º 18
0
    def setUp(self):
        Timings.defaults()

        self.app = Application().start(
            os.path.join(mfc_samples_folder, u'CtrlTest.exe'))
        self.dlg = self.app.Control_Test_App
Ejemplo n.º 19
0
 def setUp(self):
     """Set some data and ensure the application is in the state we want"""
     Timings.defaults()
     self.app = Application().start("notepad")
     self.dlghandle = self.app.UntitledNotepad.handle
     self.edit_handle = self.app.UntitledNotepad.Edit.handle
Ejemplo n.º 20
0
    def setUp(self):
        Timings.defaults()

        self.app = Application().start(os.path.join(mfc_samples_folder, u'CtrlTest.exe'))
        self.dlg = self.app.Control_Test_App