# -*- coding:utf-8 -*- 
"""
describe：配置文件
Author：wangchao
Time: 2023/12/5
"""
import os
class Config:
    # 浏览器类型定义
    browser = "chromium"
    # CMS web端访问地址
    url = "http://127.0.0.1:18000"
    # CMS token
    CMS_TOKEN = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiU3VwZXJBZG1pbiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWVpZGVudGlmaWVyIjoiU3VwZXJBZG1pbiIsImlzcyI6IkNNU3YyIiwiYXVkIjoiQXBpIn0.AJUOE6YQ5MAxDqHOIz-yQbpCKPNq5tPoFBWUY381qns"

    #project_id = "158"

    # 项目目录定义
    root_dir = os.path.abspath(os.getcwd().split('Config.py')[0])
    # root_dir = os.path.split(os.path.split(__file__)[0])[0]
    test_project_dir = root_dir + os.path.sep + "ProjectData"
    test_files_dir = root_dir + os.path.sep + "TestFiles"
    test_cases_dir = root_dir + os.path.sep + "TestCases"
    test_datas_dir = root_dir + os.path.sep + "TestDatas"
    test_report_dir = root_dir + os.path.sep + "TestReport" + os.path.sep + "AllureReport"
    test_report_parent_dir = root_dir + os.path.sep + "TestReport"
    test_result_dir = root_dir + os.path.sep + "TestReport" + os.path.sep + "AllureResult"
    test_screenshot_dir = root_dir + os.path.sep + "TestReport" + os.path.sep + "Screenshot"
    test_video_dir = root_dir + os.path.sep + "TestReport" + os.path.sep + "Videos"
    logs = root_dir + os.path.sep + "Logs"
    # 图像对比路径定义
    img_dir = root_dir + os.path.sep + "ImageComparison"
    # result_img_dir = root_dir + os.path.sep + "ImageComparison" + os.path.sep + "result_img"
    # 图像识别路径定义
    screenshot_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "screenshot_img"
    template_img_dir = root_dir + os.path.sep + "ImageRecognition" + os.path.sep + "template_img" + os.path.sep

    # 日志相关配置
    log_name = "console_log_"
    log_level = "info"
    log_format = '[%(asctime)s] %(filename)s->%(funcName)s line:%(lineno)d [%(levelname)s] %(message)s'

    #开发版 截图范围
    editor_x_coordinate = 340  # 左上角 x 坐标
    editor_y_coordinate = 230  # 左上角 y 坐标
    editor_width = 1100    # 区域宽度
    editor_height = 600    # 区域高度

    # 运行版 截图范围
    vision_x_coordinate = 0  # 左上角 x 坐标
    vision_y_coordinate = 0  # 左上角 y 坐标
    vision_width = 1920  # 区域宽度
    vision_height = 1080  # 区域高度

    # 自定义截图范围
    custom_x_coordinate = 340  # 左上角 x 坐标
    custom_y_coordinate = 230  # 左上角 y 坐标
    custom_width = 1100  # 区域宽度
    custom_height = 600  # 区域高度

    # 将组件拖到画布指定区域
    target_point_x = 820  # 目标点横坐标
    target_point_y = 450  # 目标点纵坐标

    #图片比对的相似性阈值
    similarity_threshold = 0.1

#     def pr(self):
#         print(self.root_dir)
#         print(self.expected_img_dir)
#
# if __name__ == '__main__':
#     Config().pr()

