def diffbrowsers_new_family(self): fonts_to_test = self._select_fonts_for_diffbrowsers() diffbrowsers = DiffBrowsers(self.bstack_auth, self.path) diffbrowsers.new_session(fonts_to_test, fonts_to_test,) self.gfr_url = 'http://www.gf-regression.com/compare/' + diffbrowsers.gf_regression.uuid diffbrowsers.diff_view('waterfall', gen_gifs=True) diffbrowsers.update_browsers(test_browsers['osx_browser']) diffbrowsers.diff_view('glyphs-all', 26, gen_gifs=True) self._get_images() self.diffbrowsers_report = cli_reporter(diffbrowsers.stats)
def diffbrowsers_new_family(self): fonts_to_test = self._select_fonts_for_diffbrowsers() diffbrowsers = DiffBrowsers(self.bstack_auth, self.path) diffbrowsers.new_session( fonts_to_test, fonts_to_test, ) self.gfr_url = 'http://www.gf-regression.com/compare/' + diffbrowsers.gf_regression.uuid diffbrowsers.diff_view('waterfall', gen_gifs=True) diffbrowsers.update_browsers(test_browsers['osx_browser']) diffbrowsers.diff_view('glyphs-all', 26, gen_gifs=True) self._get_images() self.diffbrowsers_report = cli_reporter(diffbrowsers.stats)
def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('fonts_after', nargs="+", help="Fonts after paths") before_group = parser.add_argument_group(title="Fonts before input") before_input_group = before_group.add_mutually_exclusive_group( required=True) before_input_group.add_argument('-fb', '--fonts-before', nargs="+", help="Fonts before paths") before_input_group.add_argument( '-gf', '--from-googlefonts', action='store_true', help="Diff against GoogleFonts instead of fonts_before") parser.add_argument('-o', '--output-dir', help="Directory for output images", required=True) args = parser.parse_args() auth = load_browserstack_credentials() browsers_to_test = test_browsers['all_browsers'] fonts_before = 'from-googlefonts' if args.from_googlefonts \ else args.fonts_before diffbrowsers = DiffBrowsers(dst_dir=args.output_dir, browsers=browsers_to_test) diffbrowsers.new_session(fonts_before, args.fonts_after) diffbrowsers.diff_view('waterfall', gen_gifs=True) logger.info("Sleeping for 10 secs. Giving Browserstack api a rest") time.sleep(10) diffbrowsers.update_browsers(test_browsers['osx_browser']) diffbrowsers.diff_view('glyphs-modified', gen_gifs=True) report = cli_reporter(diffbrowsers.stats) report_path = os.path.join(args.output_dir, 'report.txt') with open(report_path, 'w') as doc: doc.write(report) print(report)
def diffbrowsers_family_update(self, fonts_before='from-googlefonts'): """Compare and regression test the fonts on different browsers. If the family contains more than 3 weights, select the thinnest, heaviest and median styles. Proofing more than 3 styles leads to huge images. The median style will likely pick up any multiple master compatibility issues.""" fonts_to_test = self._select_fonts_for_diffbrowsers() diffbrowsers = DiffBrowsers(self.bstack_auth, self.path) diffbrowsers.new_session(fonts_before, fonts_to_test) self.gfr_url = 'http://www.gf-regression.com/compare/' + diffbrowsers.gf_regression.uuid diffbrowsers.diff_view('waterfall', gen_gifs=True) diffbrowsers.update_browsers(test_browsers['osx_browser']) diffbrowsers.diff_view('glyphs-modified', gen_gifs=True) diffbrowsers.diff_view('glyphs-missing', gen_gifs=True) diffbrowsers.diff_view('glyphs-new', gen_gifs=True) diffbrowsers.diff_view('glyphs-all', 26, gen_gifs=True) self._get_images() self.diffbrowsers_report = cli_reporter(diffbrowsers.stats)