TXT
TXT
web\:ADFTable[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MA*:AP1\:a*\:popApplicationsTabl
e\:_ATp\:popAttachmentTable']
(old)CreateBid_HeaderLevelAttachment_ADFTable={{CreateBid}}/
web\:ADFTable[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MA*\:AP1\:a2\:popApplicationsTab
le\:_ATp\:popAttachmentTable']
(old)SendMessage_Attachment_Add_CommandImageLink={{OnlineMessages}}/
web\:ADFCommandImageLink[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MAt*\:r1\:AP1\:r1\:a1
\:clLAdds' or
@text='*pt1\:_FOr1\:0\:_FO*\:0\:MAt*\:1\:r1\:0\:AP1\:r1\:1\:a1\:clLAdds']
SendMessage_Attachment_Add_CommandImageLink={{OnlineMessages}}/
web\:ADFCommandImageLink[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MAt*AP1\:r1\:a*\:clLA
dds' or @text='*pt1\:_FOr1\:0\:_FO*\:0\:MAt*AP1\:r1\:1\:a*\:clLAdds']
SendMessage_Attachment_AddIcon =
{{OnlineMessages}}/web:ADFCommandImageLink[@absoluteLocator='*pt1:_FOr1:_FO*:MA*:AP
1:r1:a*:clLAdds' or @text='*pt1:_FOr1:0:_FO*:0:MA*:3:AP1:r1:*:a*:clLAdds']
SendMessage_AttachmentsOkButton =
{{OnlineMessages}}/web:ADFCommandButton[@absoluteLocator='*pt1:_FOr1:_FO*:MA*:AP1:a
*:dc_cb1' or @text='OK']
SendMessage_MoreAttachmentsLink =
{{OnlineMessages}}/web:ADFCommandLink[@absoluteLocator='*pt1:_FOr1:_FO*:MA*:AP1:a2:
attachmentMoreLink' or @text='(* more...)']
SendMessage_MoreAttachmentsLink_Table =
{{OnlineMessages}}/web:ADFTable[@absoluteLocator='*pt1:_FOr1:_FO*:MA*:r1:AP1:a1:pop
ApplicationsTable:_ATp:popAttachmentTable']
///
SendMessage_Attachment_Add_CommandImageLink={{OnlineMessages}}/
web\:ADFCommandImageLink[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MAt*\:r1\:AP1\:r1\:a*
\:clLAdds' or
@text='*pt1\:_FOr1\:0\:_FO*\:0\:MAt*\:*\:r1\:0\:AP1\:r1\:1\:a*\:clLAdds']
web\:ADFCommandImageLink[@absoluteLocator='*pt1\:_FOr1\:_FO*\:MAt*AP1\:r1\:a*\:clLA
dds' or @text='*pt1\:_FOr1\:0\:_FO*\:0\:MAt*AP1\:r1\:1\:a*\:clLAdds']
/*
* Script Name : PON_BIPONMSGS_Exchange
* Script Description : Verify the feature BIP online messages notification in
app and email for suppliers and collaboration members
* Create and publish an RFQ with BPA as outcome. RFQ should have collaboration
team members added and suppliers invited. (Add 2 members and 2 suppliers)
* Buyer sends a message to All participants, to All members
* Verify that BIP notification is sent to All participants and All members (Email
and in-app notification) – 2 members and 2 suppliers should receive the
notifications
* Internal member 1 replies to the message sent by the buyer
* Verify that buyer receives the BIP notification from the internal member (Email
and in-app notification)
* Script Version : 1.0
* Product : Sourcing
* Primary Author : Naresh.Katakam
* Secondary Author :
* Date Created : 28-12-2022
* Initial Conditions : BIP Optin is enabled or revision >=23D
* End Conditions :
* Jar files(if applicable):
* Assumptions : updateSourcingOptin script is passed.
* Review History :
* Review Version/Review date/Reviewer/Review status/Comments:
* Change History :
* Version/Date/Updated By/Detail Changes:
*/
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import oracle.apps.prc.common.*;
@FunctionLibrary("PonRRFCommonFunctions") lib.prc.pon.PonRRFCommonFunctions
ponRRFCommonFunctions;
@FunctionLibrary("AtkLoginFuncLib") lib.AtkLoginFuncLib atkLoginFuncLib;
@FunctionLibrary("PON_FunLib") lib.prc.pon.PON_FunLib pON_FunLib;
@FunctionLibrary("POCommonFunctions") lib.myCompany.myTeam.POCommonFunctions
pOCommonFunctions;
@FunctionLibrary("SaveDialogFuncLib") lib.common.oats.SaveDialogFuncLib
saveDialogFuncLib;
@FunctionLibrary("PrcLibFunctions") lib.myCompany.myTeam.PrcLibFunctions
prcLibFunctions;
@FunctionLibrary("PrcEmailLibFunctions")
lib.myCompany.myTeam.PrcEmailLibFunctions prcEmailLibFunctions;
@FunctionLibrary("Prc_Oats_RestServices") lib.Prc_Oats_RestServices
prc_Oats_RestServices;
@FunctionLibrary("PrcHCMUsersAction") lib.myCompany.myTeam.PrcHCMUsersAction
prcHCMUsersAction;
public void initialize() throws Exception {
strRepositoryName= getScriptPackage().getRepositoryName();
prodLibPath = xmlMap.get("FSM_PRODUCT_FUNCTION_LIBRARY");
/****************** existing browsers and launch a new one************/
browser.closeAllBrowsers();
browser.launch();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
}
if (!index.exists())
{
index.mkdirs();
info("Negotiation Auto Generated Files Directory Path
"+index.getAbsolutePath());
}
directoryPath1 = parentDirectoryPath+"\\"+runInstance+"A\\";
File index1 = new File(directoryPath1);
if (!index.exists())
{
index.mkdirs();
info("Negotiation Auto Generated Files Directory Path
"+index.getAbsolutePath());
}
ItSecurityManager=datatable.getValue("dataSheet", 3 , "A").toString();
ItSecurityManagerPassword=datatable.getValue("dataSheet", 3 ,
"B").toString();
String atkUrl = xmlMap.get("atk_login_url");
HashMap<String, String> postResponse = new HashMap<String, String>();
//Buyer details
buyerUser1 = datatable.getValue("dataSheet", 2 , "A").toString();
buyerPwd1 = datatable.getValue("dataSheet", 2 , "B").toString();
//Rest credentials
String sPRCIntegrationUser=datatable.getValue("dataSheet", 4 ,
"A").toString();
String strPwd=datatable.getValue("dataSheet", 4 , "B").toString();
//Supplier details
supplierUser1=datatable.getValue("dataSheet", 5 , "A").toString();
supplierPwd=datatable.getValue("dataSheet", 5 , "B").toString();
supplierUser2=datatable.getValue("dataSheet", 6 , "A").toString();
//Procurement BU
procBU = datatable.getValue("dataSheet", 11 , "A").toString();
dataPath=absPath + "data\\";
String closeDate;
JsonObject outPost, outGet;
String fileContentExpected="";
info("Reading data from txt file");
byte[] fileByteData =Files.readAllBytes(Paths.get(absPath+"data\\
NegHeader.csv"));
fileContentExpected = new
String(fileByteData,StandardCharsets.US_ASCII);
String[][]
strMsgData=pON_FunLib.fnGetDataFromExcel("PRC_PON_CreateNegotiation:Negotiation:Onl
ineMessages", "dataSheet", "RFQ1", excelSheetPath);
String attachmentProc="PRC_PON_CreateNegotiation:Attachments";
String[] arrTempValues=strProcedureName.split(":");
String strPrefix = arrTempValues[arrTempValues.length - 1];
int intstrPostfix = i;
Supplier = supplierContacts.containsKey(Supplier) ?
supplierContacts.get(Supplier) : supplierContacts.get(null);
ContactName = supplierContacts.containsKey(ContactName) ?
supplierContacts.get(ContactName) : supplierContacts.get(null);
UserEmail = supplierContacts.containsKey(UserEmail) ?
supplierContacts.get(UserEmail) : supplierContacts.get(null);
}endStep();
postResponse=prc_Oats_RestServices.prc_RestOperations(postInputData);
postResponseContent=postResponse.get("responseContent");
postResponseCode=postResponse.get("responseCode");
info("The response code is "+postResponseCode);
if(postResponseCode.equals("201"))
{
info("Rest POST Invocation is successful");
}
else
fail("Rest POST Invocation is failed, Expected is 201.
Actual Response code: "+postResponseCode);
outPost=prc_Oats_RestServices.fnGetJsonObject(postResponseContent, new
HashMap<String, String>());
negNumber =
outPost.get("Negotiation").toString().replaceAll("\"", "");
negTitle =
outPost.get("NegotiationTitle").toString().replaceAll("\"", "");
AuctionHeaderID =
outPost.get("AuctionHeaderId").toString().replaceAll("\"", "");
info("Negotiation Number is "+negNumber+", Negotiation Title is
"+negTitle+", Auction Header ID is "+AuctionHeaderID);
}endStep();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
atkLoginFuncLib.atkLogin(buyerUser1 , buyerPwd1 , "Negotiations",
envFilePath);
info("Logged in as buyer: " +buyerUser1);
}
endStep();
}
endStep();
beginStep("Step 5: Navigate to Overview train stop, Publish Negotiation
- "+negNumber+" and Verify Status");
{
//Click on the Negotiation Number hyperlink in Search Results
adf.table("{{obj.ManageNegotiations.SearchResults_Table}}").rowSelectByIndex(0); //
NOPMD Common function call
prcObj.prcWaitForPage(0,"*Negotiation*",v_sync);
adf.commandToolbarButton("{{obj.ManageNegotiations.Edit_CommandToolbarButton}}").cl
ickButton();
prcObj.prcWaitForPage(0,v_sync);
adf.train("{{obj.EditNegTempOverview.VistedOrUnvisited_Train}}").clickNode("Unvisit
ed Step: Overview"); //NOPMD
prcObj.prcWaitForPage(v_sync);
ponRRFCommonFunctions.fnBuyerPortalNavigateToNegotiatonSummary(negNumber,
procBU);
prcObj.prcWaitForPage(0,v_sync);
adf.commandButton("{{obj.Messages.NegotiationSummary_Messages_CommandButton}}").cli
ck(); //NOPMD function call
prcObj.prcWaitForPage(0,v_sync);
}
endStep();
for(int i=1;i<=2;i++)
{
beginStep("Step "+(7+(i-1))+": Send a Online message to "+user[i-1]);
{
adf.commandToolbarButton("{{obj.Messages.Messages_Create_CommandToolbarButton}}").c
lickButton();
prcObj.prcWaitForPage(0,v_sync);
adf.selectOneChoice("{{obj.Messages.SendMessage_MessageType_SelectOneChoice}}").sel
ect(strMsgData[i][0]);
prcObj.prcWaitForPage(0,title, v_sync);
adf.selectManyChoice("{{obj.Messages.SendMessage_To_SelectManyChoice}}").select(str
MsgData[i][1]);
prcObj.prcWaitForPage(0,title, v_sync);
//Enter subject
adf.inputText("{{obj.Messages.SendMessage_Subject_InputText}}").setValue(strMsgData
[i][3]);
prcObj.prcWaitForPage(0,title, v_sync);
adf.richTextEditor("{{obj.Messages.SendMessage_Message_RichTextEditor}}").setValue(
strMsgData[i][4]);
prcObj.prcWaitForPage(0,title, v_sync);
adf.commandImageLink(54,"{{obj.Messages.SendMessage_Attachment_Add_CommandImageLink
}}").click();
think(v_wait);
prcObj.prcWaitForPage(v_sync);
//Attach all required attachments
pON_FunLib.fnAddAttachments("H1", excelSheetPath,
attachmentProc);
adf.commandButton("{{obj.Messages.SendMessage_Send_CommandButton}}").click();
prcObj.prcWaitForPage(0,title,v_sync);
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
atkLoginFuncLib.atkLogin(supplierUser2, supplierPwd, "Worklist*",
envFilePath);
}
endStep();
web.link("/web:window[@index='1']/web:document[@index='0']/web:a[@text='*.csv']").c
lick();
prcObj.prcWaitForPage(v_sync);
if(csvContent.contains(fileContentExpected)){
info("Expected text is displayed correctly in text file");
}
else{
reportFailure("Expected text is NOT displayed correctly in
text file");
}
web.window("/web:window[@index='1']").close();
prcObj.oracleSsoSignout();
}
endStep();
}
endStep();
beginStep("Step 12: Verify Received Online Message from the buyer - In
App");
{
atkLoginFuncLib.atkLogin(supplierUser2, supplierPwd, "Supplier
Portal", envFilePath);
//Navigate to View Active Negotiations
ponRRFCommonFunctions.fnViewActiveNegotiations(negNumber);
column=ponRRFCommonFunctions.fnGetColumnNumber("{{obj.ViewActiveNegotiations.Table}
}", "Negotiation");
((DOMElement)
(adf.table("{{obj.ViewActiveNegotiations.Table}}").getCellElement(0,
column).getElementsByTagName("a").get(0))).click();
adf.commandButton("{{obj.ViewActiveNegotiations.Messages_CommandButton}}").click();
prcObj.prcWaitForPage(0,v_sync);
adf.treeTable("{{obj.ViewActiveNegotiations.Messages_TreeTable}}").scrollToRow(2);
prcObj.prcWaitForPage(0,v_sync);
String strSubject =
ponRRFCommonFunctions.fnGetCellValue("{{obj.ViewActiveNegotiations.Messages_TreeTab
le}}", 1, "Subject", -1);
String strTo =
ponRRFCommonFunctions.fnGetCellValue("{{obj.ViewActiveNegotiations.Messages_TreeTab
le}}", 1, "To", -1);
}
endStep();
beginStep("Step 13: Verify Online Message Attachments sent by the buyer
- In App ");
{
//*Verify Attachments
adf.commandLink("/web:window[@index='0' or @title='*View Active
Negotiations*']/web:document[@index='0' or
@name='uq7hp85vh']/web:ADFCommandLink[@absoluteLocator='*pt1:_FOr1:_FONSr2:MA*:AP1:
a2:attachmentMoreLink' or @text='(* more...)']").click();
prcObj.prcWaitForPage(0,v_sync);
pON_FunLib.verifyAddedAttachments("H1","PRC_PON_Negotiation:VerifyAttachments",tb,e
xcelSheetPath);
}
endStep();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
prcEmailLibFunctions.loginEmailMSExchange(Supplier1Contact1ATKLoginEmail,
emailPassword);
}
endStep();
prcEmailLibFunctions.openEmailByIndexMSExchange(1);
String EmailContent =
prcEmailLibFunctions.getEmailContentByIndexMSExchange(0);
//Remove unneccessary data from the extracted email content
String[] splitEmailContent = EmailContent.split(">");
String actualEmailContent =
splitEmailContent[1].toString().trim();
info("actualEmailContent is : "+ actualEmailContent);
String expectedEmailContent="(.*)Online Message(.*)Subject
Negotiation is Open for BiddingRFQ(.*)PON_BIPONMSGS_AttachmentClose Date (.*)Reply
to MessagePlease start placing your bid(.*)Submitted(.*)PON00005(.*)Reply to
Message";
int dot=Pattern.DOTALL;
Pattern p=Pattern.compile(expectedEmailContent, dot);
Matcher mt=p.matcher(actualEmailContent);
boolean emailContentVerification= mt.matches();
if(emailContentVerification)
{
info("Message subject and content in the email is verified.
[BR # 73226] ");
}
else
{
reportFailure("Message subject and content in the email are
not as expected. Actual:" + actualEmailContent +" Expected : " +
expectedEmailContent);
}
web.window("/web:window[@index='1']").capturePage(); // NOPMD
Capturing screenshot
}
endStep();
//
String fileContentFromEmail="";
info("Reading data from csv file");
byte[] fileByteData1
=Files.readAllBytes(Paths.get(downloadPath));
fileContentFromEmail = new
String(fileByteData1,StandardCharsets.US_ASCII);
prcEmailLibFunctions.emailActionMSExchange("Reply to Message",
"");
}
endStep();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
//String
collabarationMember1="PON00006",collabarationMember2="PON00007";
//Login to ATK
atkLoginFuncLib.atkLogin(CollaborationMember1, buyerPwd1,
"Negotiations", envFilePath);
}
endStep();
ponRRFCommonFunctions.fnBuyerPortalNavigateToNegotiatonSummary(negNumber,
"Vision Operations");
adf.commandButton("{{obj.Messages.NegotiationSummary_Messages_CommandButton}}").cli
ck();
prcObj.prcWaitForPage(0,v_sync);
}
endStep();
messageTable=adf.treeTable("{{obj.Messages.Messages_TreeTable}}");
messageTable.expandCollapse("Expand", "2");
prcObj.prcWaitForPage(0,title,v_sync); //NOPMD table Object
String expectedSubjectTextForCollaborationMember =
strMsgData[1][3];
info("Expected subject text for Collaboration Member
"+expectedSubjectTextForCollaborationMember);
isSubjectPresent=actualSubjectTextForCollaborationMember.contains(expectedSubjectTe
xtForCollaborationMember);
actualSubjectTextForCollaborationMember=pON_FunLib.fnGetCellValue(messageTable, 3,
"Status");
info("Actual status Text for Collaboration Member :
"+actualSubjectTextForCollaborationMember);
isStatusPresent=
actualSubjectTextForCollaborationMember.contains(expectedStatusTextForCollaboration
Member);
actualSubjectTextForCollaborationMember=pON_FunLib.fnGetCellValue(messageTable, 3,
"From");
info("Actual From Text for Collaboration Member :
"+actualSubjectTextForCollaborationMember);
isFromPresent=
actualSubjectTextForCollaborationMember.contains(expectedFromTextForCollaborationMe
mber);
pON_FunLib.verifyAddedAttachments("H1","PRC_PON_Negotiation:VerifyAttachments",tb,e
xcelSheetPath);
}
endStep();
browser.launch();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
prcEmailLibFunctions.loginEmailMSExchange(CollaborationMember2Contact1ATKLoginEmail
, emailPassword);
}
endStep();
if(prcEmailLibFunctions.searchMailMSExchange(Subject)!=0)
{
info("Mail found. Email has been sent for online
message .[BR # 73228]");
}
else
{
reportFailure("Mail not found.User Should receive
email with the subject 'Online Message for Negotiation RFQ #RFQ1(Team,Please check
if i missed inviting any other suppliers.Regards,PRC PON00005) Was Received'. [BR #
73228]");
}
prcEmailLibFunctions.openEmailByIndexMSExchange(1);
String EmailContent =
prcEmailLibFunctions.getEmailContentByIndexMSExchange(0);
//Remove unneccessary data from the extracted email content
String[] splitEmailContent = EmailContent.split(">");
String actualEmailContent =
splitEmailContent[1].toString().trim();
info("actualEmailContent is : "+ actualEmailContent);
String expectedEmailContent="(.*)Online Message(.*)Subject
Review the list of Invited SuppliersRFQ(.*)PON_BIPONMSGS_AttachmentClose Date
(.*)Reply to MessageTeam,Please check if i missed inviting any other
suppliers.Regards,PRC PON00005(.*)Submitted(.*)PON00005(.*)Reply to Message(.*)";
int dot=Pattern.DOTALL;
Pattern p=Pattern.compile(expectedEmailContent, dot);
Matcher mt=p.matcher(actualEmailContent);
boolean emailContentVerification= mt.matches();
if(emailContentVerification)
{
info("Message subject and content in the email is
verified.[BR # 73226] ");
}
else
{
reportFailure("Message subject and content in the
email are not as expected. Actual:" + actualEmailContent +" Expected : " +
expectedEmailContent);
}
web.window("/web:window[@index='1']").capturePage(); //
NOPMD Capturing screenshot
}
endStep();
prcEmailLibFunctions.emailActionMSExchange("Reply to Message",
"");
}
endStep();
//atkLoginFuncLib.atkLogin(CollaborationMember2, buyerPwd1,
"Negotiations", envFilePath);
web.textBox("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']") // NOPMD -Webobject. Used waitForObject
.click();
web.waitForObject("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']", v_sync);
web.textBox("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']") // NOPMD -Webobject. Used waitForObject
.setText(CollaborationMember2);// NOPMD -Webobject. Used
waitForObject
web.waitForObject("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']", v_sync);
web.textBox("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_password[@id='password' or
@name='password' or @index='0']") // NOPMD -Webobject. Used waitForObject
.click();// NOPMD -Webobject. Used waitForObject
web.waitForObject("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']", v_sync);
web.window("/web:window[@index='0']").capturePage();
web.textBox("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_password[@id='password' or
@name='password' or @index='0']") // NOPMD -Webobject. Used waitForObject
.setPassword(deobfuscate("K87dmNfs7WidxZ7WgOniWw=="));// NOPMD -
Webobject. Used waitForObject
web.waitForObject("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:input_text[@id='userid' or @name='userid' or
@index='0']", v_sync);
web.button("/web:window[@index='0' or @title='Sign
In']/web:document[@index='0' or @name='_afr_init_']/web:form[@id='Login' or
@name='loginForm' or @index='0']/web:button[@name='btnActive' or @index='0']") //
NOPMD -Webobject. Used waitForObject
.click();// NOPMD -Webobject. Used waitForObject
web.window("/web:window[@index='0']").capturePage();
think(60);
String PageTitle=web.window("/web:window[@index='0' or
@title='*Oracle*']").getTitle().toString();
info("");
String ExpTitle = "Online Messages: RFQ " + negNumber;
if (PageTitle.contains(ExpTitle))
{
info("After clicking on Message details link a new tab is
opened with appropriate title[BR # 73223]");
}
else
{
reportFailure("After clicking on Message details link a new
tab should be opened with appropriate title[BR # 73223]. Expected: " + ExpTitle + "
Actual: " + PageTitle);
}
}
endStep();
adf.commandButton("{{obj.Messages.Details_Reply_CommandButton}}").click();//
NOPMD -Webobject. Used waitForObject
prcObj.prcWaitForPage(0,v_sync);
String
ExistingText=adf.richTextEditor("{{obj.ViewActiveNegotiations.Message_RichTextEdito
r}}").getAttribute("value").toString();
if(ExistingText!="")
{
Message1=Message1.concat(ExistingText);
}
adf.richTextEditor("{{obj.ViewActiveNegotiations.Message_RichTextEditor}}").setValu
e(Message1);
prcObj.prcWaitForPage(0,v_sync);
adf.commandImageLink(54,"{{obj.Messages.SendMessage_Attachment_Add_CommandImageLink
}}").click();
think(v_wait);
prcObj.prcWaitForPage(v_sync);
//Attach all required attachments
pON_FunLib.fnAddAttachments("L1", excelSheetPath,
"PRC_PON_TMtoBuyer:Attachments");
adf.commandButton("{{obj.ViewActiveNegotiations.MessagesPopup_Send_CommandButton}}"
).click();
prcObj.prcWaitForPage(0,v_sync);
}
endStep();
browser.launch();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
//String
collabarationMember1="PON00006",collabarationMember2="PON00007";
//Login to ATK
atkLoginFuncLib.atkLogin(buyerUser1, buyerPwd1, "Worklist*",
envFilePath);
}
endStep();
}
endStep();
web.link("/web:window[@index='1']/web:document[@index='0']/web:a[@text='*.txt']").c
lick();
prcObj.prcWaitForPage(v_sync);
web.window("/web:window[@index='1']").close();
}
endStep();
}
endStep();
ponRRFCommonFunctions.fnBuyerPortalNavigateToNegotiatonSummary(negNumber,
"Vision Operations");
adf.commandButton("{{obj.Messages.NegotiationSummary_Messages_CommandButton}}").cli
ck();
prcObj.prcWaitForPage(0,v_sync);
}
endStep();
messageTable=adf.treeTable("{{obj.Messages.Messages_TreeTable}}");
messageTable.expandCollapse("Expand", "1");
prcObj.prcWaitForPage(0,title,v_sync); //NOPMD table Object
isSubjectPresent=actualSubjectTextForSecondMessage.contains(expectedSubjectTextForS
econdRow);
actualSubjectTextForSecondMessage=pON_FunLib.fnGetCellValue(messageTable, 1,
"Status");
info("Actual status Text for reply message :
"+actualSubjectTextForSecondMessage);
isStatusPresent=
actualSubjectTextForSecondMessage.contains(expectedStatusTextForSecondRow);
actualSubjectTextForSecondMessage=pON_FunLib.fnGetCellValue(messageTable, 1,
"From");
info("Actual From Text for reply message :
"+actualSubjectTextForSecondMessage);
isFromPresent=
actualSubjectTextForSecondMessage.contains(expectedFromTextForSecondRow);
browser.launch();
setErrorRecovery(WebErrorRecovery.ERR_WAIT_FOR_PAGE_TIMEOUT_ERROR,
ErrorRecoveryAction.Ignore);
prcEmailLibFunctions.loginEmailMSExchange(buyerContact1ATKLoginEmail,
emailPassword);
}
endStep();
int dot=Pattern.DOTALL;
Pattern p=Pattern.compile(expectedEmailContent, dot);
Matcher mt=p.matcher(actualEmailContent);
boolean emailContentVerification= mt.matches();
if(emailContentVerification)
{
info("Message subject and content in the email is verified.
[BR # 73226] ");
}
else
{
reportFailure("Message subject and content in the email are
not as expected. Actual:" + actualEmailContent +" Expected : " +
expectedEmailContent);
}
web.window("/web:window[@index='1']").capturePage(); // NOPMD
Capturing screenshot
}
endStep();
String PdfContent =
pOCommonFunctions.getPdfContent(downloadPath).replace("\n", "").replace("\r", "");
info("PdfContent " + PdfContent);
if(PdfContent.trim().contains("PON_BIPONMSGS"))
{
info("PDF contains title of negotiation");
}
else
reportFailure("PDF does not contain title of negotiation");
}
endStep();
}
public void finish() throws Exception {
// Capture screenshot before closing the browser
web.window("/web:window[@index='0']").capturePage();
//prcObj.oracleSsoSignout();
//browser.closeAllBrowsers();
boolean result1 =
prcHCMUsersAction.updateEmailAddressToSendMailTestDiscard(atkUrl,contact1);
if(!result1)
{
reportFailure("Email Id of " + contact1 + " is not
updated");
}
boolean result2 =
prcHCMUsersAction.updateEmailAddressToSendMailTestDiscard(atkUrl,contact2);
if(!result2)
{
reportFailure("Email Id of " + contact2 + " is not
updated");
}
boolean result3 =
prcHCMUsersAction.updateEmailAddressToSendMailTestDiscard(atkUrl,contact3);
if(!result3)
{reportFailure("Email Id of " + contact3 + " is not updated");
}
endStep();
int
intNoOfIDRows=ponRRFCommonFunctions.fn_GetDataFromProcedure(strProcedureName,strShe
etName,ID,P1, excelSheetPath);
for(int intIterationCounter = 1;
intIterationCounter<=intNoOfIDRows; intIterationCounter++)
{
String[] arrTempValues=strProcedureName.split(":");
String strPrefix=arrTempValues[arrTempValues.length-1];
int intstrPostfix=intIterationCounter;
String name=strPrefix+"_"+"File
Name/URL"+"_"+intstrPostfix;
String title=strPrefix+"_"+"Title"+"_"+intstrPostfix;
String type=strPrefix+"_"+"Type"+"_"+intstrPostfix;
if (buyerPDFContents != null){
prcLibFunctions.verifyCheckpoint("Attachment included
in BIP Notification BuyerPDF ", title, buyerPDFContents, "a_contains_e");
} else {
//Verify to award approver attachment (0)
//Update post customer bug fix. Ref Bug #33689815
if(type.equals("Text"))
{
attachmentName= title + ".txt";
}
else if (type.equals("File")) {
attachmentName= name;
}
else if (type.equals("URL")) {
attachmentName= title;
}
else {
reportFailure("Please provide valid attachment
type");
}
verifyValueFromBIPNotification("Verify attachment",
attachmentName, "*" + attachmentName, webType.A);
}
}endStep();
}
}