Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved api and functional tests into common sub-folder
- Loading branch information
1 parent
dbd9e19
commit f9da6e1
Showing
92 changed files
with
1,436 additions
and
1 deletion.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
134 changes: 134 additions & 0 deletions
134
tests/functional-tests/src/test/groovy/pages/app/pages/app/OrganizationsPage.groovy
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,134 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package pages | ||
|
||
class OrganizationsPage extends BaseAppPage { | ||
static at = { pageTitle.text() == 'Manage Companies' } | ||
static url = 'registries/organizations/manage' | ||
static content = { | ||
pageTitle { $('main h4') } | ||
|
||
addAlert(required:false) { $('#orgAddSuccessAlert') } | ||
updateAlert(required:false) { $('#orgUpdateSuccessAlert') } | ||
deleteAlert(required:false) { $('#orgDeleteSuccessAlert') } | ||
|
||
// add company | ||
addNewCompanyButton(wait:2) { $('#orgAddNewButton') } | ||
|
||
// Update/Delete company | ||
selectCompanySearchField { $('#orgEditSelectDropdown').$('input', type:'search') } | ||
selectCompanyDropdown(required:false) { $('#orgEditSelectDropdown').$('.dropdown-menu') } | ||
|
||
// Update company | ||
companyNameField(required:false) { $('#orgEditNameInput') } | ||
streetAddressField(required:false) { $('#orgEditAddressInput') } | ||
cityField(required:false) { $('#orgEditCityInput') } | ||
provinceDropdown(required:false) { $('#orgEditProvinceInput') } | ||
postalCodeField(required:false) { $('#orgEditPostalInput') } | ||
telephoneNumberField(required:false) { $('#orgEditPhoneInput') } | ||
faxNumberField(required:false) { $('#orgEditFaxInput') } | ||
emailField(required:false) { $('#orgEditEmailInput') } | ||
websiteField(required:false) { $('#orgEditWebsiteInput') } | ||
|
||
updateButton(required:false) { $('button', type:'submit', text:'Update') } | ||
|
||
// Delete company | ||
deleteButton(required:false) { $('button', type:'button', text:'Delete this company') } | ||
} | ||
|
||
// Add company | ||
void clickAddNewCompanyButton() { | ||
addNewCompanyButton.click() | ||
} | ||
|
||
Boolean addCompanySuccessAlertDisplayed() { | ||
return waitFor { | ||
addAlert.displayed == true && | ||
addAlert.text() =~ 'Company added' | ||
} | ||
} | ||
|
||
// Update/Delete company | ||
void selectCompany(String regex) { | ||
// Expand the search dropdown | ||
selectCompanySearchField.click() | ||
interact { | ||
waitFor { | ||
// wait for the dropdown to populate and click the element in the list with the matching text | ||
moveToElement(selectCompanyDropdown.$('li', text:~"$regex")).click() | ||
} | ||
} | ||
} | ||
|
||
// Update company | ||
void setCompanyName(String name) { | ||
companyNameField.value(name) | ||
} | ||
|
||
void setStreetAddress(String address) { | ||
streetAddressField.value(address) | ||
} | ||
|
||
void setCity(String city) { | ||
cityField.value(city) | ||
} | ||
|
||
void setProvince(String province) { | ||
provinceDropdown.$('option', text:province).click() | ||
} | ||
|
||
void setPostalCode(String postalCode) { | ||
postalCodeField.value(postalCode) | ||
} | ||
|
||
void setTelephoneNumber(String telephoneNumber) { | ||
telephoneNumberField.value(telephoneNumber) | ||
} | ||
|
||
void setFaxNumber(String faxNumber) { | ||
faxNumberField.value(faxNumber) | ||
} | ||
|
||
void setEmail(String email) { | ||
emailField.value(email) | ||
} | ||
|
||
void setWebsite(String website) { | ||
websiteField.value(website) | ||
} | ||
|
||
void clickUpdateButton() { | ||
updateButton.click() | ||
} | ||
|
||
Boolean updateCompanySuccessAlertDisplayed() { | ||
return waitFor { | ||
updateAlert.displayed == true && | ||
updateAlert.text() =~ 'Successfully updated company information' | ||
} | ||
} | ||
|
||
// Delete company | ||
void clickDeleteButton() { | ||
waitFor { deleteButton.click() } | ||
} | ||
|
||
Boolean deleteCompanySuccessAlertDisplayed(String name) { | ||
return waitFor { | ||
deleteAlert.displayed == true && | ||
deleteAlert.text() =~ "$name removed" | ||
} | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
tests/functional-tests/src/test/groovy/pages/app/pages/app/RegistryAddPage.groovy
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,72 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package pages | ||
|
||
class RegistryAddPage extends BaseAppPage { | ||
static at = { pageTitle.text() == 'Add new applicant' } | ||
static url = 'registries/people/add' | ||
static content = { | ||
pageTitle { $('main h5') } | ||
|
||
surnameField { $('#surnameInput') } | ||
firstnameField { $('#firstnameInput') } | ||
telephoneNumberField { $('#contactTelInput') } | ||
emailField { $('#contactEmailInput') } | ||
wellDrillerORCSFIeld { $('#drillerORCSInput') } | ||
pumpInstallerORCSField { $('#pumpORCSInput') } | ||
|
||
registerAsRadioButtons { $('#registrationTypeInput') } | ||
|
||
saveButton { $('button', type:'submit', text:'Save') } | ||
} | ||
|
||
void setSurname(String surname) { | ||
surnameField.value(surname) | ||
} | ||
|
||
void setFirstname(String firstname) { | ||
firstnameField.value(firstname) | ||
} | ||
|
||
void setTelephoneNumber(String telephoneNumber) { | ||
telephoneNumberField.value(telephoneNumber) | ||
} | ||
|
||
void setEmail(String email) { | ||
emailField.value(email) | ||
} | ||
|
||
void setWellDrillerROCS(int orcsNumber) { | ||
wellDrillerORCSFIeld.value(orcsNumber) | ||
} | ||
|
||
void setPumpInstallerORCS(int orcsNumber) { | ||
pumpInstallerORCSField.value(orcsNumber) | ||
} | ||
|
||
// TODO | ||
void registerAsDriller() { | ||
registerAsRadioButtons.$('input', value:'DRILL').click() | ||
} | ||
|
||
// TODO | ||
void registerAsPumpInstaller() { | ||
registerAsRadioButtons.$('input', value:'PUMP').click() | ||
} | ||
|
||
void clickSaveButton() { | ||
saveButton.click() | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
tests/functional-tests/src/test/groovy/pages/app/pages/app/RegistryPage.groovy
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,67 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package pages | ||
|
||
class RegistryPage extends BaseAppPage { | ||
static at = { pageTitle.text() == 'Register of Well Drillers and Well Pump Installers' } | ||
static url = 'registries' | ||
static content = { | ||
pageTitle { $('main h4') } | ||
|
||
bodyContent { $('#main-content .card-body') } | ||
|
||
addNewEntryButton(required:false) { $('#addNewEntryButton') } | ||
manageCompaniesButton(required:false) { $('#manageCompaniesButton') } | ||
|
||
registrationStatusDropdown(required:false) { $('#manageCompaniesButton') } | ||
|
||
wellDrillerRadioButton { $('#activityDriller') } | ||
wellPumpInstallerRadioButton { $('#activityInstaller') } | ||
|
||
individualOrCompanyOrRegistrationSearchField { $('#regTypeInput') } | ||
|
||
searchButton { $('#personSearchSubmit') } | ||
|
||
searchResultsTable(required:false) { $('#registry-table') } | ||
} | ||
|
||
void clickAddNewEntryButton() { | ||
waitFor { addNewEntryButton.click() } | ||
} | ||
|
||
void clickManageCompaniesButton() { | ||
waitFor { manageCompaniesButton.click() } | ||
} | ||
|
||
void clickSearchButton() { | ||
searchButton.click() | ||
} | ||
|
||
void clickWellDrillerRadioButton() { | ||
wellDrillerRadioButton.parent().click() | ||
} | ||
|
||
void clickWellPumpInstallerRadioButton() { | ||
wellPumpInstallerRadioButton.parent().click() | ||
} | ||
|
||
void setIndividualOrCompanyOrRegistrationSearchField(String value) { | ||
individualOrCompanyOrRegistrationSearchField.value(value) | ||
} | ||
|
||
int getSearchResultsCount() { | ||
waitFor { searchResultsTable.$('tbody tr').size() } | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
tests/functional-tests/src/test/groovy/pages/app/pages/app/RegistryProfilePage.groovy
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,44 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package pages | ||
|
||
/** | ||
* Well Operator profile page. | ||
*/ | ||
class RegistryProfilePage extends BaseAppPage { | ||
static at = { | ||
browser.getCurrentUrl() =~ /\/registries\/people\/[a-z0-9\-]+$/ && | ||
pageTitle.text() == "$firstName $surname" | ||
} | ||
static content = { | ||
pageTitle { $('main h4') } | ||
} | ||
|
||
private final String surname | ||
private final String firstName | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* Uses the well operator's first and last name to-at check the page, as the title is based on the operator's name. | ||
* | ||
* @param String the well operator surname (required) | ||
* @param String the well operator firstName (required) | ||
*/ | ||
RegistryProfilePage(String surname, String firstName) { | ||
this.surname = surname | ||
this.firstName = firstName | ||
} | ||
} |
Oops, something went wrong.