generated from NHSDigital/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
56bde6f
commit 2398953
Showing
6 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from libs import playwright_ops | ||
from libs.constants import object_properties, actions | ||
|
||
|
||
class pg_home: | ||
po = playwright_ops.playwright_operations() | ||
|
||
LNK_PROGRAMMES = "Programmes" | ||
|
||
def click_programmes(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.LNK_PROGRAMMES, action=actions.CLICK_LINK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from libs import playwright_ops | ||
from libs.constants import object_properties, actions | ||
|
||
|
||
class pg_programmes: | ||
po = playwright_ops.playwright_operations() | ||
|
||
LNK_HPV = "HPV" | ||
LNK_IMPORTS = "Imports" | ||
LNK_IMPORT_RECORDS = "Import records" | ||
RDO_CHILD_RECORDS = "Child records" | ||
RDO_VACCINATION_RECORDS = "Vaccination records" | ||
BTN_CONTINUE = "Continue" | ||
LBL_CHOOSE_FILE_CHILD_RECORDS = "HPVImport child records" | ||
LBL_CHOOSE_FILE_VACCINATION_RECORDS = "HPVUpload vaccination records" | ||
|
||
def click_HPV(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.LNK_HPV, action=actions.CLICK_LINK) | ||
|
||
def click_Imports(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.LNK_IMPORTS, action=actions.CLICK_LINK) | ||
|
||
def click_ImportRecords(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.LNK_IMPORT_RECORDS, action=actions.CLICK_LINK) | ||
|
||
def select_ChildRecords(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.RDO_CHILD_RECORDS, action=actions.RADIO_BUTTON_SELECT) | ||
|
||
def select_VaccinationRecords(self, browser_page): | ||
self.po.perform_action( | ||
page=browser_page, locator=self.RDO_VACCINATION_RECORDS, action=actions.RADIO_BUTTON_SELECT | ||
) | ||
|
||
def click_Continue(self, browser_page): | ||
self.po.perform_action(page=browser_page, locator=self.BTN_CONTINUE, action=actions.CLICK_BUTTON) | ||
|
||
def click_ChooseFile_ChildRecords(self, browser_page): | ||
self.po.perform_action( | ||
page=browser_page, locator=self.LBL_CHOOSE_FILE_CHILD_RECORDS, action=actions.CLICK_LABEL | ||
) | ||
|
||
def choose_file_child_records(self, browser_page, file_path: str): | ||
self.po.perform_action( | ||
page=browser_page, | ||
locator=self.LBL_CHOOSE_FILE_CHILD_RECORDS, | ||
action=actions.SELECT_FILE, | ||
value=file_path, | ||
) | ||
|
||
def click_ChooseFile_VaccinationRecords(self, browser_page): | ||
self.po.perform_action( | ||
page=browser_page, locator=self.LBL_CHOOSE_FILE_VACCINATION_RECORDS, action=actions.CLICK_LABEL | ||
) | ||
|
||
def choose_file_vaccination_records(self, browser_page, file_path: str): | ||
self.po.perform_action( | ||
page=browser_page, | ||
locator=self.LBL_CHOOSE_FILE_VACCINATION_RECORDS, | ||
action=actions.SELECT_FILE, | ||
value=file_path, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,25 @@ | ||
import pytest | ||
from pages import pg_login | ||
from pages import pg_home | ||
from pages import pg_programmes | ||
|
||
|
||
class Test_Regression: | ||
login_page = pg_login.pg_login() | ||
home_page = pg_home.pg_home() | ||
programmes_page = pg_programmes.pg_programmes() | ||
|
||
@pytest.mark.regression | ||
@pytest.mark.order(101) | ||
def test_reg_file_upload(self, browser_page): | ||
self.login_page.perform_login(browser_page=browser_page) | ||
self.home_page.click_programmes(browser_page=browser_page) | ||
self.programmes_page.click_HPV(browser_page=browser_page) | ||
self.programmes_page.click_Imports(browser_page=browser_page) | ||
self.programmes_page.click_ImportRecords(browser_page=browser_page) | ||
self.programmes_page.select_VaccinationRecords(browser_page=browser_page) | ||
self.programmes_page.click_Continue(browser_page=browser_page) | ||
self.programmes_page.choose_file_vaccination_records( | ||
browser_page=browser_page, file_path="test_data/hpv/file1.csv" | ||
) | ||
self.programmes_page.click_Continue(browser_page=browser_page) |