UI
UI test
This module defines the class BasePage to connect & set options web-driver.
BasePage
Initialize web-driver with defined options.
Attributes:
Name | Type | Description |
---|---|---|
PATH |
str
|
Set path to the driver from config_dict. |
Source code in modules/ui/page_objects/base_page.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
__init__(headless=False, no_sandbox=False)
Init options & web-driver Chrome.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
headless |
bool
|
if |
False
|
no_sandbox |
bool
|
if |
False
|
Source code in modules/ui/page_objects/base_page.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
|
close()
Provide a close method for the driver.
Source code in modules/ui/page_objects/base_page.py
40 41 42 |
|
This module defines the class SignInPage to test UI pages.
SignInPage
Bases: BasePage
Define const & methods for testing Login GitHub page
Source code in modules/ui/page_objects/sign_in_page.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
__init__(headless=None, no_sandbox=None)
Initialize parent class & define options for Chrome.driver (--headless, --no-sandbox)
Source code in modules/ui/page_objects/sign_in_page.py
11 12 13 14 15 |
|
check_title(expected_title)
Get the content of the title tag & compare it with what is expected.
Source code in modules/ui/page_objects/sign_in_page.py
46 47 48 49 50 |
|
go_to()
Open sign-in page
Source code in modules/ui/page_objects/sign_in_page.py
17 18 19 |
|
try_login(username, password)
Try to login
Parameters:
Name | Type | Description | Default |
---|---|---|---|
username |
str
|
login username |
required |
password |
str
|
user's password |
required |
Source code in modules/ui/page_objects/sign_in_page.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|