public AbsPage zPressButton(Button button) throws HarnessException { logger.info(myPageName() + " zDisplayPressButton(" + button + ")"); tracer.trace("Click " + button); AbsPage page = this; String locator = null; boolean doPostfixCheck = false; if (button == Button.B_VIEW_ENTIRE_MESSAGE) { locator = this.ContainerLocator + " span[id$='_msgTruncation_link']"; if (!this.sIsElementPresent(locator)) throw new HarnessException("locator is not present for button " + button + " : " + locator); this.sClick(locator); // sClick() is required for this element this.zWaitForBusyOverlay(); return (page); } else if (button == Button.B_HIGHLIGHT_OBJECTS) { locator = this.ContainerLocator + " span[id$='_highlightObjects_link']"; if (!this.sIsElementPresent(locator)) throw new HarnessException("locator is not present for button " + button + " : " + locator); this.sClick(locator); // sClick() is required for this element this.zWaitForBusyOverlay(); return (page); } else if (button == Button.B_ACCEPT) { locator = DisplayMail.Locators.AcceptButton; page = null; doPostfixCheck = true; } else if (button == Button.O_ACCEPT_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.AcceptNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_ACCEPT_EDIT_REPLY) { locator = DisplayMail.Locators.AcceptEditReplyMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_ACCEPT_DONT_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.AcceptDontNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.B_TENTATIVE) { locator = DisplayMail.Locators.TentativeButton; page = null; doPostfixCheck = true; } else if (button == Button.O_TENTATIVE_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.TentativeNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_TENTATIVE_EDIT_REPLY) { locator = DisplayMail.Locators.TentativeEditReplyMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_TENTATIVE_DONT_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.TentativeDontNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.B_DECLINE) { locator = DisplayMail.Locators.DeclineButton; page = null; doPostfixCheck = true; } else if (button == Button.O_DECLINE_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.DeclineNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_DECLINE_EDIT_REPLY) { locator = DisplayMail.Locators.DeclineEditReplyMenu; page = null; doPostfixCheck = true; } else if (button == Button.O_DECLINE_DONT_NOTIFY_ORGANIZER) { locator = DisplayMail.Locators.DeclineDontNotifyOrganizerMenu; page = null; doPostfixCheck = true; } else if (button == Button.B_PROPOSE_NEW_TIME) { locator = DisplayMail.Locators.ProposeNewTimeButton; page = null; } else if (button == Button.B_ACCEPT_SHARE) { locator = this.ContainerLocator + " td[id$='__Shr__SHARE_ACCEPT_title']"; page = new SeparateWindowDialog(DialogWarningID.ZmAcceptShare, MyApplication, this); ((SeparateWindowDialog) page).zSetWindowTitle(this.DialogWindowTitle); doPostfixCheck = true; } else if (button == Button.B_DECLINE_SHARE) { locator = this.ContainerLocator + " td[id$='__Shr__SHARE_DECLINE_title']"; page = new SeparateWindowDialog(DialogWarningID.ZmAcceptShare, MyApplication, this); ((SeparateWindowDialog) page).zSetWindowTitle(this.DialogWindowTitle); doPostfixCheck = true; } else { throw new HarnessException("no implementation for button: " + button); } if (locator == null) throw new HarnessException("no locator defined for button " + button); if (!this.sIsElementPresent(locator)) throw new HarnessException("locator is not present for button " + button + " : " + locator); this.zClick(locator); this.zWaitForBusyOverlay(); if (page != null) { page.zWaitForActive(); } if (doPostfixCheck) { // Make sure the response is delivered before proceeding Stafpostqueue sp = new Stafpostqueue(); sp.waitForPostqueue(); } return (page); }
public AbsPage zToolbarPressPulldown(Button pulldown, Button option) throws HarnessException { logger.info( myPageName() + " zToolbarPressButtonWithPulldown(" + pulldown + ", " + option + ")"); tracer.trace("Click pulldown " + pulldown + " then " + option); if (pulldown == null) throw new HarnessException("Pulldown cannot be null!"); if (option == null) throw new HarnessException("Option cannot be null!"); // Default behavior variables String containerToolbar = "css=div[id^='ztb__MSG']"; String containerActionMenu = "css=div[id^='zm__MSG']"; String pulldownLocator = null; // If set, this will be expanded String optionLocator = null; // If set, this will be clicked AbsPage page = null; // If set, this page will be returned if (pulldown == Button.B_ACTIONS) { pulldownLocator = containerToolbar + " div[id$='__ACTIONS_MENU'] td[id$='_dropdown']>div"; if (option == Button.B_PRINT) { optionLocator = containerActionMenu + " div[id='PRINT'] td[id$='_title']"; page = null; throw new HarnessException("implement me"); // Need to implement the print dialog // FALL THROUGH } else if (option == Button.B_RESPORTSPAM) { optionLocator = containerActionMenu + " div[id='SPAM'] td[id$='_title']"; page = null; // FALL THROUGH } else if (option == Button.B_RESPORTNOTSPAM) { optionLocator = containerActionMenu + " div[id='SPAM'] td[id$='_title']"; page = null; // FALL THROUGH } else if (option == Button.O_MARK_AS_READ) { optionLocator = containerActionMenu + " div[id='MARK_READ'] td[id$='_title']"; page = null; // FALL THROUGH } else if (option == Button.O_MARK_AS_UNREAD) { optionLocator = containerActionMenu + " div[id='MARK_UNREAD'] td[id$='_title']"; page = null; // FALL THROUGH } else if (option == Button.O_SHOW_ORIGINAL) { optionLocator = containerActionMenu + " div[id='SHOW_ORIG'] td[id$='_title']"; page = null; // FALL THROUGH } else if (option == Button.B_REDIRECT) { optionLocator = containerActionMenu + " div[id='REDIRECT'] td[id$='_title']"; page = new SeparateWindowDialogRedirect(this.MyApplication, this); // FALL THROUGH } else if (option == Button.O_EDIT_AS_NEW) { optionLocator = containerActionMenu + " div[id='EDIT_AS_NEW'] td[id$='_title']"; page = null; // FALL THROUGH } else { throw new HarnessException( "no logic defined for pulldown/option " + pulldown + "/" + option); } } else if (pulldown == Button.B_TAG) { pulldownLocator = containerToolbar + " div[id$='__TAG_MENU'] td[id$='_dropdown']>div"; if (option == Button.O_TAG_NEWTAG) { optionLocator = "css=td[id$='__TAG_MENU|MENU|NEWTAG_title']"; page = null; // new DialogTag(this.MyApplication, this); throw new HarnessException("implement me"); // Need to implement the 'new tag' dialog // FALL THROUGH } else if (option == Button.O_TAG_REMOVETAG) { optionLocator = "css=div[id$='__TAG_MENU|MENU'] div[id='message_removetag'] td[id$='_title']"; page = null; // FALL THROUGH } else { throw new HarnessException( "no logic defined for pulldown/option " + pulldown + "/" + option); } } else { throw new HarnessException("no logic defined for pulldown/option " + pulldown + "/" + option); } if (pulldownLocator != null) { this.zClickAt(pulldownLocator, ""); if (optionLocator != null) { this.zClickAt(optionLocator, ""); } } if (page != null) { page.zWaitForActive(); } return (page); }