Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- added email to admin user
- added functional tests data
- updated functional test
  • Loading branch information
temi committed Nov 15, 2023
1 parent 42fbe01 commit a6efb51
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AdminSpec extends StubbedCasSpec {
def "Admin Reports"() {
setup:
login([userId:'1', role:"ROLE_ADMIN", email:'[email protected]', firstName: "ALA", lastName:'Admin'], browser)
String fromDate = "10/10/2020"
String fromDate = "10/01/2020"
String toDate = "10/10/2021"

when:
Expand Down Expand Up @@ -106,7 +106,7 @@ class AdminSpec extends StubbedCasSpec {
waitFor 20, {
MimeMessage[] messages = greenMail.getReceivedMessages()
messages?.length == 2
messages[0].getSubject() == "Your download is ready"
messages[1].getSubject() == "Your download is ready"
}

when:"I clicked the Organisation Activities Report button"
Expand All @@ -116,8 +116,8 @@ class AdminSpec extends StubbedCasSpec {
then:
waitFor 20, {
MimeMessage[] messages = greenMail.getReceivedMessages()
messages?.length == 1
messages[0].getSubject() == "Your download is ready"
messages?.length == 3
messages[2].getSubject() == "Your download is ready"
}

when:"I clicked the Organisation Report Status button"
Expand All @@ -127,8 +127,8 @@ class AdminSpec extends StubbedCasSpec {
then:
waitFor 20, {
MimeMessage[] messages = greenMail.getReceivedMessages()
messages?.length == 2
messages[0].getSubject() == "Your download is ready"
messages?.length == 4
messages[3].getSubject() == "Your download is ready"
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class StubbedCasSpec extends FieldcaptureFunctionalTest {
}
/** Convenience method to stub the login of a user with the CAS ROLE_ALA_ADMIN role */
def loginAsAlaAdmin(Browser browser) {
login([userId:ALA_ADMIN_USER_ID, role:"ROLE_ADMIN", email: '[email protected]', firstName:"ALA", lastName:"Administrator"], browser)
login([userId:ALA_ADMIN_USER_ID, role:"ROLE_ADMIN", userName: '[email protected]', email: '[email protected]', firstName:"ALA", lastName:"Administrator"], browser)
}
/** Convenience method to stub the login of a user no special roles */
def loginAsUser(String userId, Browser browser) {
Expand Down
4 changes: 2 additions & 2 deletions src/integration-test/groovy/pages/AdminReportsPage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ class AdminReportsPage extends Page {
period {$('select#reportPeriodOfManagementUnit',0)}
downloadReportBtn(required:false) {$('a#muReportDownload')}
downloadReportSummaryBtn(required:false) {$('a#muReportDownloadSummary')}
orgDownloadReportBtn(required:false) {$('a#muReportDownload')}
orgDownloadReportSummaryBtn(required:false) {$('a#muReportDownloadSummary')}
orgDownloadReportBtn(required:false) {$('a#orgReportDownload')}
orgDownloadReportSummaryBtn(required:false) {$('a#orgReportDownloadSummary')}
showDownloadDetailsIcon(required:false) { $('i.showDownloadDetailsIcon')}
muReportDownloadLink(required:false) {$('a#entityReportDownloadLink')}
startDate{$("#muFromDate")}
Expand Down
22 changes: 21 additions & 1 deletion src/integration-test/resources/dataset3/loadDataSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1514,4 +1514,24 @@ db.userPermission.insert({
entityId: "monitorProject",
userId: '1',
accessLevel: 'admin'
});
});

createOrganisation({
name:'THE TRUSTEE FOR PSS FUND Test',
organisationId:'test_organisation',
status:'active', abn:'',
url:'http://www.ala.org.au',
acronym:'TSTORG', description:'THE TRUSTEE FOR PSS FUND Test'
});
delete report1.projectId
var activityId = "activity2"
report1.organisationId = 'test_organisation';
report1.activityId = activityId;
activity.activityId = activityId;
output.activityId = activityId;
outputSwan.activityId = activityId;

db.report.insert(report1)
db.activity.insert(activity1)
db.output.insert(output);
db.output.insert(outputSwan)
2 changes: 1 addition & 1 deletion src/main/scripts/runFunctionalTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fi

BRANCH=$3
if [ -z $BRANCH ]; then
BRANCH=feature/paratoo
BRANCH=feature/issue3004
fi

ECODATA_LOCAL_DIR=$2
Expand Down

0 comments on commit a6efb51

Please sign in to comment.