-
When I run test_login.py, the inside self automatically creates a new browser window, instead of using the browser window generated by the confTest method Conftest. py is executed before PyTest has another test item, so you can write some precursors. What do I have to do to make conftest.py work properly? I have tried using methods like sb.click() that do not create new Windows without using BaseCase. But there is no code completion function in the writing process, which is very inconvenient What should I do |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @HellShuro, |
Beta Was this translation helpful? Give feedback.
Hi @HellShuro,
For the code auto-completion part, you'll need to use
BaseCase
inheritance, as most code editors will not be able to parse the methods from the pytestsb
fixture.For all standard SeleniumBase tests, the browser is spun up automatically at the start of every test, and then spun down automatically at the end of it. It replaces the need for having to use a
conftest.py
file to do that. If you need more driver control, you can use the example from https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_override_driver.py for overriding the driver as needed. You can also override thesetUp()
andtearDown()
methods from tests that inheritBaseCase
(see https://gith…