def run(self, configfile): config = ConfigParser.ConfigParser() config.read(configfile) reportfolder = os.path.join(config.get('general', 'report_output_path'), str(datetime.datetime.now())) os.makedirs(reportfolder) e = Eukalypse() e.browser = 'chrome' e.output = reportfolder #fix me here for test_key in config.get('tests'): print test_key #test = config['tests'][test_key] #eukalypse_result_object = e.compare(test_key, test['reference_image'], test['url']) #logger.debug(eukalypse_result_object.clean) e.disconnect() #write report #sendmail if config.get('general', 'report_send_mail'): logger.warn("mailsending not yet implemented")
def run(self, configfile): config = ConfigParser.ConfigParser() config.read(configfile) reportfolder = os.path.join( config.get('general', 'report_output_path'), str(datetime.datetime.now())) os.makedirs(reportfolder) e = Eukalypse() e.browser = 'chrome' e.output = reportfolder #fix me here for test_key in config.get('tests'): print test_key #test = config['tests'][test_key] #eukalypse_result_object = e.compare(test_key, test['reference_image'], test['url']) #logger.debug(eukalypse_result_object.clean) e.disconnect() #write report #sendmail if config.get('general', 'report_send_mail'): logger.warn("mailsending not yet implemented")
def pytest_funcarg__eukalypse(request): import os eukalypse = Eukalypse() eukalypse.resolution = (1280, 768) eukalypse.browser = 'chrome' eukalypse.output = TMP_DIR #monkeypatch the Eukalypse object tp NOT use selenium but our own mock class funcType = type(Eukalypse.connect) eukalypse.connect = funcType(connect, eukalypse, Eukalypse) eukalypse.connect() def eukalypse_teardown(): eukalypse.disconnect() request.addfinalizer(eukalypse_teardown) return eukalypse
We need a web server, serving tests/assets/webroot/* as document root on port 8400 """ import sys import os import inspect sys.path.append(os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '../eukalypse')) from eukalypse import Eukalypse from PIL import Image from PIL import ImageDraw import logging as logger logger.basicConfig(level=logger.INFO) tmp_folder = 'tests/assets' e = Eukalypse() e.resolution = (1280, 768) e.browser = 'phantomjsbin' e.output = tmp_folder e.connect() logger.info("getting first screenshot") screenshot = e.screenshot('reference_test_screenshot', 'http://localhost:8400/index.html') logger.info("writing reference_test_screenshot.png") logger.info("getting second screenshot") screenshot = e.screenshot('reference_test_screenshot_index2', 'http://localhost:8400/index2.html') logger.info("writing reference_test_screenshot_index2.png") statement = """ driver = self.driver driver.get("http://localhost:8400/index.html") driver.set_window_size(1280, 768)
We need a web server, serving tests/assets/webroot/* as document root on port 8400 """ import sys import os import inspect sys.path.append( os.path.join(os.path.dirname(inspect.getfile(inspect.currentframe())), '../eukalypse')) from eukalypse import Eukalypse from PIL import Image from PIL import ImageDraw import logging as logger logger.basicConfig(level=logger.INFO) tmp_folder = 'tests/assets' e = Eukalypse() e.resolution = (1280, 768) e.browser = 'phantomjsbin' e.output = tmp_folder e.connect() logger.info("getting first screenshot") screenshot = e.screenshot('reference_test_screenshot', 'http://localhost:8400/index.html') logger.info("writing reference_test_screenshot.png") logger.info("getting second screenshot") screenshot = e.screenshot('reference_test_screenshot_index2', 'http://localhost:8400/index2.html') logger.info("writing reference_test_screenshot_index2.png") statement = """ driver = self.driver