basic-auto-test/TestCase/test_demo.py

28 lines
855 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# -*- coding: utf-8 -*-
# @Author : caiweichao
# @explain : ui自动化demo
import time
from PageObject.page_baidu import PageBaidu
import pytest
import allure
# 使用打开浏览器的测试夹具会自动识别chrome浏览器版本并且安装对应的driver
@pytest.mark.usefixtures("global_step")
@pytest.mark.usefixtures("kill_driver")
@allure.feature('访问百度demo')
class TestDemo:
def test_baidu_demo1(self, global_step):
PageBaidu(global_step).get_baidu()
PageBaidu(global_step).input_keyword(keyword="getee")
PageBaidu(global_step).click_baidu_button()
time.sleep(3)
def test_baidu_demo2(self, global_step):
PageBaidu(global_step).get_baidu()
PageBaidu(global_step).input_keyword(keyword="github")
PageBaidu(global_step).click_baidu_button()
time.sleep(3)