import time

from selenium.webdriver.common.by import By

from Base.BasePage import BasePage
# from kuangjia.common.untils import DriverTools
# from kuangjia.paga.CreatePage import Create
# from kuangjia.paga.LoginPage import Login


class Code(BasePage):
    def __init__(self):
        super().__init__('web')
        # 书小二码
        self.reader_digital = (By.XPATH, "//div[@class='select-list']//div[1]//div[2]")
        # 入驻公众号
        self.reader_account = (By.ID, "accountSettingId")
        self.reader_official = (By.XPATH, "/html/body/div[3]/div/div/div/div[2]/div[1]/div/div/div[2]/div/i")
        # 创建按钮
        self.reader_OR = (By.XPATH, "/html/body/div/div/section/div[1]/div[2]/div/div[2]/div[2]/button[2]")
        # 配置服务
        self.reader_give = (By.XPATH, "//button[2]//span[1]")

    def code(self):
        self.find_ele(self.reader_digital).click()
        time.sleep(1)
        self.find_ele(self.reader_account).click()
        time.sleep(1)
        self.find_ele(self.reader_official).click()
        time.sleep(1)
        self.find_ele(self.reader_OR).click()
        time.sleep(1)
        self.find_ele(self.reader_give).click()
        time.sleep(1)
