Skip to content

Commit 44331e2

Browse files
committed
working on functional test updates #1720
1 parent 0b9861d commit 44331e2

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

grails-app/views/project/_editMeriPlan.gsp

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
<div data-bind="if:isPlanEditable()" class="row mb-2">
183183
<div class="col-sm-12 pl-3 pr-3">
184184
<div class="alert alert-danger report-locked">
185-
<p class="text-dark">You must unlock the plan to edit it, and when finished you must save your work by pressing the ‘save’ button below otherwise your work will not be saved. Do not close or press back on your browser to exit or your work will be lost.</p>
185+
<p class="text-dark">You must unlock the plan to edit it, and when finished you must save your work by pressing the "Save changes and finish editing" or the "Submit for approval" button below otherwise your work will not be saved. Do not close or press back on your browser to exit or your work will be lost.</p>
186186
<a id="lockMeriPlan" href="${createLink(action:'lockMeriPlan', id:project.projectId)}"><button type="button" class="btn btn-sm btn-danger"><i class="fa fa-edit"></i> Lock for Editing</button></a>
187187
</div>
188188
</div>
@@ -192,7 +192,7 @@
192192
<div class="row space-after">
193193
<div class="col-sm-12 pl-3 pr-3">
194194
<div class="alert alert-danger meri-lock-held">
195-
<p class="text-dark"><i class="fa fa-lock"></i> You currently hold an editing lock for this MERI plan. No other users will be able to edit the plan until you release the lock using "Save and Unlock" or "Cancel" buttons. You cannot submit the MERI plan while it is locked.</p>
195+
<p class="text-dark"><i class="fa fa-lock"></i> You currently hold an editing lock for this MERI plan. No other users will be able to edit the plan until you release the lock using "Save changes and finish editing", "Submit for approval", or "Cancel" buttons.</p>
196196
</div>
197197
</div>
198198
<div class="col-sm-12">

src/integration-test/groovy/au/org/ala/fieldcapture/ConfigurableMeriPlanSpec.groovy

+31-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
4545
when:
4646
to RlpProjectPage, projectId
4747
def meriPlan = openMeriPlanEditTab()
48+
meriPlan.aquireEditLock()
49+
waitFor {
50+
hasBeenReloaded()
51+
}
52+
at RlpProjectPage // reset at check time.
53+
54+
meriPlan = openMeriPlanEditTab()
4855

4956
meriPlan.projectName = "MERI plan edited name"
5057
meriPlan.projectDescription = "MERI plan edited description"
@@ -102,9 +109,9 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
102109
meriPlan.keyThreats[0].threatCode = 'Key threat 2'
103110
meriPlan.keyThreats[0].threat = "Threat 1"
104111
meriPlan.keyThreats[0].intervention = "Intervention 1"
112+
meriPlan.keyThreats[0].relatedOutcomes = ['ST1']
105113
meriPlan.keyThreats[0].targetMeasures = ['score_42']
106114
meriPlan.keyThreats[0].evidence = "Evidence 1"
107-
meriPlan.keyThreats[0].relatedOutcomes = ['ST1']
108115
meriPlan.projectMethodology = "Project assumptions 1"
109116

110117
meriPlan.projectPartnerships[0].name = 'partner name'
@@ -164,7 +171,7 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
164171
meriPlan.serviceOutcomeTargets.serviceAndTargets[1].service == "Weed distribution survey"
165172
meriPlan.serviceOutcomeTargets.serviceAndTargets[1].targetMeasure == "Area (ha) surveyed for weeds"
166173

167-
meriPlan.serviceOutcomeTargets.outcomeTargets[0].outcomes == ["ST1"]
174+
meriPlan.serviceOutcomeTargets.outcomeTargets[0].outcomes == ["ST1", "MT1"]
168175
meriPlan.serviceOutcomeTargets.outcomeTargets[1].outcomes == ["MT1"]
169176
}
170177

@@ -318,7 +325,7 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
318325
meriPlanView.nationalAndRegionalPlans[0].documentUrl.text() == "http://www.test.org"
319326
meriPlanView.serviceOutcomeTargets.serviceAndTargets[0].service.text() == "Collecting, or synthesising baseline data"
320327
meriPlanView.serviceOutcomeTargets.serviceAndTargets[0].targetMeasure.text() == "Number of baseline data sets collected and/or synthesised"
321-
meriPlanView.serviceOutcomeTargets.outcomeTargets[0].outcomes.text() == "ST1"
328+
meriPlanView.serviceOutcomeTargets.outcomeTargets[0].outcomes.text() == "ST1,MT1"
322329
meriPlanView.serviceOutcomeTargets.outcomeTargets[0].target.text() == "2"
323330
meriPlanView.serviceOutcomeTargets.serviceAndTargets[1].service.text() == "Weed distribution survey"
324331
meriPlanView.serviceOutcomeTargets.serviceAndTargets[1].targetMeasure.text() == "Area (ha) surveyed for weeds"
@@ -450,6 +457,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
450457
meriPlan.availableObjectives() == ['objective 1', 'objective 2', 'objective 3']
451458

452459
when:
460+
meriPlan.aquireEditLock()
461+
waitFor {
462+
hasBeenReloaded()
463+
}
464+
at RlpProjectPage // reset at check time.
465+
466+
meriPlan = openMeriPlanEditTab()
453467
meriPlan.checkObjective("objective 2")
454468
meriPlan.monitoringIndicators[0].indicator = "indicator 1"
455469
meriPlan.monitoringIndicators[0].approach = "approach 1"
@@ -538,6 +552,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
538552
meriPlan.availableObjectives() == ['objective 1', 'objective 2', 'objective 3', 'Other']
539553

540554
when:
555+
meriPlan.aquireEditLock()
556+
waitFor {
557+
hasBeenReloaded()
558+
}
559+
at RlpProjectPage // reset at check time.
560+
561+
meriPlan = openMeriPlanEditTab()
541562
meriPlan.assets[0].description = "asset 1"
542563
meriPlan.checkObjective("objective 2")
543564
waitFor {
@@ -683,6 +704,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
683704

684705

685706
when:
707+
meriPlan.aquireEditLock()
708+
waitFor {
709+
hasBeenReloaded()
710+
}
711+
at RlpProjectPage // reset at check time.
712+
713+
meriPlan = openMeriPlanEditTab()
686714
meriPlan.assets[0].description = "asset 1"
687715
meriPlan.shortTermOutcomes[0].outcome.value("outcome 1")
688716
waitFor {

0 commit comments

Comments
 (0)