Program: 89086
Project: 89086
Buggy source:
/** 
 * Downgrade instructions mandatory when downgrade on (or when) set <p> <a href="https://issues.alfresco.com/jira/browse/RM-2409">RM-2409</a><pre> Given I am a cleared user And I am classifying the content for the first time And I enter a downgrade date and/or event When I attempt to save the classification information Then I will be informed that downgrade instructions are mandatory when the downgrade date and/or event are set And the save will not be successful Note that downgrade instructions can be set without a date or event specified. </pre>
 */
@Test(groups={"String_Node_Str","String_Node_Str"},description="String_Node_Str",dependsOnGroups={"String_Node_Str"}) @AlfrescoTest(jira="String_Node_Str") public void checkInstructionsFieldStates(){
  String recordName="String_Node_Str";
  openPage(filePlan,RM_SITE_ID,createPathFrom("String_Node_Str",RECORD_CATEGORY_THREE,RECORD_FOLDER_THREE));
  filePlan.getToolbar().clickOnFile().clickOnElectronic().uploadFile(recordName);
  classifyContentDialog=filePlan.getRecord(recordName).clickOnClassifyAction();
  classifyContentDialog.setLevel(SECRET_CLASSIFICATION_LEVEL_TEXT).setAgency(CLASSIFICATION_AGENCY).addReason(CLASSIFICATION_REASON);
  classifyContentDialog.setDowngradeDate(DOWNGRADE_DATE_INPUT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.clearDowngradeDate();
  classifyContentDialog.setDowngradeEvent(DOWNGRADE_EVENT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.setDowngradeDate(DOWNGRADE_DATE_INPUT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.setDowngradeInstructions(DOWNGRADE_INSTRUCTIONS);
  assertTrue("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.clearDowngradeDate().clearDowngradeEvent();
  assertTrue("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
}

Fixed version (ground truth):
/** 
 * Downgrade instructions mandatory when downgrade on (or when) set <p> <a href="https://issues.alfresco.com/jira/browse/RM-2409">RM-2409</a><pre> Given I am a cleared user And I am classifying the content for the first time And I enter a downgrade date and/or event When I attempt to save the classification information Then I will be informed that downgrade instructions are mandatory when the downgrade date and/or event are set And the save will not be successful Note that downgrade instructions can be set without a date or event specified. </pre>
 */
@Test(groups={"String_Node_Str","String_Node_Str"},description="String_Node_Str",dependsOnGroups={"String_Node_Str"}) @AlfrescoTest(jira="String_Node_Str") public void checkInstructionsFieldStates(){
  String recordName="String_Node_Str";
  openPage(filePlan,RM_SITE_ID,createPathFrom("String_Node_Str",RECORD_CATEGORY_THREE,RECORD_FOLDER_THREE));
  filePlan.getToolbar().clickOnFile().clickOnElectronic().uploadFile(recordName);
  classifyContentDialog=filePlan.getRecord(recordName).clickOnClassifyAction();
  classifyContentDialog.setLevel(SECRET_CLASSIFICATION_LEVEL_TEXT).setAgency(CLASSIFICATION_AGENCY).addReason(CLASSIFICATION_REASON);
  classifyContentDialog.setDowngradeDate(DOWNGRADE_DATE_INPUT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.clearDowngradeDate();
  classifyContentDialog.setDowngradeEvent(DOWNGRADE_EVENT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.setDowngradeDate(DOWNGRADE_DATE_INPUT);
  assertTrue("String_Node_Str",classifyContentDialog.isInstructionsFieldRequired());
  assertFalse("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.setDowngradeInstructions(DOWNGRADE_INSTRUCTIONS);
  assertTrue("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.clearDowngradeDate().clearDowngradeEvent();
  assertTrue("String_Node_Str",classifyContentDialog.isClassifyButtonEnabled());
  classifyContentDialog.clickOnCancel();
}