Package tlib :: Package base :: Module SeleniumTester :: Class SeleniumTester |
[hide private]
[frames] | no frames]

# Class SeleniumTester

source code

                   object --+
                            |
    PytestTester.PytestTester --+
                                |
                               SeleniumTester

Instance Methods | [hide private]
_get_browser(self) Returns Instance of the WebDriver browser | source code
_set_browser(self, browser) Instance of the WebDriver browser | source code
_get_homepage(self) Instance of the WebDriver homepage | source code
_set_homepage(self, homepage) Instance of the WebDriver homepage | source code
initialize_class(self, test_logger, tlib_logger, browser, base_url) | source code
get_unused_report_name(self, tc_id, tc_name) Gets a string based on test case id and name, taking into account if test case has already been run or not | source code
generate_class_report(self, request) Generates HTML page with all test case results for the class | source code
generate_test_report(self, request) Generates HTML page with all the screenshots for a test case Supports generating different When test cases are run multiple times with the same arguments | source code
navigate(self, page, save_screenshot=True) Navigate to "page" | source code
go_home(self, save_screenshot=True) Navigate to home page | source code
save_screenshot(self, description) Saves screen shot for the current page | source code
wait_for_page_loaded(self, timeout=10) Waist until document.readyState is equal to complete | source code
setup_method(self, request) Goes to homepage before each test, unless marker skipsetup is given | source code
wait_for_element_to_be_visible(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
wait_for_element_to_be_clickable(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
wait_for_element_to_be_present(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
wait_for_element_to_be_selected(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
wait_for_element_to_be_invisible(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
wait_for_test_to_be_present_in_element(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) | source code
wait_for_test_to_be_present_in_element_value(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) | source code
Inherited from `PytestTester.PytestTester`: `log` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__init__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Static Methods | [hide private]
screenshot_folder() Returns project's screenshot folder This method must be defined in subclasses | source code

Class Variables | [hide private]
| _homepage = `None`
| _test_logger = `None`
| _tlib_logger = `None`
| _browser = `None`
| _folder_dest = `None`
| _test_case_id = `None`
| _test_case_name = `None`
| _test_params = `None`
| _jinja_env = `jinja2.Environment(loader= jinja2.FileSystemLoade`...``
| _screenshot_report = `None`
| _screenshot_report_template = `<Template 'screenshot_report.html'>`
| _screenshots = ``{``}``
| _tc_screenshot_template = `<Template 'testcase_screenshots.html'>`

Properties | [hide private]
| browser Returns Instance of the WebDriver browser
webdriver.Remote | homepage Instance of the WebDriver homepage
logging | test_logger Logger object to log test information
Inherited from `object`: `__class__`

Method Details | [hide private]

### initialize_class(self, test_logger, tlib_logger, browser, base_url) | source code
Parameters: `test_logger` (logging) `browser` (webdriver.Remote Stores an instance of browser and test_logger) Decorators: `@pytest.fixture(scope= 'class', autouse= True)`

### get_unused_report_name(self, tc_id, tc_name) | source code
Gets a string based on test case id and name, taking into account if test case has already been run or not Parameters: `tc_id` (str) - Test case id `tc_name` (str) - Test case name

### generate_class_report(self, request) | source code
Generates HTML page with all test case results for the class Parameters: `request` (FixtureRequest) Decorators: `@pytest.fixture(scope= 'class', autouse= True)`

### generate_test_report(self, request) | source code
Generates HTML page with all the screenshots for a test case Supports generating different When test cases are run multiple times with the same arguments Parameters: `request` (FixtureRequest) Decorators: `@pytest.fixture(scope= 'function', autouse= True)`

### wait_for_page_loaded(self, timeout=10) | source code
Waist until document.readyState is equal to complete Parameters: `timeout` (Integer) - Number of seconds before timing out

### setup_method(self, request) | source code
Goes to homepage before each test, unless marker skipsetup is given Decorators: `@pytest.fixture(scope= 'function', autouse= True)`

Class Variable Details | [hide private]

  ### _jinja_env Value:
      jinja2.Environment(loader= jinja2.FileSystemLoader(TestHelper.tlib_tem
      plate_folder()), trim_blocks= True)

Property Details | [hide private]

### browser Returns Instance of the WebDriver browser Get Method: _get_browser(self) - Returns Instance of the WebDriver browser Set Method: _set_browser(self, browser) - Instance of the WebDriver browser

### homepage Instance of the WebDriver homepage Get Method: _get_homepage(self) - Instance of the WebDriver homepage Set Method: _set_homepage(self, homepage) - Instance of the WebDriver homepage Type: webdriver.Remote

### test_logger Logger object to log test information Get Method: unreachable.test_logger(self) - Logger object to log test information Type: logging