def __init__(self, driver):
     super().__init__(driver)
     self.deal = DealList(self.driver)
     self.dealdetail = DealDetailScreenPages(self.driver)
     self.unrelease = UnReleasePages(self.driver)
     self.meeting = MeetingNotesPages(self.driver)
     self.driver = driver
Exemple #2
0
 def __init__(self, driver):
     super().__init__(driver)
     self.deall = DealList(self.driver)
     self.dealdetail = DealDetailScreenPages(self.driver)
     self.request = RequestRevisionPages(self.driver)
     self.unrelease = UnReleasePages(self.driver)
     self.release = ReleasePage(self.driver)
     self.driver = driver
Exemple #3
0
 def __init__(self, driver):
     super().__init__(driver)
     self.deal = DealList(self.driver)
     self.dealdetail = DealDetailScreenPages(self.driver)
     self.unrelease = UnReleasePages(self.driver)
     self.release = ReleasePage(self.driver)
     self.broker = BrokerPages(self.driver)
     self.landlord = LandlordPages(self.driver)
     self.ut = Util()
     self.driver = driver
Exemple #4
0
class MeetingNotesPages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deall = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.request = RequestRevisionPages(self.driver)
        self.unrelease = UnReleasePages(self.driver)
        self.release = ReleasePage(self.driver)
        self.driver = driver

    temp_update_floor_button = "//span[contains(text(),'Update floors')]"
    element1 = "//tr[1]//td[7]//div[1]//img[2]"

    def VerifyMeetingNoteButton(self):
        time.sleep(4)
        self.deall.ClickBackArrow()
        time.sleep(2)
        self.deall.MoreFilterIcon()
        time.sleep(2)
        self.deall.ClickStageField()
        time.sleep(2)
        self.request.SelectBToA()
        time.sleep(2)
        self.deall.ClickApplyButton()
        time.sleep(4)
        for i in range(6):
            if not self.isElementDisplayed(
                    self.release.add_meeting_notes_button):
                self.unrelease.ClickMenuIcon()
                time.sleep(2)
                self.deall.MoreFilterIcon()
                time.sleep(2)
                self.deall.ClickApplyButton()
                time.sleep(3)
            else:
                break
        self.elementPresenceCheck(self.release.add_meeting_notes_button,
                                  byType='xpath')

    # adding meeting note by clicking on add meeting note button and then entering all the values.
    def AddMeetingNotes(self):
        self.release.AddMeetingNote()

    click_meeting_notes_from_note_section = ".sc-1nmm7de-0 svg"
    click_added_meeting_note = "//span[contains(text(),'B to A release')]"
    scroll_to_notes = "//a[contains(text(),'Notes')]"

    # verify added meeting note is showing in notes section
    def VerifyAddedMeetingNotesOnNotesSection(self):
        time.sleep(2)
        self.elementClick(self.scroll_to_notes)
        time.sleep(4)
        self.elementPresenceCheck(self.click_added_meeting_note,
                                  byType='xpath')

    select_c = "//div[5]/div/div/div[2]/div[4]/div/img"

    # add meeting notes from c to b process
    def VerifyMeetingNotesButtonFromCtoB(self):
        time.sleep(4)
        self.deall.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.deall.reset_button)
        time.sleep(2)
        self.deall.ClickStageField()
        time.sleep(2)
        self.elementClick(self.select_c)
        time.sleep(2)
        self.deall.ClickApplyButton()
        time.sleep(4)
        for i in range(5):
            if self.isElementDisplayed(self.temp_update_floor_button):
                element_to_hover_over = self.getElement(self.element1)
                self.log.info('element found')
                hoverover = ActionChains(self.driver).move_to_element(
                    element_to_hover_over).click().perform()
                self.log.info('element clicked')
                self.dealdetail.EnteringFloorValues()
                time.sleep(4)
                self.release.ReleaseProcessCTOB()
                time.sleep(3)
                self.dealdetail.SubmitButton()
            else:
                break
        time.sleep(5)
        self.release.ReleaseProcessCTOB()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(4)
        if self.isElementDisplayed(self.temp_update_floor_button):
            self.elementClick(self.temp_update_floor_button)
            time.sleep(2)
            self.dealdetail.EnteringFloorValues()
            time.sleep(4)
        self.elementPresenceCheck(self.release.add_meeting_notes_button,
                                  byType='xpath')

    def EnterValueInMeetingNotesModalBoxFromCToB(self):
        time.sleep(2)
        self.release.AddMeetingNote()

    click_added_meeting_note_from_c_to_b = "//span[contains(text(),'C to B release')]"

    def VerifyAddedMeetingNotesOnNotesSectionFromCtoB(self):
        time.sleep(2)
        self.elementClick(self.scroll_to_notes)
        time.sleep(4)
        self.elementPresenceCheck(self.click_added_meeting_note_from_c_to_b,
                                  byType='xpath')

    '''
    To verify the ticket we have to scroll the screen to top and then click on cancel button
    Steps:
    1. Scroll to top
    2. Click cancel button
    3. Click submit button
    4. Full release process 
    5. Click add meeting note button
    
    Expected:
    Verify meeting note modal box should be empty.
    
    '''

    def PreviousMeetingNoteIsDisplayedAndEditableWhenReleaseIsCancelled(self):
        time.sleep(2)
        # self.innerScrollUp(self.dealdetail.click_description)
        # time.sleep(2)
        self.request.ClickDealDetailPageCancelButton()
        time.sleep(2)
        self.release.ReleaseProcessCTOB()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(4)
        if self.isElementDisplayed(self.temp_update_floor_button):
            self.elementClick(self.temp_update_floor_button)
            time.sleep(2)
            self.dealdetail.EnteringFloorValues()
            time.sleep(3)
        self.elementClick(self.release.add_meeting_notes_button)
        time.sleep(2)
        textbox = self.getElement(
            self.release.enter_meeting_notes).get_attribute('value')
        if textbox == '':
            self.log.info("empty")
            assert True
        else:
            self.log.info("not empty")
            assert False
