Example #1
0
    def testDecompressFile_URLLIST(self):

        args = {
            "eventType": self.eventType,
            "urlList": self.urllist(self.testFilePath),
            #"appName": self.appName,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        child1 = subprocess.Popen("dde-file-manager -d >/dev/null 2>&1",
                                  shell=True)
        sleep(2)

        (status, output) = rt(cmdstring)

        docwin = window.findWindowByAppName(self.applicationName)
        #sleep(2)
        self.assertTrue(None != docwin)

        #sleep(2)
        window.closeWindow(docwin)

        docwinclose = window.findWindowByAppName(self.applicationName,
                                                 mode="nowait")
        self.assertTrue(None == docwinclose)

        print(child1.pid)
        child1.kill()
        os.system('killall dde-file-manager')
    def testOpenInTerminal_url(self):
        args = {
            "eventType": self.eventType,
            "url": self.testFilePath,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        child1 = subprocess.Popen("dde-file-manager -d >/dev/null 2>&1",
                                  shell=True)
        sleep(2)

        #run the test
        (status, output) = rt(cmdstring)
        sleep(2)

        docwin = window.findWindow(self.windowName)
        self.assertTrue(None != docwin)

        window.closeWindow(docwin)

        docwinclose = window.findWindow(self.windowName, mode="nowait")
        self.assertTrue(None == docwinclose)

        print(child1.pid)
        child1.kill()
        os.system('killall dde-file-manager')
Example #3
0
    def testOpenFileLocation_url(self):
        args = {
            "eventType": self.eventType,
            "url": self.testFilePath,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        child1 = subprocess.Popen("dde-file-manager -d >/dev/null 2>&1",
                                  shell=True)
        sleep(2)

        #run the test
        (status, output) = rt(cmdstring)
        sleep(2)

        docwin = window.findWindowByAppName(self.applicationName)
        self.assertTrue(None != docwin)

        window.closeWindow(docwin)

        docwinclose = window.findWindowByAppName(self.applicationName,
                                                 mode="nowait")
        self.assertTrue(None == docwinclose)
    def testOpenINewWindow_urlList_force(self):

        args = {"eventType": self.eventType,
                "urlList": self.urllist(self.testFilePath),
                "force": True,
                "mode": 2}
        cmdstring = self.cmdline(args)
        print(cmdstring)

        #if opened dde-file-manager, close it
        docwin = window.findWindow(self.windowName)
        if docwin != None:
            window.closeWindow(docwin)

        child1 = subprocess.Popen("dde-file-manager -d >/dev/null 2>&1", shell=True)
        sleep(1)

        #run the test
        (status, output) = rt(cmdstring)
        sleep(1)

        docwin = window.findWindow(self.windowName)
        self.assertTrue(None != docwin)

        window.closeWindow(docwin)

        docwinclose = window.findWindow(self.windowName, mode="nowait")
        self.assertTrue(None == docwinclose)

        print(child1.pid)
        child1.kill()
Example #5
0
    def testOpenFile_URL(self, fileName, windowName):
        self.fileName = fileName
        self.testFilePath = 'file://' + '/'.join(
            [self.pwd, self.data, self.fileName])
        self.windowName = windowName

        args = {
            "eventType": self.eventType,
            "url": self.testFilePath,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        child1 = subprocess.Popen("dde-file-manager -d >/dev/null 2>&1",
                                  shell=True)
        sleep(2)

        (status, output) = rt(cmdstring)

        docwin = window.findWindow(self.windowName)
        self.assertTrue(None != docwin)

        window.closeWindow(docwin)

        docwinclose = window.findWindow(self.windowName, mode="nowait")
        self.assertTrue(None == docwinclose)

        print(child1.pid)
        child1.kill()
        os.system('killall dde-file-manager')
Example #6
0
    def testPluginTrashLeftClick(self):
        icon = self.dock.dockObj.child(self.testiconname)
        self.assertTrue(icon)
        icon.click()
        sleep(2)

        w = window.findWindow(self.dock.string_Deepin_File_Manager)
        self.assertTrue(w != None)
        window.closeWindow(w)
        w = window.findWindow(self.dock.string_Deepin_File_Manager,
                              mode="nowait")
        self.assertTrue(w == None)

        pyautogui.moveTo(400, 400, duration=1)
        pyautogui.click()
    def testPluginDatetimeLeftClick(self):
        icon = self.dock.dockObj.child(self.testiconname)
        self.assertTrue(icon)
        icon.click()
        sleep(2)

        deepin_calendar = "Deepin Calendar"
        w = window.findWindow(deepin_calendar)
        self.assertTrue(w != None)
        window.closeWindow(w)
        w = window.findWindow(deepin_calendar, mode="nowait")
        self.assertTrue(w == None)

        pyautogui.moveTo(400, 400, duration=1)
        pyautogui.click()
Example #8
0
    def testOpenFile_URL(self):
        args = {
            "eventType": self.eventType,
            "url": self.testFilePath,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        (status, output) = rt(cmdstring)

        docwin = window.findWindow(self.windowName)
        self.assertTrue(None != docwin)

        window.closeWindow(docwin)

        docwinclose = window.findWindow(self.windowName, mode="nowait")
        self.assertTrue(None == docwinclose)
Example #9
0
 def testRunAPP(self):
     appdict = self.ParsingJsonCn()
     for (k, v) in appdict.items():
         print(k, v)
         if v == 'null':
             continue
         launcher.searchApp(k)
         time.sleep(1)
         launcher.launcherObj.child(k).click()
         time.sleep(10)
         if k == '深度截图':
             self.terminate_deepinscreenshot()
         else:
             window_obj = window.findWindow(v)
             print(window_obj)
             if k == '雷鸟邮件':
                 thunderbird_obj = window.findWindow('欢迎使用 Thunderbird')
                 window.closeWindow(thunderbird_obj)
             closeresult = window.closeWindow(window_obj)
             self.assertEqual(None, closeresult)
Example #10
0
    def testOpenFileByApp_URL_APPNAME(self):
        args = {
            "eventType": self.eventType,
            "url": self.testFilePath,
            "appName": self.appName,
            "mode": 2
        }
        cmdstring = self.cmdline(args)
        print(cmdstring)

        (status, output) = rt(cmdstring)

        docwin = window.findWindowByAppName(self.applicationName)
        #sleep(2)
        self.assertTrue(None != docwin)

        #sleep(2)
        window.closeWindow(docwin)

        docwinclose = window.findWindowByAppName(self.applicationName,
                                                 mode="nowait")
        self.assertTrue(None == docwinclose)