-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Selenium: Targeting smoke tests (#3822)
* Init * Added test_smoke_targeting_details_page * Added creation page smoke tests * Edited ci.yml * Black * Fixes after conflicts * Update ci.yml * Upgrade helper.py * mypy fix
- Loading branch information
1 parent
8f88ef0
commit 1c00a3e
Showing
9 changed files
with
569 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,4 +316,4 @@ jobs: | |
echo "Failed to trigger deploy for pipeline $pipeline" | ||
exit 1 | ||
fi | ||
done | ||
done |
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
87 changes: 87 additions & 0 deletions
87
backend/selenium_tests/page_object/targeting/create_new.py
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,87 @@ | ||
from page_object.base_components import BaseComponents | ||
from selenium.webdriver.remote.webelement import WebElement | ||
|
||
|
||
class CreateNew(BaseComponents): | ||
pageHeaderContainer = 'div[data-cy="page-header-container"]' | ||
pageHeaderTitle = 'h5[data-cy="page-header-title"]' | ||
buttonTargetPopulationCreate = 'button[data-cy="button-target-population-create"]' | ||
inputDivName = 'div[data-cy="input-name"]' | ||
inputIncludedHouseholdIds = 'div[data-cy="input-included-household-ids"]' | ||
inputHouseholdids = 'input[data-cy="input-householdIds"]' | ||
inputIncludedIndividualIds = 'div[data-cy="input-included-individual-ids"]' | ||
inputIndividualids = 'input[data-cy="input-individualIds"]' | ||
inputFlagexcludeifactiveadjudicationticket = 'span[data-cy="input-flagExcludeIfActiveAdjudicationTicket"]' | ||
inputName = 'input[data-cy="input-name"]' | ||
|
||
pageHeaderContainer = 'div[data-cy="page-header-container"]' | ||
pageHeaderTitle = 'h5[data-cy="page-header-title"]' | ||
buttonTargetPopulationCreate = 'button[data-cy="button-target-population-create"]' | ||
divTargetPopulationAddCriteria = 'div[data-cy="button-target-population-add-criteria"]' | ||
inputFlagexcludeifactiveadjudicationticket = 'span[data-cy="input-flagExcludeIfActiveAdjudicationTicket"]' | ||
titleExcludedEntries = 'h6[data-cy="title-excluded-entries"]' | ||
buttonShowHideExclusions = 'button[data-cy="button-show-hide-exclusions"]' | ||
inputExcludedIds = 'div[data-cy="input-excluded-ids"]' | ||
inputExcludedids = 'input[data-cy="input-excludedIds"]' | ||
inputExclusionReason = 'div[data-cy="input-exclusion-reason"]' | ||
titleAddFilter = 'h6[data-cy="title-add-filter"]' | ||
autocompleteTargetCriteria = 'div[data-cy="autocomplete-target-criteria"]' | ||
fieldChooserFilters = 'div[data-cy="field-chooser-filters[0]"]' | ||
autocompleteTargetCriteriaOption = 'input[data-cy="autocomplete-target-criteria-option-0"]' | ||
buttonHouseholdRule = 'button[data-cy="button-household-rule"]' | ||
buttonIndividualRule = 'button[data-cy="button-individual-rule"]' | ||
buttonTargetPopulationAddCriteria = 'button[data-cy="button-target-population-add-criteria"]' | ||
|
||
def getPageHeaderTitle(self) -> WebElement: | ||
return self.wait_for(self.pageHeaderTitle) | ||
|
||
def getButtonTargetPopulationCreate(self) -> WebElement: | ||
return self.wait_for(self.buttonTargetPopulationCreate) | ||
|
||
def getInputName(self) -> WebElement: | ||
return self.wait_for(self.inputName) | ||
|
||
def getInputIncludedHouseholdIds(self) -> WebElement: | ||
return self.wait_for(self.inputIncludedHouseholdIds) | ||
|
||
def getInputHouseholdids(self) -> WebElement: | ||
return self.wait_for(self.inputHouseholdids) | ||
|
||
def getInputIncludedIndividualIds(self) -> WebElement: | ||
return self.wait_for(self.inputIncludedIndividualIds) | ||
|
||
def getInputIndividualids(self) -> WebElement: | ||
return self.wait_for(self.inputIndividualids) | ||
|
||
def getInputFlagexcludeifactiveadjudicationticket(self) -> WebElement: | ||
return self.wait_for(self.inputFlagexcludeifactiveadjudicationticket) | ||
|
||
def getButtonTargetPopulationAddCriteria(self) -> WebElement: | ||
return self.wait_for(self.buttonTargetPopulationAddCriteria) | ||
|
||
def getDivTargetPopulationAddCriteria(self) -> WebElement: | ||
return self.wait_for(self.divTargetPopulationAddCriteria) | ||
|
||
def getTitleExcludedEntries(self) -> WebElement: | ||
return self.wait_for(self.titleExcludedEntries) | ||
|
||
def getButtonShowHideExclusions(self) -> WebElement: | ||
return self.wait_for(self.buttonShowHideExclusions) | ||
|
||
def getInputExcludedIds(self) -> WebElement: | ||
return self.wait_for(self.inputExcludedIds) | ||
|
||
def getInputExcludedids(self) -> WebElement: | ||
return self.wait_for(self.inputExcludedids) | ||
|
||
def getInputExclusionReason(self) -> WebElement: | ||
return self.wait_for(self.inputExclusionReason) | ||
|
||
def getButtonHouseholdRule(self) -> WebElement: | ||
return self.wait_for(self.buttonHouseholdRule) | ||
|
||
def getButtonIndividualRule(self) -> WebElement: | ||
return self.wait_for(self.buttonIndividualRule) | ||
|
||
def getAutocompleteTargetCriteriaOption(self) -> WebElement: | ||
return self.wait_for(self.autocompleteTargetCriteriaOption) |
130 changes: 130 additions & 0 deletions
130
backend/selenium_tests/page_object/targeting/t_details_page.py
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,130 @@ | ||
from page_object.base_components import BaseComponents | ||
from selenium.webdriver.remote.webelement import WebElement | ||
|
||
|
||
class DetailsTargeting(BaseComponents): | ||
pageHeaderContainer = 'div[data-cy="page-header-container"]' | ||
pageHeaderTitle = 'h5[data-cy="page-header-title"]' | ||
buttonTargetPopulationDuplicate = 'button[data-cy="button-target-population-duplicate"]' | ||
buttonDelete = 'button[data-cy="button-delete"]' | ||
buttonEdit = 'a[data-cy="button-edit"]' | ||
buttonRebuild = 'button[data-cy="button-rebuild"]' | ||
buttonTargetPopulationLock = 'button[data-cy="button-target-population-lock"]' | ||
detailsTitle = 'div[data-cy="details-title"]' | ||
detailsGrid = 'div[data-cy="details-grid"]' | ||
labelStatus = 'div[data-cy="label-Status"]' | ||
targetPopulationStatus = 'div[data-cy="target-population-status"]' | ||
labelizedFieldContainerCreatedBy = 'div[data-cy="labelized-field-container-created-by"]' | ||
labelCreatedBy = 'div[data-cy="label-created by"]' | ||
labelizedFieldContainerCloseDate = 'div[data-cy="labelized-field-container-close-date"]' | ||
labelProgrammePopulationCloseDate = 'div[data-cy="label-Programme population close date"]' | ||
labelizedFieldContainerProgramName = 'div[data-cy="labelized-field-container-program-name"]' | ||
labelProgramme = 'div[data-cy="label-Programme"]' | ||
labelizedFieldContainerSendBy = 'div[data-cy="labelized-field-container-send-by"]' | ||
labelSendBy = 'div[data-cy="label-Send by"]' | ||
labelizedFieldContainerSendDate = 'div[data-cy="labelized-field-container-send-date"]' | ||
labelSendDate = 'div[data-cy="label-Send date"]' | ||
criteriaContainer = 'div[data-cy="criteria-container"]' | ||
checkboxExcludeIfActiveAdjudicationTicket = 'span[data-cy="checkbox-exclude-if-active-adjudication-ticket"]' | ||
labelFemaleChildren = 'div[data-cy="label-Female Children"]' | ||
labelFemaleAdults = 'div[data-cy="label-Female Adults"]' | ||
labelMaleChildren = 'div[data-cy="label-Male Children"]' | ||
labelMaleAdults = 'div[data-cy="label-Male Adults"]' | ||
labelTotalNumberOfHouseholds = 'div[data-cy="label-Total Number of Households"]' | ||
labelTargetedIndividuals = 'div[data-cy="label-Targeted Individuals"]' | ||
tableTitle = 'h6[data-cy="table-title"]' | ||
tableLabel = 'span[data-cy="table-label"]' | ||
tablePagination = 'div[data-cy="table-pagination"]' | ||
|
||
def getPageHeaderTitle(self) -> WebElement: | ||
return self.wait_for(self.pageHeaderTitle) | ||
|
||
def getButtonTargetPopulationDuplicate(self) -> WebElement: | ||
return self.wait_for(self.buttonTargetPopulationDuplicate) | ||
|
||
def getButtonDelete(self) -> WebElement: | ||
return self.wait_for(self.buttonDelete) | ||
|
||
def getButtonEdit(self) -> WebElement: | ||
return self.wait_for(self.buttonEdit) | ||
|
||
def getButtonRebuild(self) -> WebElement: | ||
return self.wait_for(self.buttonRebuild) | ||
|
||
def getButtonTargetPopulationLock(self) -> WebElement: | ||
return self.wait_for(self.buttonTargetPopulationLock) | ||
|
||
def getDetailsTitle(self) -> WebElement: | ||
return self.wait_for(self.detailsTitle) | ||
|
||
def getDetailsGrid(self) -> WebElement: | ||
return self.wait_for(self.detailsGrid) | ||
|
||
def getLabelStatus(self) -> WebElement: | ||
return self.wait_for(self.labelStatus) | ||
|
||
def getTargetPopulationStatus(self) -> WebElement: | ||
return self.wait_for(self.targetPopulationStatus) | ||
|
||
def getLabelizedFieldContainerCreatedBy(self) -> WebElement: | ||
return self.wait_for(self.labelizedFieldContainerCreatedBy) | ||
|
||
def getLabelCreatedBy(self) -> WebElement: | ||
return self.wait_for(self.labelCreatedBy) | ||
|
||
def getLabelizedFieldContainerCloseDate(self) -> WebElement: | ||
return self.wait_for(self.labelizedFieldContainerCloseDate) | ||
|
||
def getLabelProgrammePopulationCloseDate(self) -> WebElement: | ||
return self.wait_for(self.labelProgrammePopulationCloseDate) | ||
|
||
def getLabelizedFieldContainerProgramName(self) -> WebElement: | ||
return self.wait_for(self.labelizedFieldContainerProgramName) | ||
|
||
def getLabelProgramme(self) -> WebElement: | ||
return self.wait_for(self.labelProgramme) | ||
|
||
def getLabelizedFieldContainerSendBy(self) -> WebElement: | ||
return self.wait_for(self.labelizedFieldContainerSendBy) | ||
|
||
def getLabelSendBy(self) -> WebElement: | ||
return self.wait_for(self.labelSendBy) | ||
|
||
def getLabelizedFieldContainerSendDate(self) -> WebElement: | ||
return self.wait_for(self.labelizedFieldContainerSendDate) | ||
|
||
def getLabelSendDate(self) -> WebElement: | ||
return self.wait_for(self.labelSendDate) | ||
|
||
def getCriteriaContainer(self) -> WebElement: | ||
return self.wait_for(self.criteriaContainer) | ||
|
||
def getCheckboxExcludeIfActiveAdjudicationTicket(self) -> WebElement: | ||
return self.wait_for(self.checkboxExcludeIfActiveAdjudicationTicket) | ||
|
||
def getLabelFemaleChildren(self) -> WebElement: | ||
return self.wait_for(self.labelFemaleChildren) | ||
|
||
def getLabelFemaleAdults(self) -> WebElement: | ||
return self.wait_for(self.labelFemaleAdults) | ||
|
||
def getLabelMaleChildren(self) -> WebElement: | ||
return self.wait_for(self.labelMaleChildren) | ||
|
||
def getLabelMaleAdults(self) -> WebElement: | ||
return self.wait_for(self.labelMaleAdults) | ||
|
||
def getLabelTotalNumberOfHouseholds(self) -> WebElement: | ||
return self.wait_for(self.labelTotalNumberOfHouseholds) | ||
|
||
def getLabelTargetedIndividuals(self) -> WebElement: | ||
return self.wait_for(self.labelTargetedIndividuals) | ||
|
||
def getTableTitle(self) -> WebElement: | ||
return self.wait_for(self.tableTitle) | ||
|
||
def getTableLabel(self) -> WebElement: | ||
return self.get_elements(self.tableLabel) | ||
|
||
def getTablePagination(self) -> WebElement: | ||
return self.wait_for(self.tablePagination) |
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
Oops, something went wrong.