class ComparablePage(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.unrelease = UnReleasePages(self.driver)
        self.meeting = MeetingNotesPages(self.driver)
        self.driver = driver

    # User sees comparables in stages C, B, A
    '''
    
    Preconditions

    User is logged in
    User is in stage C, B or A
    Steps
    
    Look at deal details page below financials
    Expected Result
    
    There should be a Comparables component
 
    
    '''

    click_comparable = "//a[contains(text(),'Comparables')]"
    compare_this_deal_to_text = "//span[contains(text(),'Compare this deal to')]"

    def VerifyComparabaleInC(self):
        time.sleep(2)
        self.deal.ClickBackArrow()
        time.sleep(2)
        self.unrelease.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.meeting.select_c)
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(4)
        self.elementClick(self.click_comparable)
        time.sleep(2)
        self.elementPresenceCheck(self.compare_this_deal_to_text,
                                  byType='xpath')

    select_b = "//div[5]/div/div/div[2]/div[6]/div/img"

    def SelectB(self):
        self.elementClick(self.select_b)

    def VerifyComparableSectionInB(self):
        time.sleep(2)
        self.unrelease.GlobalFilterSelection()
        time.sleep(2)
        self.SelectB()
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(4)
        self.elementClick(self.click_comparable)
        time.sleep(2)
        self.elementPresenceCheck(self.compare_this_deal_to_text,
                                  byType='xpath')

    select_a = "//div[5]/div/div/div[2]/div[8]/div/img"

    def SelectA(self):
        self.elementClick(self.select_a)

    def VerifyComparableSectionInA(self):
        time.sleep(2)
        self.unrelease.GlobalFilterSelection()
        time.sleep(2)
        self.SelectA()
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.elementClick(self.click_comparable)
        time.sleep(2)
        self.elementPresenceCheck(self.compare_this_deal_to_text,
                                  byType='xpath')

    # Comparables dropdown defaults to market average
    '''
    
    Preconditions

    User is logged in
    User is in stage C, B or A
    Steps
    
    Look at comparables section
    Expected Result
    
    The data defaults to compare to market average
    Explanatory footnote displayed under the table explaining the weighted averages. It should say: "* Avgs weighted by desk, except for total desks, RSF, and USF"


    '''

    footnote = '''//*[@id="comparables"]/span[3]'''

    def ComparablesDropdownDefaultsToMarketAverage(self):
        time.sleep(2)
        self.elementPresenceCheck(self.footnote, byType='xpath')

    drop_down_list = '''//select[@name='comparables--name']'''
    default_text = "//option[@value='Pipeline average']"

    def DefaultTextDropdown(self):
        time.sleep(2)
        text = self.getText(self.default_text)
        original_text = "Pipeline average"
        self.verifyTextContains(actualText=text, expectedText=original_text)

    def CheckValueInDropDown(self):
        time.sleep(2)
        count = self.getText(self.drop_down_list)
        count = count.split()
        self.log.info(len(count))
