Exemple #1
0
 def screenshots(self, describe=None):
     """
     A screenshot that adds a watermark to the corresponding element
     """
     global driver
     w, h = self.center()
     screenshots_dir = screenshots_name(describe)
     driver.screenshot(screenshots_dir)
     processing(screenshots_dir, w, h)
Exemple #2
0
 def screenshots(w=None, h=None, describe=None):
     """
     截图
     """
     global driver
     screenshots_dir = screenshots_name(describe)
     driver.screenshot().save(screenshots_dir)
     multiple = driver.scale
     w, h = multiple * w, multiple * h
     processing(screenshots_dir, w, h)
Exemple #3
0
    def screenshots(self, w=None, h=None, describe=None):
        """
        截图
        """
        if w is not None and h is not None:
            if float(w) < 1 and float(h) < 1:
                multiple = self.driver.scale
                w, h = multiple * w, multiple * h

        screenshots_dir = screenshots_name(describe)
        self.driver.screenshot().save(screenshots_dir)
        processing(screenshots_dir, w, h)
Exemple #4
0
    def screenshots(self, w=None, h=None, describe=None):
        """
        截图
        """
        if w and h:
            if w < 1 and h < 1:
                x, y = self.window_size()
                w, h = x * w, y * h

        screenshots_dir = screenshots_name(describe)
        self.driver.screenshot(screenshots_dir)
        processing(screenshots_dir, w, h)
Exemple #5
0
 def screenshots(self, describe=None):
     """
     截图,在对应元素上增加水印
     """
     global driver
     text = driver.xpath(self.xpath).get_text()
     if text == "":
         w, h = None, None
     else:
         w, h = driver(text=text).center()
     screenshots_dir = screenshots_name(describe)
     driver.screenshot(screenshots_dir)
     processing(screenshots_dir, w, h)