19
19
<img src =" https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=2277EE " alt =" Latest Release on GitHub " /></a > <a href =" https://pypi.python.org/pypi/seleniumbase " >
20
20
<img src =" https://img.shields.io/pypi/v/seleniumbase.svg?color=22AAEE " alt =" Latest Release on PyPI " /></a > <a href =" https://seleniumbase.io " >
21
21
<img src =" https://img.shields.io/badge/docs-%20📖-11BBDD.svg " alt =" SeleniumBase.io Docs " /></a > <a href =" https://seleniumbase.io/help_docs/chinese/ " >
22
- <img src =" https://img.shields.io/badge/文件-%20中文-11BBDD.svg " alt =" SeleniumBase.io Docs " /></a > <a href =" https://travis-ci.org/seleniumbase/SeleniumBase " >
23
- <img src =" https://img.shields.io/travis/seleniumbase/SeleniumBase/master.svg " alt =" SeleniumBase on TravisCI " /></a > <a href =" https://github.com/seleniumbase/SeleniumBase/actions " >
22
+ <img src =" https://img.shields.io/badge/文件-%20中文-11BBDD.svg " alt =" SeleniumBase.io Docs " /></a > <a href =" https://github.com/seleniumbase/SeleniumBase/actions " >
24
23
<img src =" https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg " alt =" SeleniumBase GitHub Actions " /></a > <a href =" https://gitter.im/seleniumbase/SeleniumBase " >
25
24
<img src =" https://badges.gitter.im/seleniumbase/SeleniumBase.svg " alt =" SeleniumBase " /></a >
26
25
</p >
40
39
<a href =" https://seleniumbase.io/help_docs/method_summary/ " >📖 API语法</a > |
41
40
<a href =" https://seleniumbase.io/examples/tour_examples/ReadMe/ " >🗺️ 创建旅游</a > |
42
41
<a href =" https://seleniumbase.io/help_docs/translations/ " >🌎 语言翻译</a > |
43
- <a href =" https://seleniumbase.io/seleniumbase/utilities/selenium_ide/ReadMe/ " >⏺️ 录音机工具</a > |
44
42
<a href =" https://seleniumbase.io/examples/master_qa/ReadMe/ " >🛂 MasterQA</a > |
45
43
<a href =" https://seleniumbase.io/integrations/github/workflows/ReadMe/ " >🤖 持续集成</a >
46
44
</p >
@@ -344,11 +342,12 @@ pytest my_first_test.py --pdb -s
344
342
下面是Pytest附带的一些有用的命令行选项:
345
343
346
344
``` bash
347
- -v # Verbose mode. Prints the full name of each test run .
345
+ -v # Verbose mode. Prints the full name of each test and shows more details .
348
346
-q # Quiet mode. Print fewer details in the console output when running tests.
349
347
-x # Stop running the tests after the first failure is reached.
350
348
--html=report.html # Creates a detailed pytest-html report after tests finish.
351
- --collect-only | --co # Show what tests would get run. (Without running them)
349
+ --co | --collect-only # Show what tests would get run. (Without running them)
350
+ --co -q # (Both options together!) - Do a dry run with full test names shown.
352
351
-n=NUM # Multithread the tests using that many threads. (Speed up test runs!)
353
352
-s # See print statements. (Should be on by default with pytest.ini present.)
354
353
--junit-xml=report.xml # Creates a junit-xml report after tests finish.
@@ -365,8 +364,6 @@ SeleniumBase 为测试提供额外的Pytest命令行选项:
365
364
--edge # (Shortcut for "--browser=edge".)
366
365
--firefox # (Shortcut for "--browser=firefox".)
367
366
--safari # (Shortcut for "--browser=safari".)
368
- --cap-file=FILE # (The web browser's desired capabilities to use.)
369
- --cap-string=STRING # (The web browser's desired capabilities to use.)
370
367
--settings-file=FILE # (Override default SeleniumBase settings.)
371
368
--env=ENV # (Set the test env. Access with "self.env" in tests.)
372
369
--account=STR # (Set account. Access with "self.account" in tests.)
@@ -379,11 +376,15 @@ SeleniumBase 为测试提供额外的Pytest命令行选项:
379
376
--protocol=PROTOCOL # (The Selenium Grid protocol: http|https.)
380
377
--server=SERVER # (The Selenium Grid server/IP used for tests.)
381
378
--port=PORT # (The Selenium Grid port used by the test server.)
382
- --proxy=SERVER:PORT # (Connect to a proxy server:port for tests.)
383
- --proxy=USERNAME:PASSWORD@SERVER:PORT # (Use authenticated proxy server.)
384
- --proxy-bypass-list=STRING # (";"-separated hosts to bypass, Eg "*.foo.com")
379
+ --cap-file=FILE # (The web browser's desired capabilities to use.)
380
+ --cap-string=STRING # (The web browser's desired capabilities to use.)
381
+ --proxy=SERVER:PORT # (Connect to a proxy server:port as tests are running)
382
+ --proxy=USERNAME:PASSWORD@SERVER:PORT # (Use an authenticated proxy server)
383
+ --proxy-bypass-list=STRING # (";"-separated hosts to bypass, Eg "*.foo.com")
385
384
--proxy-pac-url=URL # (Connect to a proxy server using a PAC_URL.pac file.)
386
385
--proxy-pac-url=USERNAME:PASSWORD@URL # (Authenticated proxy with PAC URL.)
386
+ --proxy-driver # (If a driver download is needed, will use: --proxy=PROXY.)
387
+ --multi-proxy # (Allow multiple authenticated proxies when multi-threaded.)
387
388
--agent=STRING # (Modify the web browser's User-Agent string.)
388
389
--mobile # (Use the mobile device emulator while running tests.)
389
390
--metrics=STRING # (Set mobile metrics: "CSSWidth,CSSHeight,PixelRatio".)
@@ -392,6 +393,8 @@ SeleniumBase 为测试提供额外的Pytest命令行选项:
392
393
--firefox-pref=SET # (Set a Firefox preference:value set, comma-separated.)
393
394
--extension-zip=ZIP # (Load a Chrome Extension .zip|.crx, comma-separated.)
394
395
--extension-dir=DIR # (Load a Chrome Extension directory, comma-separated.)
396
+ --binary-location=PATH # (Set path of the Chromium browser binary to use.)
397
+ --driver-version=VER # (Set the chromedriver or uc_driver version to use.)
395
398
--sjw # (Skip JS Waits for readyState to be "complete" or Angular to load.)
396
399
--pls=PLS # (Set pageLoadStrategy on Chrome: "normal", "eager", or "none".)
397
400
--headless # (Run tests in headless mode. The default arg on Linux OS.)
@@ -423,18 +426,20 @@ SeleniumBase 为测试提供额外的Pytest命令行选项:
423
426
--disable-ws # (Disable Web Security on Chromium-based browsers.)
424
427
--enable-ws # (Enable Web Security on Chromium-based browsers.)
425
428
--enable-sync # (Enable "Chrome Sync" on websites.)
426
- --use-auto-ext # (Use Chrome's automation extension.)
427
429
--uc | --undetected # (Use undetected-chromedriver to evade bot-detection.)
428
- --uc-sub | --uc-subprocess # (Use undetected-chromedriver as a subprocess .)
429
- --remote-debug # (Enable Chrome's Remote Debugger on http ://localhost:9222 )
430
+ --uc-cdp-events # (Capture CDP events when running in "--undetected" mode .)
431
+ --remote-debug # (Sync to Chrome Remote Debugger chrome ://inspect/#devices )
430
432
--final-debug # (Enter Debug Mode after each test ends. Don't use with CI!)
431
433
--dashboard # (Enable the SeleniumBase Dashboard. Saved at: dashboard.html)
432
434
--dash-title=STRING # (Set the title shown for the generated dashboard.)
435
+ --enable-3d-apis # (Enables WebGL and 3D APIs.)
433
436
--swiftshader # (Use Chrome's "--use-gl=swiftshader" feature.)
434
437
--incognito # (Enable Chrome's Incognito mode.)
435
438
--guest # (Enable Chrome's Guest mode.)
439
+ --dark # (Enable Chrome's Dark mode.)
436
440
--devtools # (Open Chrome's DevTools when the browser opens.)
437
- --reuse-session | --rs # (Reuse the browser session between tests.)
441
+ --rs | --reuse-session # (Reuse browser session for all tests.)
442
+ --rcs | --reuse-class-session # (Reuse session for tests in class.)
438
443
--crumbs # (Delete all cookies between tests reusing a session.)
439
444
--disable-beforeunload # (Disable the "beforeunload" event on Chrome.)
440
445
--window-size=WIDTH,HEIGHT # (Set the browser's starting window size.)
0 commit comments