Commit ba9cb55f authored by holivier's avatar holivier

testContactMech: add expire contactMech

parent 03271138
......@@ -219,7 +219,6 @@ public class PartyMgmtFjs extends SimpleTestSuite{
postalAddress.remove("purpose2");
PartyFjsScreens.checkContactMech(this, ContactMechType.POSTAL_ADDR, postalAddress, 1);
//PartyFjsScreens.checkPurposePresent(this, purpose, 1);
DataObj contactMech = testCaseData.getDataObj("email");
PartyFjsScreens.addContactMech(this, ContactMechType.EMAIL_ADDR, contactMech, null);
PartyFjsScreens.checkContactMech(this, ContactMechType.EMAIL_ADDR, contactMech, 1);
......@@ -248,7 +247,12 @@ public class PartyMgmtFjs extends SimpleTestSuite{
PartyFjsScreens.addContactMech(this, ContactMechType.FTP_ADDR, contactMech, null);
PartyFjsScreens.checkContactMech(this, ContactMechType.FTP_ADDR, contactMech, 1);
// TODO test second add and after the showOld button and so expired button
// add a second phone number
// TODO test after expired button the showOld button
contactMech = testCaseData.getDataObj("telecomNumber2");
PartyFjsScreens.addContactMech(this, ContactMechType.TELECOM_NUMBER, contactMech, null);
PartyFjsScreens.checkContactMech(this, ContactMechType.TELECOM_NUMBER, contactMech, 2);
PartyFjsScreens.expireContactMech(this, ContactMechType.TELECOM_NUMBER, 2, null);
// TODO test Show More
// TODO test configuration with displayParam (so an other portlet) and param about state
// test ShowMore button after add contact mech (postal Address)
......
......@@ -580,7 +580,7 @@ public class PartyFjsScreens extends SimpleTestSuite{
* {@link #toggleContactMechPurpose(SimpleTestSuite, ContactMechType, String, String, int, String)}, so it's better to
* use it directly.
* @param testSuite
* @param contactMechType
* @param contactMechType you can use enum ContactMechType
* @param purpose
* @param purpose2
* @param num
......@@ -597,7 +597,7 @@ public class PartyFjsScreens extends SimpleTestSuite{
* {@link #toggleContactMechPurpose(SimpleTestSuite, ContactMechType, String, String, int, String)}, so it's better to
* use it directly.
* @param testSuite
* @param contactMechType
* @param contactMechType you can use enum ContactMechType
* @param purpose
* @param purpose2
* @param num
......@@ -610,8 +610,13 @@ public class PartyFjsScreens extends SimpleTestSuite{
toggleContactMechPurpose(testSuite, contactMechType, purpose, purpose2, num, logMessage);
}
/**
* Add (or remove) one or two purpose(s) to a ContactMech, just do a check if not check previously
* or uncheck if it's check previously.
* Add (or remove) one or two purpose(s) to a ContactMech.
* <ul>
* <li>open edit screenlet</li>
* <li>open purpose for the correct contactMech</li>
* <li>do a check if not check previously uncheck if it's check previously.</li>
* <li>validate at the screenlet level</li>
* </ul>
* @param testSuite
* @param purpose
* @param purpose2 if no null a second purpose is added
......@@ -677,6 +682,38 @@ public class PartyFjsScreens extends SimpleTestSuite{
assertTrue("purpose " + purpose + " not found in proposed list", false);
}
/**
* expire one ContactMech and its purposes and check the confirmation message & button.
* @param testSuite
* @param contactMechType you can use enum ContactMechType
* @param num if there are multiple contactMech with contactMechType which want to expire, num=1 for the first
* @param logMessage
* @throws Exception
*/
public static void expireContactMech(SimpleTestSuite testSuite, ContactMechType contactMechType,
int num, String logMessage) throws Exception {
LogSelenium.showInfoPanel(module, testSuite,
(logMessage != null) ? logMessage : "Expire the Contact Mechanisme with type "+contactMechType.userLabel()+" #" + num);
// click on edit button
testSuite.click("div#vue-portlet_PartyContactMech-00001 span#mdi-pencil");
// click on expire button
testSuite.clickAndWaitStaleness(
By.cssSelector("div#vue-portlet_PartyContactMech-00001 div[sel-label='"+contactMechType.selLabelForm() +
"'] > div[role='listitem']:nth-child("+num+") span#mdi-delete")
); //
// click on save button
testSuite.click("div#vue-portlet_PartyContactMech-00001 span#mdi-check");
// wait for confirmation message and click on ok on confirm button
WebDriverWait driverWait = testSuite.getDriverWait();
driverWait.until(ExpectedConditions.textToBe(By.cssSelector("div.v-dialog__content div.v-card__title"),
"Do you confirm the suppression?"));
testSuite.click("div.v-dialog__content div.v-card__actions button.success");
//wait screenlet being in show mode
driverWait.until(ExpectedConditions.or(
ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#vue-portlet_PartyContactMech-00001 button.v-btn[sel-label='Show less']")),
ExpectedConditions.presenceOfElementLocated(By.cssSelector("div#vue-portlet_PartyContactMech-00001 button.v-btn[sel-label='Show more']"))
));
}
/**
* test contactMechs :
* <ul>
......
......@@ -89,6 +89,10 @@
<string name="defaultTimeout" value="100"/>
<bool name="binaryTransfer" value="true"/><!-- true for selected -->
</data-obj>
<data-obj name="telecomNumber2">
<string name="number" value="02 34 56 78 90 "/>
<string name="purpose" value="Main Home Phone Number"/>
</data-obj>
</test-case>
</test-suite>
<test-suite name="PartyFjsTestSuite">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment