init: 初始化项目
- 创建了基本的项目结构 - 添加了 .gitignore 文件 - 配置了基本的开发环境 - 添加清华镜像源 - 设置了基础的文件夹和文件(如 commons, utils, POM, pytest.ini) 项目说明: - [项目名称]:Web自动化测试 - [项目描述]:基于pytest,selenium的自动化测试工具 - [开发环境]:Python
This commit is contained in:
39
POM/test_login.py
Normal file
39
POM/test_login.py
Normal file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
"""
|
||||
@author: CNWei
|
||||
@Software: PyCharm
|
||||
@contact: t6i888@163.com
|
||||
@file: main
|
||||
@date: 2025/4/4 17:52
|
||||
@desc:
|
||||
"""
|
||||
from time import sleep
|
||||
import pytest
|
||||
from selenium.webdriver import Chrome
|
||||
from login_page import LoginPage
|
||||
from commons.modules import Browser
|
||||
|
||||
|
||||
@pytest.mark.parametrize("email, password", [("username", "password"), ("<EMAIL>", "<PASSWORD>")])
|
||||
def test_login(driver, email, password):
|
||||
login = LoginPage()
|
||||
|
||||
login.login(email, password)
|
||||
# sleep(10)
|
||||
|
||||
|
||||
def test_logout_1(login_ok):
|
||||
login = LoginPage()
|
||||
login.browser(Browser.CHROME)
|
||||
login.get("https://www.baidu.com/")
|
||||
print("logout")
|
||||
|
||||
|
||||
# @pytest.mark.usefixtures("login_ok")
|
||||
def test_logout_2():
|
||||
login = LoginPage()
|
||||
login.browser(Browser.CHROME)
|
||||
login.get("https://www.baidu.com/")
|
||||
print("logout")
|
||||
Reference in New Issue
Block a user