def testMinimizeFileManager(self): win = utils.findWindow(self.filemanager_windowname) win.minimize() time.sleep(1) self.assertTrue(win != None) win_test = utils.findWindow(self.filemanager_windowname) self.assertTrue(win_test.is_minimized())
def testClose(self): win = utils.findWindow(self.window_name) utils.closeWindow(win) win = None sleep(3) win = utils.findWindow(self.window_name) self.assertFalse(win)
def testOpenGedit(self): icongedit = self.ddedockobject.child(self.gediticonname) icongedit.click() geditwin1 = utils.findWindow(self.dock.string_Text_Editor_Window1, comparetype="notequal") self.assertTrue(geditwin1 != None) icongedit.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) geditwin2 = utils.findWindow(self.dock.string_Text_Editor_Window2, comparetype="notequal") self.assertTrue(geditwin2 != None) icongedit.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) geditwin3 = utils.findWindow(self.dock.string_Text_Editor_Window3, comparetype="notequal") self.assertTrue(geditwin3 != None) icongedit.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) geditwin4 = utils.findWindow(self.dock.string_Text_Editor_Window4, comparetype="notequal") self.assertTrue(geditwin4 != None)
def testCloseGoogleChrome(self): chromewin = utils.findWindow("Google Chrome", comparetype="notequal") utils.closeWindow(chromewin) chromewin = utils.findWindow("Google Chrome", mode="nowait", comparetype="notequal") self.assertTrue(None == chromewin)
def testMinimizeFileManager(self): google = self.ddedockobject.child(self.filemanager) win = utils.findWindow(self.filemanager_windowname) win.minimize() time.sleep(1) self.assertTrue(win != None) win_test = utils.findWindow(self.filemanager_windowname) self.assertTrue(win_test.is_minimized())
def testCloseApp(self): appwin = utils.findWindow(self.filemanagerwindowname, comparetype="notequal") utils.closeWindow(appwin) appwin = utils.findWindow(self.filemanagerwindowname, mode="nowait", comparetype="notequal") self.assertTrue(None == appwin)
def testOpenTerminalFromLauncher(self): utils.keySingle(utils.k.windows_l_key) try: launcherwin = utils.findWindow("dde-launcher") except: self.assertTrue(False, "Can't open dde-launcher") utils.keyTypeString("deepin-terminal") utils.keySingle(utils.k.enter_key) try: terminalwin = utils.findWindow(self.terminalwindowname) self.assertTrue(True) except: self.assertTrue(False, "Can't find window: %s" % self.terminalwindowname)
def testOpenWithClick(self): iconobj = self.ddedockobject.child(self.icon_deepinappstore) self.assertTrue(iconobj) iconobj.click() sleep(4) win = utils.findWindow(self.window_name) self.assertTrue(win)
def testOpenRun(self): try: iconfilemanager = self.ddedockobject.child( self.filemanagericonname) except: self.assertTrue(False, "Can't find the file manager icon on the Dock") iconfilemanager.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) iconfilemanager.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) filemanagerwinlist = utils.findWindowList(self.filemanagerwindowname) self.assertTrue(2 == len(filemanagerwinlist)) iconfilemanager.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) win = utils.findWindow(self.filemanagerwindowname, mode="nowait") self.assertTrue(None == win)
def testMaximizeFileManager(self): win = utils.findWindow(self.filemanager_windowname) win.maximize() win.activate(time.time()) rawinput.absoluteMotion(int(utils.resolution.width / 2), int(utils.resolution.height / 2)) time.sleep(2) self.assertTrue(win != None)
def testOpenGeditFromLauncher(self): self.dbus_launcher.Show() try: launcherwin = utils.findWindow("dde-launcher") except: self.assertTrue(False, "Can't open dde-launcher") utils.keyTypeString("gedit") utils.keySingle(utils.k.enter_key) try: geidtwin = utils.findWindow(self.geidtwindowname, comparetype="notequal") self.assertTrue(True) except: self.assertTrue(False, "Can't find window: %s" % self.geidtwindowname) time.sleep(2)
def testOpenWithEnter(self): iconobj = self.ddedockobject.child(self.icon_deepinappstore) self.assertTrue(iconobj) iconobj.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) sleep(4) win = utils.findWindow(self.window_name) self.assertTrue(win)
def testActivateFileManager(self): managerobj = self.ddedockobject.child(self.filemanager) managerobj.click() rawinput.absoluteMotion(int(utils.resolution.width / 2), int(utils.resolution.height / 2)) time.sleep(3) win = utils.findWindow(self.filemanager_windowname) self.assertTrue(win != None) self.assertTrue(win.is_maximized())
def testExpectResult(self): filemanagerwin = utils.findWindow(self.filemanagerwindowname, mode="nowait") self.assertTrue(None == filemanagerwin) try: iconfilemanager = self.ddedockobject.child(self.filemanagericonname) self.assertTrue((0, 0) == iconfilemanager.position) self.assertTrue((0, 0) == iconfilemanager.size) except: self.assertTrue(False)
def testOpenFileManager(self): launcher = self.ddedockobject.child("Launcher") launcher.point() filemanager = self.ddedockobject.child(self.filemanager) filemanager.click() rawinput.click(int(utils.resolution.width / 2), int(utils.resolution.height / 2)) time.sleep(2) win = utils.findWindow(self.filemanager_windowname) self.assertTrue(win != None)
def testCloseGedit(self): icongedit = self.ddedockobject.child(self.gediticonname) icongedit.click(3) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.down_key) utils.keySingle(utils.k.enter_key) geditwin1 = utils.findWindow(self.dock.string_Text_Editor_Window4, mode="nowait", comparetype="notequal") geditwin2 = utils.findWindow(self.dock.string_Text_Editor_Window4, mode="nowait", comparetype="notequal") geditwin3 = utils.findWindow(self.dock.string_Text_Editor_Window4, mode="nowait", comparetype="notequal") geditwin4 = utils.findWindow(self.dock.string_Text_Editor_Window4, mode="nowait", comparetype="notequal") self.assertTrue(None == geditwin1) self.assertTrue(None == geditwin2) self.assertTrue(None == geditwin3) self.assertTrue(None == geditwin4)
def testOpenFileManager(self): google = self.ddedockobject.child(self.filemanager) google.click() rawinput.click(int(utils.resolution.width/2), int(utils.resolution.height/2)) if utils.dock.hidemode_keephidden != self.defaulthidemode: utils.setDdeDockHideMode(utils.dock.hidemode_keephidden) hidemode = utils.getDdeDockHideMode() hidestate = utils.getDdeDockHideState() self.assertTrue(hidemode == utils.dock.hidemode_keephidden) self.assertTrue(hidestate == utils.dock.hidestate_hide) win = utils.findWindow(self.filemanager_windowname) self.assertTrue(win != None)
def tearDownClass(cls): if utils.getDdeDockDisplayMode() != utils.dock.displaymode_fashion: utils.setDdeDockDisplayMode(utils.dock.displaymode_fashion) if utils.getDdeDockPosition() != utils.dock.position_bottom: utils.setDdeDockPosition(utils.dock.position_bottom) if utils.getDdeDockHideMode() != utils.dock.hidemode_keepshowing: utils.setDdeDockHideMode(utils.dock.hidemode_keepshowing) win = utils.findWindow(cls.filemanager_windowname) if win != None: win.unmaximize() win.close(time.time())
def testOpenFileManager(self): launcher = self.ddedockobject.child("Launcher") launcher.point() managerobj = self.ddedockobject.child(self.filemanager) managerobj.click() rawinput.absoluteMotion(int(utils.resolution.width / 2), int(utils.resolution.height / 2)) if utils.dock.hidemode_smarthide != self.defaulthidemode: utils.setDdeDockHideMode(utils.dock.hidemode_smarthide) hidemode = utils.getDdeDockHideMode() hidestate = utils.getDdeDockHideState() self.assertTrue(hidemode == utils.dock.hidemode_smarthide) win = utils.findWindow(self.filemanager_windowname) self.assertTrue(win != None)
def tearDownClass(cls): global result utils.commitresult(cls.caseid, result) if utils.dock.displaymode_fashion != cls.defaultdisplaymode: utils.setDdeDockDisplayMode(cls.defaultdisplaymode) if utils.dock.position_bottom != cls.defaultposition: utils.setDdeDockPosition(cls.defaultposition) if utils.dock.hidemode_keepshowing != cls.defaulthidemode: utils.setDdeDockHideMode(cls.defaulthidemode) google = cls.ddedockobject.child(cls.filemanager) win = utils.findWindow(cls.filemanager_windowname) win.close(time.time())
def tearDownClass(cls): global result utils.commitresult(cls.caseid, result) if utils.getDdeDockDisplayMode() != cls.defaultdisplaymode: utils.setDdeDockDisplayMode(cls.defaultdisplaymode) if utils.getDdeDockPosition() != cls.defaultposition: utils.setDdeDockPosition(cls.defaultposition) if utils.getDdeDockHideMode() != cls.defaulthidemode: utils.setDdeDockHideMode(cls.defaulthidemode) google = cls.ddedockobject.child(cls.filemanager) win = utils.findWindow(cls.filemanager_windowname) if None != win: win.close(time.time())
def testClick(self): appwin = utils.findWindow(self.chromewindowname, comparetype="notequal") appstate = utils.WindowState(self.chromewindowname, comparetype="notequal") self.assertTrue(False == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(True == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(False == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(True == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(False == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(True == appstate.is_minimized()) self.clickDockAppIcon() self.assertTrue(False == appstate.is_minimized())
def testSetDock(self): utils.keySingle(utils.k.windows_l_key) try: launcherwin = utils.findWindow("dde-launcher") except: self.assertTrue(False, "Can't open dde-launcher") utils.keyTypeString(self.filemanagerlauncher) app = launcher.getAppObj(self.filemanagericonname) app.click(3) try: dockmenuapp = root.application('deepin-menu', '/usr/lib/deepin-menu') dockmenu = dockmenuapp.child(utils.desktop.desktopmenuname) except: self.assertTrue(False, "Can't find desktopmenu") utils.keySingle('c')
def testDragIconToDock(self): utils.keySingle(utils.k.windows_l_key) try: launcherwin = utils.findWindow("dde-launcher") except: self.assertTrue(False, "Can't open dde-launcher") utils.keyTypeString("deepin-screenshot") try: launcher_icon = self.ddedockobject.child("Launcher") except: self.assertTrue(False, "Can't find launcher icon") apps = launcher.getLauncherAllApps() fromXY = launcher.getAppCenterCoor(apps[0]) toXY = utils.getDockIconCenterPoint(launcher_icon) utils.mouseDragIconToDock((int(fromXY[0]), int(fromXY[1])), toXY) time.sleep(1) self.testDeepinScreenshotExistOnDock() time.sleep(1)
def testDragIconToDock(self): self.dbus_launcher.Show() try: launcherwin = utils.findWindow("dde-launcher") except: self.assertTrue(False, "Can't open dde-launcher") utils.keyTypeString("gedit") try: launcher_icon = self.ddedockobject.child(self.dock.string_Show_Desktop) except: self.assertTrue(False, "Can't find launcher icon") apps = launcher.getLauncherAllApps() fromXY = launcher.getAppCenterCoor(apps[0]) toXY = utils.getDockIconCenterPoint(launcher_icon) utils.mouseDragIconToDock((int(fromXY[0]), int(fromXY[1])), toXY) time.sleep(1) self.testGeditExistOnDock() time.sleep(1)
def testOpenFileManager(self): launcher = self.ddedockobject.child("Launcher") launcher.point() managerobj = self.ddedockobject.child(self.filemanager) managerobj.click() ddedock = self.ddedockobject.child(self.dock_mainwindow) (width, height) = ddedock.size if utils.dock.hidemode_smarthide != self.defaulthidemode: utils.setDdeDockHideMode(utils.dock.hidemode_smarthide) rawinput.absoluteMotion(int(utils.resolution.width / 2), int(utils.resolution.height / 2)) time.sleep(3) hidemode = utils.getDdeDockHideMode() hidestate = utils.getDdeDockHideState() self.assertTrue(hidemode == utils.dock.hidemode_smarthide) time.sleep(2) win = utils.findWindow(self.filemanager_windowname) utils.resizeWindow(win, height + 1, height + 1, utils.resolution.width - 2 * height - 20, utils.resolution.height - 2 * height - 20) self.assertTrue(win != None)
def testActivateFileManager(self): win = utils.findWindow(self.filemanager_windowname) win.activate(time.time()) self.assertTrue(win != None) self.assertTrue(win.is_maximized())
def testMaximizeFileManager(self): win = utils.findWindow(self.filemanager_windowname) win.maximize() time.sleep(2) self.assertTrue(win != None)
def testOpenFileManager(self): google = self.ddedockobject.child(self.filemanager) google.click() win = utils.findWindow(self.filemanager_windowname) self.assertTrue(win != None)
def testActivateFileManager(self): filemanager = self.ddedockobject.child(self.filemanager) win = utils.findWindow(self.filemanager_windowname) win.activate(time.time()) self.assertTrue(win != None) self.assertTrue(win.is_maximized())
def testMaximizeFileManager(self): filemanager = self.ddedockobject.child(self.filemanager) win = utils.findWindow(self.filemanager_windowname) win.maximize() self.assertTrue(win != None)
def testActivateFileManager(self): google = self.ddedockobject.child(self.filemanager) win = utils.findWindow(self.filemanager_windowname) win.activate(time.time()) self.assertTrue(win != None) self.assertTrue(win.is_maximized())
def testCloseFileManager(self): filemanagerwin = utils.WindowState(self.filemanagerwindowname) filemanagerwin.close() win = utils.findWindow(self.filemanagerwindowname, mode="nowait") self.assertTrue(None == win)
def testExpectResult(self): filemanagerwin = utils.findWindow(self.filemanagerwindowname, mode="nowait") self.assertTrue(None == filemanagerwin)
def testAppExist(self): appwin = utils.findWindow(self.filemanagerwindowname, comparetype="notequal") self.assertTrue(None != appwin)
def testCloseTerminal(self): terminalwin = utils.findWindow(self.terminalwindowname) utils.closeWindow(terminalwin) terminalwin_later = utils.findWindow(self.terminalwindowname, mode="nowait") self.assertTrue(None == terminalwin_later)