Chrome, Firefox只需要修改conftest.py文件中的
@pytest.fixture(scope='session')
def browser():
return BzwUtil.read_yml('config.yml','WEB_INFO','BROWSER')
''' add option in pytest command line '''
def pytest_addoption(parser):
parser.addoption("--browser", action="store", default="Firefox")
parser.addoption("--authentication", action="store", default="BZInternal")
parser.addoption("--data_source", action="store", default="BZInternal")
parser.addoption("--test_branch", action="store", default="Master")
parser.addoption("--bzw_server", action="store", default="localhost:8543")
而Edge需要按照如下操作
https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
执行该操作时,有可能需要用Run as Administrator
DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0