class UnreleaseTest(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

    @pytest.fixture(autouse=True)
    def objectSetup(self, oneTimeSetUp):
        self.unrelease = UnReleasePages(self.driver)

    def test_01VerifyUnReleaseEToD(self):
        self.log.info("*#" * 20)
        self.log.info(" test_01VerifyUnReleaseEToD ")
        self.log.info("*#" * 20)
        self.unrelease.UnreleaseDTOE()

    def test_02VerifyUnReleaseDToC(self):
        self.log.info("*#" * 20)
        self.log.info(" test_02VerifyUnReleaseDToC ")
        self.log.info("*#" * 20)
        self.unrelease.UnReleaseCTOD()

    def test_03VerifyUnReleaseCToB(self):
        self.log.info("*#" * 20)
        self.log.info(" test_03VerifyUnReleaseCToB ")
        self.log.info("*#" * 20)
        self.unrelease.UnReleaseBTOC()

    def test_04VerifyUnReleaseBToA(self):
        self.log.info("*#" * 20)
        self.log.info(" test_04VerifyUnReleaseBToA ")
        self.log.info("*#" * 20)
        self.unrelease.UnReleaseATOB()

    def test_05VerifyBudgetAsNewRequiredDocWhileReleasingBToA(self):
        self.log.info("*#" * 20)
        self.log.info(
            " test_05VerifyBudgetAsNewRequiredDocWhileReleasingBToA ")
        self.log.info("*#" * 20)
        self.unrelease.BudgetAsNewRequiredDocWhileReleasingBToA()

    def test_06BudgetAsNewRequiredDocWhileReleasingBToA_VerifyByUploadRequiredDocAndCancelTheProcess(
            self):
        self.log.info("*#" * 20)
        self.log.info(
            " test_06BudgetAsNewRequiredDocWhileReleasingBToA_VerifyByUploadRequiredDocAndCancelTheProcess "
        )
        self.log.info("*#" * 20)
        self.unrelease.VerifyByUploadRequiredDocAndCancelTheProcess()

    def test_07BudgetAsNewRequiredDocWhileReleasingBToA_VerifyInvalidFileUpload(
            self):
        self.log.info("*#" * 20)
        self.log.info(
            " test_07BudgetAsNewRequiredDocWhileReleasingBToA_VerifyInvalidFileUpload "
        )
        self.log.info("*#" * 20)
        self.unrelease.BudgetAsNewRequiredDocWhileReleasingBToA_VerifyInvalidFileUpload(
        )

    def test_08VerifyLeaseTextOnPopUp(self):
        self.log.info("*#" * 20)
        self.log.info(" test_08VerifyLeaseTextOnPopUp ")
        self.log.info("*#" * 20)
        self.unrelease.VerifyLeaseTextOnPopUp()

    def test_09VerifyLeaseAttachementByClickingLeaseDocument(self):
        self.log.info("*#" * 20)
        self.log.info(" test_09VerifyLeaseAttachementByClickingLeaseDocument ")
        self.log.info("*#" * 20)
        self.unrelease.VerifyLeaseAttachementByClickingLeaseDocument()
 def objectSetup(self, oneTimeSetUp):
     self.unrelease = UnReleasePages(self.driver)