#NEWLINE# @ pytest . fixture #NEWLINE# def screenshot( request ) : #NEWLINE# #INDENT# if ( request . config . option . driver != 'SauceLabs' ) : #NEWLINE# #INDENT# pytest . skip ( 'Screenshot tests can only be run with --driver=SauceLabs' ) #NEWLINE# #UNINDENT# capabilities = request . getfuncargvalue ( 'capabilities' ) #NEWLINE# if ( capabilities [ 'browserName' ] != 'firefox' ) : #NEWLINE# #INDENT# pytest . skip ( ( 'Screenshot tests can only be run with browserName firefox. Capabilties are: %s' % capabilities ) ) #NEWLINE# #UNINDENT# if ( capabilities [ 'platform' ] != 'Linux' ) : #NEWLINE# #INDENT# pytest . skip ( ( 'Screenshot tests can only be run with platform linux. Capabilities are: %s' % capabilities ) ) #NEWLINE# #UNINDENT# if request . config . option . set_new_base_screenshot : #NEWLINE# #INDENT# screenshot = Screenshot ( request = request , set_new_base = True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# screenshot = Screenshot ( request = request , set_new_base = False ) #NEWLINE# #UNINDENT# return screenshot