Exemplo n.º 1
0
 def launchFlixCheck(self, timeout):
     """Checker function to verify if Flix was launched."""
     log('## launchFlixCheck')
 
     wait(5)
 
     if self.launch.testInfo.flixVersion > "5.2":
         oneOrOther = sikuliUtils.oneOrTheOther('logInScreen.png', 'newShowButton.png', timeout)
     else:
         oneOrOther = sikuliUtils.oneOrTheOther('logInScreen.png', 'projectBrowser.png', timeout)
 
     if oneOrOther == 0:
         return 'login'
     elif oneOrOther == 1:
         log('- Project Browser open.')
         self.launch.projectBrowser.showing = True
     else:
         self.launch.testInfo.failed('launchFlixCheck: Could not find the Project Browser or log in screen.', True)
 
     log('All checks performed for launchFlix.')
Exemplo n.º 2
0
    def openInPhotoshop(self, panels, psMethod):
        """Opens one or multiple panels in Photoshop using Layer Comps ('layerComp') or Timeline ('timeline')

        panels -- List of panels to open in Photoshop
        psMethod -- Either open the panels in 'layerComp' or 'timeline' view in PS
        """
        log('##### openInPhotoshop')

        click(panels[0])
        if len(panels) != 1:
            for panel in panels[1:]:
                # click(panel, sikuli.KeyModifier.CTRL)
                sikuliUtils.ctrlClick(panel)

            if psMethod == 'layerComp':
                plugin = 'photoshopLayerComp.png'
            elif psMethod == 'timeline':
                plugin = 'photoshopTimeline.png'
            else:
                log('openInPhotoshop: %s psMethod is not supported in this test.' % psMethod)
                return
            if self.testInfo.flixVersion < '5.2':
                click(sikuliUtils.switchPlugin('editing', plugin))
            else:
                sikuliUtils.switchPlugin('editing', plugin)

        wait(1)
        # type(sikuli.Key.ENTER, sikuli.KeyModifier.CTRL)
        sikuliUtils.ctrlType('', sikuli.KeyModifier.ENTER)

        # Need to find a way to make sure the panel is open in Photoshop
        psState = sikuliUtils.oneOrTheOther('psOpen.png', 'psOpening.png', 30)
        if psState == 0:
            wait(5)
        elif psState == 1:
            wait(30)
        elif psState == 2:
            self.testInfo.failed('openInPhotoshop: Photoshop is not open and not opening.')

        sikuliUtils.psEdit()

        sikuli.App.focus('Google Chrome')

        for panel in panels:
            toPs.openInPhotoshopCheck(self.testInfo, panel)