def publishToFlixCheck2(self, comment, assetName, toShotgun, branch, asStills): log("## publishToFlixCheck:") publishSettings = checkUtils.readPublishSettings(self.fromEditorial.testInfo, assetName) timeout = publishSettings["timeout"] checkUtils.popupCheck(self.fromEditorial.testInfo, timeout, methodName="publishToFlixCheck") # Check the audio was created checkUtils.newAudioFile(self.fromEditorial.testInfo, methodName="publishToFlixCheck") # Update self.fromEditorial.testInfo if branch != "main": self.fromEditorial.testInfo.currentBranch = branch self.fromEditorial.testInfo.incrementEditVersion() # Check the editorial branch was created, the shotEdit is there and it's got the comment if not self.__checkShotEdit(comment): return 0 self.__checkMarkers(publishSettings["markers"]) self.__checkDuration(publishSettings["duration"]) self.__checkNPanels( publishSettings["stillRefs"] + publishSettings["animatedRefs"] + publishSettings["existing"] ) self.__checkPanels(publishSettings["stillRefs"], publishSettings["animatedRefs"], publishSettings["existing"]) log("All checks performed for publishToFlix.") return 1
def importAudioCheck(self, timeout): log('## importAudioCheck') if not exists('importAudioOK.png', timeout): self.importDrawing.testInfo.failed('importAudioCheck: No popup found after %s seconds.' % timeout) else: log('- Found popup after importing audio.') click('importAudioOK.png') sikuliUtils.saveVersion(self.importDrawing.testInfo, 'Imported audio.') # Check mp3 file is in the editorial directory checkUtils.newAudioFile(self.importDrawing.testInfo, methodName='importAudioCheck') # Check mp3 is in the shotEdit shotEdit = self.importDrawing.testInfo.getShotEdit() if shotEdit: mp3Found = pyUtils.findOccurences('.mp3', shotEdit) if mp3Found != 1: self.importDrawing.testInfo.failed('importAudioCheck: Expected 1 audio file in the shotEdit, ' 'found %s instead.' % mp3Found) else: log('- Found imported audio file in the current shotEdit.') self.importDrawing.testInfo.editAudio = 1 else: self.importDrawing.testInfo.failed('importAudioCheck: shotEdit not found, cannot check for audio.') log('All checks performed for importAudio.')
def publishSequencerCheck(self, mayaSettings): """After publishing a Maya sequencer to Flix, this methods checks that there's a new version of the sequence, there's a new audio file from the publish, there's a new movie for each new shot from the sequencer, all the new panels are in the new saved shotEdit, the multitrack, jpeg, xml and json files have been created for each new panel. :param mayaSettings: Dictionary created using readMayaSettings method :return: None """ log('## publishSequencerCheck') expectedDur = 0 for shotDuration in mayaSettings["shotDurations"]: expectedDur += shotDuration # Assume 2sec/frame as a timeout timeout = 2*expectedDur # Right now there's no popup or nothing processing, so no way to know until it's done # The best thing to do is wait until a new shotEdit gets created! currentShotEdit = self.fromMaya.testInfo.getShotEdit() currentVersion = self.fromMaya.testInfo.getEditVersion() newShotEdit = currentShotEdit.replace('_v%s.xml' % currentVersion, '_v%s.xml' % (currentVersion+1)) if pyUtils.waitForFile('/'.join(newShotEdit.split('/')[0:-1]) + '/', newShotEdit.split('/')[-1], timeout) == 0: self.fromMaya.testInfo.failed('publishSequencerCheck: Could not find v%s of the shotEdit after %s seconds.' % (currentVersion+1, timeout)) return else: log('- Found shotEdit for the new version of the edit.') self.fromMaya.testInfo.incrementEditVersion() self.fromMaya.testInfo.resetEdit() # Load latest version editorialDir = self.fromMaya.testInfo.getEditorialDir() # Check there's audio checkUtils.newAudioFile(self.fromMaya.testInfo, methodName="publishSequencerCheck") # Check the movie was copied movDir = '%smov/' % editorialDir nMovies = pyUtils.countFiles(movDir, '*.mov') if nMovies != (self.fromMaya.testInfo.publishedMovs + 1): self.fromMaya.testInfo.failed('publishSequencerCheck: Could not find the movie copied to the editorial/mov/ directory.' 'Expected %s movies, found %s instead.' % (self.fromMaya.testInfo.publishedMovs+1, nMovies)) else: log('- Found the movie copied in the editorial/mov directory.') self.fromMaya.testInfo.publishedMovs += 1 # Check there's nShot panels in the shotEdit newPanels = checkUtils.newPanelsInShotEdit(self.fromMaya.testInfo, {'a': mayaSettings["nShots"]}, methodName='publishSequencerCheck', beats=['a']) # Jpegs finish rendering after the shotEdit XML is created, so we need to wait some more before checking every # panel has its jpeg. Assuming 0.5 sec/frame for this sikuli.wait(int(expectedDur/2)) checkUtils.checkPanelDir(self.fromMaya.testInfo, newPanels, ['multitrack', 'jpg', 'xml'], 'publishSequencerCheck') foundDur = self.fromMaya.testInfo.getDurationFromShotEdit() if foundDur != expectedDur: self.fromMaya.testInfo.failed('addSequencerShotsCheck: Expected duration to be %s, is %s instead.' % (expectedDur, foundDur)) else: log('- Edit duration found to be %s as expected.' % foundDur) self.fromMaya.testInfo.editDuration = foundDur log('All checks performed for publishSequencer.')