import time

from selenium.webdriver.common.by import By
from Base.BasePage import BasePage


# AI预审编辑页面
class Aiprequalification(BasePage):
    def __init__(self):
        super().__init__('web')
        # 上传按钮
        self.update_key = (By.XPATH, "//div[@class='proofred_UploadBtn']//span[1]")
        # 发送按钮
        self.send_file = (By.XPATH, "//button[contains(text(),'发送')]")
        # 上传文件
        self.update_file=(By.XPATH,"(//input[@id='file'])[2]")

    def update_pdf(self,updata_path):
        self.find_ele(self.update_key).click()
        time.sleep(5)
        self.find_ele(self.update_file).send_keys(updata_path)
        time.sleep(5)
        self.find_ele(self.send_file).click()
