How to use unHighlightFilename method in fMBT

Best Python code snippet using fMBT_python

fmbtgti.py

Source:fmbtgti.py Github

copy

Full Screen

...3209 imgAgeAttr = ""3210 if isinstance(img, Screenshot):3211 #We must use the original screenshot modification time3212 try:3213 imgAge = time.time() - os.stat(self.unHighlightFilename(img.filename())).st_mtime3214 except:3215 #The file returned by unHighlightFilename did not exist.3216 pass3217 if imgAge > 0:3218 imgAgeAttr = ' data-imgage="%s"' % (imgAge,)3219 imgHtmlName = self.relFilePath(img.filename(), self._outFileObj)3220 imgHtml = '\n<div class="spacer"><img %s title="%s" src="%s" width="%s" alt="%s"%s/></div>' % (3221 imgClassAttr,3222 "%s refreshScreenshot() at %s:%s" % img._logCallReturnValue,3223 imgHtmlName, self._screenshotWidth, imgHtmlName, imgAgeAttr)3224 elif img:3225 try:3226 imgAge = time.time() - os.stat(self.unHighlightFilename(img)).st_mtime3227 except:3228 pass3229 if width: width = 'width="%s"' % (width,)3230 if type(imgTip) == tuple and len(imgTip) == 3:3231 imgTip = 'title="%s refreshScreenshot() at %s:%s"' % imgTip3232 if imgAge > 0:3233 imgAgeAttr = ' data-imgage="%s"' % (imgAge,)3234 else:3235 imgTip = 'title="%s"' % (imgTip,)3236 imgHtmlName = self.relFilePath(img, self._outFileObj)3237 imgHtml = '<div class="spacer"><img %s%s src="%s" %s alt="%s"%s/></div>' % (3238 imgClassAttr, imgTip, imgHtmlName, width, imgHtmlName, imgAgeAttr)3239 else:3240 imgHtml = ""3241 return "\n" + imgHtml + "\n"3242 def unHighlightFilename(self, screenshotFilename):3243 '''Get the filename of the original screenshot based on3244 the name of a highlighted screenshot.'''3245 if self._highlightCounter > 0:3246 try:3247 return re.match('(.*)\.\d{5}\.png', screenshotFilename).group(1)3248 except:3249 return screenshotFilename3250 else:3251 return screenshotFilename3252 def highlightFilename(self, screenshotFilename):3253 self._highlightCounter += 13254 retval = screenshotFilename + "." + str(self._highlightCounter).zfill(5) + ".png"3255 return retval3256 def changeCodeName(self, func, newName):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful