Update example tests
This commit is contained in:
parent
5139e390f9
commit
bc92b3fd5b
|
@ -63,6 +63,7 @@ if pure_python:
|
|||
sb.enable_ws = False
|
||||
sb.enable_sync = False
|
||||
sb.use_auto_ext = False
|
||||
sb.undetectable = False
|
||||
sb.no_sandbox = False
|
||||
sb.disable_gpu = False
|
||||
sb._multithreaded = False
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
"""
|
||||
Determine if your browser is detectable by anti-bot services.
|
||||
Some sites use scripts to detect Selenium and then block you.
|
||||
To evade detection, add --uc as a pytest command-line option.
|
||||
"""
|
||||
from seleniumbase import BaseCase
|
||||
|
||||
|
||||
class UndetectedTest(BaseCase):
|
||||
def test_browser_is_undetected(self):
|
||||
self.open("https://nowsecure.nl")
|
||||
try:
|
||||
self.assert_text("OH YEAH, you passed!", "h1", timeout=6.6)
|
||||
self.post_message("Browser wasn't detected!", duration=1.6)
|
||||
self._print("\n Success! Website did not detect Selenium!")
|
||||
except Exception:
|
||||
self.fail('Browser was detected! Try using: "pytest --uc"')
|
Loading…
Reference in New Issue