import configparser
import os
import platform


config = configparser.ConfigParser()
dir = os.path.abspath('.').split('src')[0]
config.read(dir + "/config/config.ini", encoding='utf-8')


# 根据配置文件获取测试url
def test_location():
    current_platform = platform.system().lower()
    if current_platform == "windows":
        location = config.get("testServer", "win_app_location")
        return location
    elif current_platform == "darwin":
        location = config.get("testServer", "mac_app_location")
        return location


def test_account():
    return config.get("account", "username")


def test_password():
    return config.get("account", "password")