File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1384,6 +1384,8 @@ def setUp(self):
1384
1384
self .with_basic_test_info = (
1385
1385
pytest .config .option .with_basic_test_info )
1386
1386
self .with_page_source = pytest .config .option .with_page_source
1387
+ self .servername = pytest .config .option .servername
1388
+ self .port = pytest .config .option .port
1387
1389
self .database_env = pytest .config .option .database_env
1388
1390
self .log_path = pytest .config .option .log_path
1389
1391
self .browser = pytest .config .option .browser
@@ -1393,6 +1395,10 @@ def setUp(self):
1393
1395
self .highlights = pytest .config .option .highlights
1394
1396
self .verify_delay = pytest .config .option .verify_delay
1395
1397
self .timeout_multiplier = pytest .config .option .timeout_multiplier
1398
+ self .use_grid = False
1399
+ if self .servername != "localhost" :
1400
+ # Use Selenium Grid (Use --server=127.0.0.1 for localhost Grid)
1401
+ self .use_grid = True
1396
1402
if self .with_db_reporting :
1397
1403
self .execution_guid = str (uuid .uuid4 ())
1398
1404
self .testcase_guid = None
Original file line number Diff line number Diff line change @@ -70,6 +70,16 @@ def pytest_addoption(parser):
70
70
dest = 'with_page_source' ,
71
71
default = False ,
72
72
help = "Use to save page source on test failure." )
73
+ parser .addoption ('--server' , action = 'store' ,
74
+ dest = 'servername' ,
75
+ default = 'localhost' ,
76
+ help = """Designates the server used by the test.
77
+ Default: localhost.""" )
78
+ parser .addoption ('--port' , action = 'store' ,
79
+ dest = 'port' ,
80
+ default = '4444' ,
81
+ help = """Designates the port used by the test.
82
+ Default: 4444.""" )
73
83
parser .addoption ('--headless' , action = "store_true" ,
74
84
dest = 'headless' ,
75
85
default = False ,
You can’t perform that action at this time.
0 commit comments