SeleniumBase/help_docs/how_it_works.md

1.5 KiB
Executable File

How it works:

At the core, SeleniumBase works by extending pytest and nosetests as a direct plugin to each one. SeleniumBase automatically spins up web browsers for tests, and then gives those tests access to the SeleniumBase libraries through the BaseCase class. Tests are also given access to SeleniumBase command-line arguments, which provide additional functionality.

(NOTE: pytest and nosetests use a feature called test discovery to automatically find and run Python methods that start with "test_" from the file that you specified on the command line.)

To use SeleniumBase calls you need the following:

from seleniumbase import BaseCase

And then have your test classes inherit BaseCase:

class MyTestClass(BaseCase):

(See the example test, my_first_test.py, for reference.)