Beispiel #1
0
    def exportPdfCheck(self, panelsPerPage):
        log('## exportPdfCheck')

        # Assuming 5sec + 1sec/panel is enough to generate the PDF
        timeout = 5 + self.export.testInfo.getNumberPanelsFromShotEdit()

        pdfFile = "%s/%s_%s_%s_%s_%s.pdf" % (self.export.pdfDir,
                                             self.export.testInfo.show,
                                             self.export.testInfo.sequence,
                                             self.export.testInfo.getEditVersion(),
                                             self.export.testInfo.currentBranch,
                                             panelsPerPage)

        sikuli.wait(timeout)
        if not os.path.exists(pdfFile):
            self.export.testInfo.failed('exportPdfCheck: PDF was not generated in %s.' % self.export.pdfDir)
        else:
            log('- Found generated PDF.')
            sikuliUtils.closeChromeTab()

        if not checkUtils.popupCheck(self.export.testInfo, 5, "exportPdfCheck"):
            self.export.testInfo.failed('exportPdfCheck: Plugin failed, '
                                        'check log for errors. Exiting current checks...')

        log('All checks performed for exportPdf.')
    def __checkGuide(self, methodName):
        """Checks the PDF for the guide corresponding to the method name has been opened

        :param methodName: Name of the method calling me (e.g. "openUserGuideCheck")
        :return: None
        """
        log("## %s" % methodName)

        if methodName == "openGettingStartedGuideCheck":
            guideName = "Getting Started Guide"
            button = "gsgPdf.png"
        elif methodName == "openUserGuideCheck":
            guideName = "User Guide"
            button = "ugPdf.png"
        elif methodName == "openTechnicalGuideCheck":
            guideName = "Technical Guide"
            button = "tgPdf.png"
        else:
            log("checkGuide: Unknown method, exiting...", "error")
            return

        if not exists(button, 5):
            self.projectBrowser.testInfo.failed("%s: Could not find the %s." % (methodName, guideName))
        else:
            log("- Found the Getting Started Guide PDF in the Help menu.")
            sikuliUtils.closeChromeTab()

        click("projectBrowserHelpBtn.png")
        log("All checks performed for %s" % methodName.strip("Check"))
Beispiel #3
0
    def openEditorialGUI(self, timeout, closeFlix=False):
        """Opens Flix's Editorial GUI"""
        log('##### openEditorialGUI')

        pyUtils.resetEditorialGuiState()

        if closeFlix:
            sikuliUtils.closeChromeTab()  # Close the main Flix tab

        sikuliUtils.newChromeTab('http://127.0.0.1:35980/html/editorial.html')

        self.launchCheck.openEditorialGUICheck(timeout)
 def publishToFlix2(self, comment="Publish to Flix", assetName="refsFromPremiere", toShotgun=False, branch="main", asStills=True):
     log('##### publishToFlix')
     branch = "main"
     log("publishToFlix: branch set to 'main' by default as other branches aren't supported yet")
     self.testInfo.allAudio = pyUtils.countFiles(self.mp3Dir, "*.mp3")
 
     self.launch.openEditorialGUI(20, True)
     self.editorialProjectBrowser.selectEditorialProject()
 
     click(sikuli.Pattern('toAvidToFlix.png').targetOffset(20, 0)); wait(1)
     type(sikuli.Key.TAB); wait(1)
     type(sikuli.Key.TAB); wait(1)
     type(sikuli.Key.TAB); wait(1)
 
     movPath = "%s/%s.mov" % (self.assetsDir, assetName)
     type(movPath)
 
     type(sikuli.Key.TAB); wait(1)
     edlPathBase = "%s/%s" % (self.assetsDir, assetName)
     edlPathAvid = "%s.txt" % edlPathBase
     edlPathFcp = "%s.xml" % edlPathBase
     if os.path.exists(edlPathAvid):
         edlPath = edlPathAvid
     elif os.path.exists(edlPathFcp):
         edlPath = edlPathFcp
     else:
         log("publishToFlix: Could not find EDL file for %s editorial asset." % assetName, "error")
         # Close the Editorial GUI
         sikuliUtils.closeChromeTab()
         # Come back to Flix
         self.launch.openFlixGUI(10)
         self.projectBrowser.loadShow()
         self.projectBrowser.loadSequence()
         click("loadLatestVersion.png")
         return
 
     # settings['edl'] = edlPath
     type(edlPath)
 
     type(sikuli.Key.TAB); wait(1)
     if toShotgun:
         type(sikuli.Key.SPACE); wait(1)
 
     type(sikuli.Key.TAB); wait(1)
     if branch != "main":
         type(sikuli.Key.ENTER); wait(1)
 
     type(sikuli.Key.TAB); wait(1)
     if not asStills:
         type(sikuli.Key.SPACE); wait(1)
 
     type(sikuli.Key.TAB); wait(1)
     type(comment); wait(1)
 
     type(sikuli.Key.TAB); wait(1)
     type(sikuli.Key.ENTER)
 
     loadLatestVersion = self.fromEditorialCheck.publishToFlixCheck2(comment, assetName, toShotgun, branch, asStills)
 
     # Close the Editorial GUI
     sikuliUtils.closeChromeTab()
     # Come back to Flix
     self.launch.openFlixGUI(10)
     self.projectBrowser.loadShow()
     self.projectBrowser.loadSequence()
     if branch != "main" and loadLatestVersion:
         self.projectBrowser.switchToBranch(branch)
     elif loadLatestVersion:
         click('loadLatestVersion.png')
     else:
         self.projectBrowser.createCleanVersion()