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]
webdriver.Remote |
_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
bool |
wait_for_alert(self, timeout=10) Waist until an alert is visible | source code
setup_method(self, request) Goes to homepage before each test, unless marker skipsetup is given | source code
WebElement |
wait_for_element_to_be_visible(self, locator_strategy, locator_string, error_msg=None, timeout=10) Wait until an element becomes visible | source code
WebElement |
wait_for_element_to_be_clickable(self, locator_strategy, locator_string, error_msg=None, timeout=10) Wait until an element cna be clicked | source code
WebElement |
wait_for_element_to_be_present(self, locator_strategy, locator_string, error_msg=None, timeout=10) Wait until an element is present | source code
WebElement |
wait_for_element_to_be_selected(self, locator_strategy, locator_string, error_msg=None, timeout=10) Wait until an element is selected | source code
WebElement |
wait_for_element_to_be_invisible(self, locator_strategy, locator_string, error_msg=None, timeout=10) Wait until an element becomes invisible | source code
wait_for_text_to_be_present_in_element(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) Wait for an element that contains specified text | source code
wait_for_text_to_be_present_in_element_value(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) Wait for an element's value to contain some test | 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]
webdriver.Remote | browser Returns Instance of the WebDriver browser
| homepage Instance of the WebDriver homepage
| test_logger Logger object to log test information
Inherited from `object`: `__class__`

Method Details | [hide private]

### _set_browser(self, browser) | source code
Instance of the WebDriver browser Parameters: `browser` (webdriver.Remote)

### _set_homepage(self, homepage) | source code
Instance of the WebDriver homepage Parameters: `homepage` (webdriver.Remote)

### 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

### wait_for_alert(self, timeout=10) | source code
Waist until an alert is visible Parameters: `timeout` (Integer) - Number of seconds before timing out Returns: bool

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

### wait_for_element_to_be_visible(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
Wait until an element becomes visible Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait for the element to be visible Returns: WebElement

### wait_for_element_to_be_clickable(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
Wait until an element cna be clicked Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait for the element to be clickable Returns: WebElement

### wait_for_element_to_be_present(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
Wait until an element is present Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait for the element to be present Returns: WebElement

### wait_for_element_to_be_selected(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
Wait until an element is selected Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait for the element to be selected Returns: WebElement

### wait_for_element_to_be_invisible(self, locator_strategy, locator_string, error_msg=None, timeout=10) | source code
Wait until an element becomes invisible Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait for the element to be hidden Returns: WebElement

### wait_for_text_to_be_present_in_element(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) | source code
Wait for an element that contains specified text Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait

### wait_for_text_to_be_present_in_element_value(self, locator_strategy, locator_string, text, error_msg=None, timeout=10) | source code
Wait for an element's value to contain some test Parameters: `locator_strategy` (By) - Location strategy to use `locator_string` (str) - String used to locate element `error_msg` (str) - Error string to show if element is not found `timeout` (int) - Maximum time in seconds to wait

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 Type: webdriver.Remote

### 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

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