Skip to content

Commit

Permalink
working on functional test updates #1720
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Dec 11, 2023
1 parent 0b9861d commit 44331e2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
4 changes: 2 additions & 2 deletions grails-app/views/project/_editMeriPlan.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<div data-bind="if:isPlanEditable()" class="row mb-2">
<div class="col-sm-12 pl-3 pr-3">
<div class="alert alert-danger report-locked">
<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>
<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>
<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>
</div>
</div>
Expand All @@ -192,7 +192,7 @@
<div class="row space-after">
<div class="col-sm-12 pl-3 pr-3">
<div class="alert alert-danger meri-lock-held">
<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>
<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>
</div>
</div>
<div class="col-sm-12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
when:
to RlpProjectPage, projectId
def meriPlan = openMeriPlanEditTab()
meriPlan.aquireEditLock()
waitFor {
hasBeenReloaded()
}
at RlpProjectPage // reset at check time.

meriPlan = openMeriPlanEditTab()

meriPlan.projectName = "MERI plan edited name"
meriPlan.projectDescription = "MERI plan edited description"
Expand Down Expand Up @@ -102,9 +109,9 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
meriPlan.keyThreats[0].threatCode = 'Key threat 2'
meriPlan.keyThreats[0].threat = "Threat 1"
meriPlan.keyThreats[0].intervention = "Intervention 1"
meriPlan.keyThreats[0].relatedOutcomes = ['ST1']
meriPlan.keyThreats[0].targetMeasures = ['score_42']
meriPlan.keyThreats[0].evidence = "Evidence 1"
meriPlan.keyThreats[0].relatedOutcomes = ['ST1']
meriPlan.projectMethodology = "Project assumptions 1"

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

meriPlan.serviceOutcomeTargets.outcomeTargets[0].outcomes == ["ST1"]
meriPlan.serviceOutcomeTargets.outcomeTargets[0].outcomes == ["ST1", "MT1"]
meriPlan.serviceOutcomeTargets.outcomeTargets[1].outcomes == ["MT1"]
}

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

when:
meriPlan.aquireEditLock()
waitFor {
hasBeenReloaded()
}
at RlpProjectPage // reset at check time.

meriPlan = openMeriPlanEditTab()
meriPlan.checkObjective("objective 2")
meriPlan.monitoringIndicators[0].indicator = "indicator 1"
meriPlan.monitoringIndicators[0].approach = "approach 1"
Expand Down Expand Up @@ -538,6 +552,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {
meriPlan.availableObjectives() == ['objective 1', 'objective 2', 'objective 3', 'Other']

when:
meriPlan.aquireEditLock()
waitFor {
hasBeenReloaded()
}
at RlpProjectPage // reset at check time.

meriPlan = openMeriPlanEditTab()
meriPlan.assets[0].description = "asset 1"
meriPlan.checkObjective("objective 2")
waitFor {
Expand Down Expand Up @@ -683,6 +704,13 @@ class ConfigurableMeriPlanSpec extends StubbedCasSpec {


when:
meriPlan.aquireEditLock()
waitFor {
hasBeenReloaded()
}
at RlpProjectPage // reset at check time.

meriPlan = openMeriPlanEditTab()
meriPlan.assets[0].description = "asset 1"
meriPlan.shortTermOutcomes[0].outcome.value("outcome 1")
waitFor {
Expand Down

0 comments on commit 44331e2

Please sign in to comment.