import time

import allure

from common.DButils import DButils
from common.untils import DriverTools
from config import user_name, password,login_url,Aibook_file_text
from paga.AIEditingRoomPage import AIER
from paga.AITopicplanningPaga import AITopicplanning
from paga.LoginPage import Login
from common.cutils import ws_error

# AI选题策划编辑页面ui自动化测试
class TestaiSelectedtopic:
    # 类前置
    def setup_class(self):
        self.login = Login()
        self.AIroom = AIER()
        self.aitopicplanning = AITopicplanning()
        self.dbtuils = DButils()

    def setup_method(self):
        self.driver = DriverTools.get_driver().get(login_url)
        self.login.login(user_name, password)
        self.AIroom.to_AI_Topicplanning()

    # 类后置
    def teardown_class(self):
        DriverTools.quit_driver()

    # AI选题策划编辑-取书名
    @allure.feature("取书名流程")
    def test_booktitle(self):
        self.aitopicplanning.ai_booktitle()
        time.sleep(20)
        ws_error(1)
        time.sleep(3)






