Esempio n. 1
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.driver = driver
 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
Esempio n. 3
0
class RequestRevisionPages(SeleniumDriver):
    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.driver = driver

    # C53688 Request revision button says "Request changes"
    '''
    
    Preconditions

    User is logged in
    Steps

    Create or find a deal with release request when you are an approver
    Open deal details page

    Expected Result
    
    Reject button title is "Request changes"

    '''

    select_d_to_c = "//div[5]/div/div/div[2]/div[3]/div/img"
    select_c_to_b = "//div[5]/div/div/div[2]/div[5]/div/img"
    select_b_to_a = "//div[5]/div/div/div[2]/div[7]/div/img"
    request_change_button = "//span[contains(text(),'Request changes')]"

    def SelectCtoB(self):
        self.elementClick(self.select_c_to_b)

    def SelectBToA(self):
        self.elementClick(self.select_b_to_a)

    # Verify request button available on the page
    # test_01VerifyRequestRevisionButtonDToC

    def VerifyRequestRevisionButtonAvailable(self):
        time.sleep(2)
        self.release.ReleaseEToD()
        self.release.AddFloors()
        self.release.ReleaseDToCForm()
        self.VerifyRequestButton()

    def VerifyRequestButton(self):
        button_text = self.getText(self.request_change_button)
        button_text1 = "Request changes"
        self.verifyTextContains(actualText=button_text,
                                expectedText=button_text1)

    # C53690 No approval buttons after "Request changes"
    '''
    
    Preconditions

    User is logged in
    Steps
    
    Create or find a deal with release request when you are an approver
    Open deal details page
    Click "Request changes"
    Fill in all of the fields in the modal
    Click submit
    Expected Result
    
    "Request changes" modal is dismissed
    Approval buttons ("Request changes" and "Approve release" should disappear)

    '''

    click_select_a_change_drop_down = "//select[@name='reason']"
    select_incorrect_value = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/label/div/select/option[2]"
    enter_comment = "//textarea[@placeholder='Enter a comment']"
    request_modal_submit_button = "//span[contains(text(),'Submit')]"

    # Click submit button of request modal pop up
    def RequestModalSubmitButton(self):
        self.elementClick(self.request_modal_submit_button)

    # Enter comment on request modal box
    def EnterComment(self, comment):
        self.elementClick(self.enter_comment)
        time.sleep(2)
        self.sendKeys(comment, self.enter_comment)

    # GLOBAL method to add comment
    def Comment(self):
        comment = "Request release changes"
        self.EnterComment(comment)

    # click on request change button
    def ClickRequestChangeModalButton(self):
        time.sleep(2)
        self.elementClick(self.request_change_button)

    '''
    
    Steps:
    Create a new deal
    Process from e to d
    add floors
    verify request changes button
    click request change button
    select from drop down
    enter comment
    click submit
    verify upload button
    verify requested change text on approver at the bottom of the page
    scroll to upload document 
    click upload document
    click add memo and upload pdf
    Click submit
    
    '''

    doc_upload_button = "//div[@id='app']/div/div/div[2]/div/div[2]/div/div/div/div/div[3]/button/span"
    cancel_button = "//p[contains(text(),'Cancel release request')]"
    update_document = "//span[contains(text(),'Update documents')]"

    def ClickDealDetailPageCancelButton(self):
        self.dealdetail.ClickMenuIcon()
        time.sleep(2)
        self.elementClick(self.cancel_button)
        self.dealdetail.SubmitButton()

    # test_02VerifyNoApprovalButtonsAfterRequestChanges

    def NoApprovalButtonsAfterRequestChanges(self):
        time.sleep(2)
        self.ClickRequestChangeModalButton()
        time.sleep(2)
        self.elementClick(self.select_incorrect_value)
        time.sleep(2)
        self.Comment()
        time.sleep(2)
        self.RequestModalSubmitButton()
        time.sleep(4)
        get_button = self.getText(self.update_document)
        text = "Update documents"
        self.verifyTextContains(actualText=get_button, expectedText=text)

    # CTA button should say "Upload documents"
    '''
    
    Preconditions

    User should be logged in
    Steps
    
    Find a deal that you have requested changes on
    Expected Result
    
    In the header area to the right of the approval progress bar there should be two buttons floated to the right:
    1. "Cancel release"
    2. "Upload documents"

    '''

    # test_04VerifyCTAButtonShouldSayUploadDocuments

    def CTAButtonShouldSayUploadDocuments(self):
        time.sleep(2)
        get_button = self.getText(self.update_document)
        text = "Update documents"
        self.verifyTextContains(actualText=get_button, expectedText=text)

    # C53691 Approver section updates to reflect "Requested changes" status
    '''
    
    Preconditions

    User is logged in
    Steps
    
    Create or find a deal with release request when you are an approver
    Open deal details page
    Click "Request changes"
    Fill in all of the fields in the modal
    Click submit
    Expected Result
    
    Look for your name in the Approvers section
    To the right of your name it should read in yellow text: "(Requested changes)"

    '''

    requested_changes_on_deal_detail_page = "//span[contains(text(),'Requested changes')]"
    submit_button = "//span[contains(text(),'Submit')]"

    # test_05VerifyApproverSectionUpdatesToReflectRequestedChangesStatus

    def ApproverSectionUpdatesToReflectRequestedChangesStatus(self):
        time.sleep(2)
        #self.dealdetail.innerScroll(self.dealdetail.scroll_to_team)
        approver_request_text = self.getText(
            self.requested_changes_on_deal_detail_page)
        text = "Requested changes"
        self.verifyTextContains(actualText=approver_request_text,
                                expectedText=text)

    # test_06VerifyRequestRevisionFromDToC
    def VerifyRequestRevisionFromDToC(self):
        time.sleep(2)
        # self.dealdetail.innerScrollUp(self.doc_upload_button)
        # time.sleep(2)
        self.elementClick(self.update_document)
        time.sleep(2)
        self.release.AddDealMemo()
        time.sleep(2)
        self.RequestModalSubmitButton()
        time.sleep(2)
        self.VerifyRequestButton()
        time.sleep(2)
        self.release.ApproveReleaseButtonClick()

    '''
    
    Click release to b button 
    Enter all the detail on the form
    Click submit on step 3
    Expected
    Verify request change button
    
    Click request change button
    Select value from drop down
    Enter comment
    Click submit
    Expected:
    Verify request button should not be shown now
    
    Scroll to the bottom of the page
    Expected:
    VERIFY Requested change text just near the approver name
    
    Scroll the screen to top
    Click on upload documenmt
    Upload the deal memo document again
    Click submit
    
    '''

    def VerifyNoApprovalButtonsAfterRequestChangesFromCtoB(self):
        self.release.ReleaseProcessCTOB()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        self.release.AddMeetingNote()
        time.sleep(4)
        self.NoApprovalButtonsAfterRequestChanges()

    def ApproverSectionUpdatesToReflectRequestedChangesStatusFromCToB(self):
        time.sleep(2)
        self.ApproverSectionUpdatesToReflectRequestedChangesStatus()

    click_first_close_icon = "//div[@id='app']/div/div[2]/div/div/div/div/div/div[2]/div/div[1]/div/img"

    def VerifyRequestRevisionFromCToB(self):
        time.sleep(2)
        # self.dealdetail.innerScrollUp(self.doc_upload_button)
        # time.sleep(2)
        self.elementClick(self.doc_upload_button)
        time.sleep(2)
        self.elementClick(self.click_first_close_icon)
        time.sleep(2)
        self.release.AddDealMemo()
        time.sleep(2)
        self.RequestModalSubmitButton()
        time.sleep(2)
        self.VerifyRequestButton()

    # C53692 Deal list filter type "Needs my approval" list does not include deals where I have request changes
    '''
    
    Preconditions

    User is logged in
    Steps
    
    Find a deal that has changes requested
    Click "Update documents" (only if you are part of the deal team should you see update document)
    The submit button should be disabled.
    Click the X next to one of the file tokens to remove it
    Add a new file by clicking on the "Add file" button
    Once a new document is added, noticed the submit button is enabled
    Click submit
    Expected Result
    
    The new document should appear on the deal details page
    IF you are an approver on the deal, approval buttons should be visible again

    
    '''

    def ApprovalButtonsReturnAfterUpdatingDocumentsAfterChangesAreRequested(
            self):
        time.sleep(3)
        approve_button = self.getText(self.release.approve_release_button)
        approve_button_text = "Approve release"
        self.verifyTextContains(actualText=approve_button,
                                expectedText=approve_button_text)
        time.sleep(3)
        self.release.ApproveReleaseButtonClick()

    '''
    
    Click button release to a
    Ente all the details and click submit
    Expected:
    Verify request button should be there
    
    Click requested button
    Enter comment and select value from drop down
    Click submit
    Scroll to bottom of screen
    Expected:
    Verify approver text at the bottom of the screen. 
    
    Scroll to the top and click on upload document
    Upload deal memo doc
    Click submit
    
    '''

    def VerifyNoApprovalButtonsAfterRequestChangesFromBtoA(self):
        self.release.ReleaseMoveToB()
        self.release.ReleasePopUpFieldEntry()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(2)
        self.NoApprovalButtonsAfterRequestChanges()

    def ApproverSectionUpdatesToReflectRequestedChangesStatusFromBToA(self):
        time.sleep(2)
        self.ApproverSectionUpdatesToReflectRequestedChangesStatus()

    click_first_close_from_b_to_c = "//div[@id='app']/div/div[2]/div/div/div/div/div/div[3]/div/div[1]/div/img"

    def VerifyRequestRevisionFromBToA(self):
        time.sleep(2)
        # self.dealdetail.innerScrollUp(self.doc_upload_button)
        # time.sleep(2)
        self.elementClick(self.doc_upload_button)
        time.sleep(2)
        self.elementClick(self.click_first_close_icon)
        time.sleep(2)
        self.release.AddDealMemo()
        time.sleep(2)
        self.RequestModalSubmitButton()
        time.sleep(2)
        self.VerifyRequestButton()
        self.release.ApproveReleaseButtonClick()

    # C53692 Deal list filter type "Needs my approval" list does not include deals where I have request changes
    '''
    
    Preconditions

    User has logged in
    Steps

    Create or find deal that needs your approval
    Navigate to deal from “Needs my approval”
    Click "Request changes"
    Navigate back to “Needs my approval”

    Expected Result
    
    The deal should not appear in the "Needs my approval" deal list
    
    '''

    # change deal name
    deal_name_change = "//input[@placeholder='Unknown']"

    def ChangeDealName(self, dealname):
        time.sleep(2)
        self.elementClick(self.deal_name_change)
        time.sleep(2)
        self.clearField(self.deal_name_change)
        self.sendKeys(dealname, self.deal_name_change)

    # Enter deal name
    def EnterDealName(self):
        time.sleep(2)
        dealname = "#"
        self.ChangeDealName(dealname)

    more_filter = ".sidebar--header-icon:nth-child(4)"
    search_textbox = "//input[@placeholder='Search for deals']"
    no_deal_found = "//h3[contains(text(),'No deals matching your filters')]"

    def EnterSearchTextBox(self, name):
        self.elementClick(self.search_textbox)
        time.sleep(2)
        self.sendKeys(name, self.search_textbox)

    def PressEnter(self, value):
        self.sendKeys(value, self.search_textbox)

    def DealRemovedFromNeedMyApprovalAfterRequestChanges(self):
        time.sleep(3)
        self.elementClick(self.deal.click_need_my_approval)
        time.sleep(2)
        self.EnterDealName()
        time.sleep(2)
        self.NoApprovalButtonsAfterRequestChanges()
        time.sleep(2)
        self.deal.ClickBackArrow()
        time.sleep(4)
        self.elementClick(self.deal.click_need_my_approval)
        time.sleep(2)
        name = "#"
        self.EnterSearchTextBox(name)
        time.sleep(2)
        self.PressEnter(Keys.ENTER)
        time.sleep(2)
        no_deal_text = self.getText(self.no_deal_found)
        deal_text = "No deals matching your filters"
        self.verifyTextContains(actualText=no_deal_text,
                                expectedText=deal_text)
Esempio n. 4
0
 def __init__(self, driver):
     super().__init__(driver)
     self.deal = DealList(self.driver)
     self.dealdetail = DealDetailScreenPages(self.driver)
     self.driver = driver
Esempio n. 5
0
class PhotoModalPages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.driver = driver

    # Deal details > Photo Modal
    """
    1.Navigate to deal with no uploaded photos
    
    Expected :
    Button to upload “New photo” should be over google street view photo greyed out
    
    """

    default_photo = "//span[contains(text(),'New photo')]"

    def VerifyButtonToUploadNewPhoto(self):
        time.sleep(2)
        self.deal.AddNewDeal()
        time.sleep(2)
        text = "New photo"
        text_photo = self.getText(self.default_photo)
        time.sleep(2)
        self.verifyTextContains(actualText=text, expectedText=text_photo)

    # TC -02 "Uploading “main” photo replaces Google street view photo"
    """
    
    Steps:
    1.Navigate to deal with no uploaded photos
    2.Hover over the default google street view photo
    3.Click on the prompt to add “New photo”
    4.Upload photo
    
    Expected :
    The uploaded photo should replace the google street view photo in the grid
    
    """

    def VerifyUploadPhotoReplaceDefaultPhoto(self):
        time.sleep(2)
        self.dealdetail.AddPhotos()

    # TC-03 Clicking on a photo launches photo grid modal
    """
    
    "Clicking on a photo launches photo grid modal"
    1.Navigate to deal with at least one uploaded photo
    2.Click on uploaded photo in the photo grid
    
    Expected :
    1.Photo viewing modal should be launched and should see all targets with upload link next to target name
    
    """

    def ClickingOnAPhotoLaunchesPhotoGridModal(self):
        time.sleep(2)
        self.dealdetail.VerifyPhotoAddedSuccessfully()

    # TC-04 "User can upload untagged photo"
    """
    
    "User can upload untagged photo"
    1.Navigate to deal with no uploaded photos
    2.Click on photo grid slot that does NOT have a photo tag label
    3.Upload a photo
    
    Expected :
    The preview for that slot in the photo grid should be replaced with a preview of the uploaded photo
    
    """

    untagged_photo = ".sc-108qnys-0:nth-child(1)"  # change might be needed

    def UserCanUploadUntaggedPhoto(self):
        time.sleep(2)
        self.elementClick(self.untagged_photo, locatorType='css')
        time.sleep(2)
        name = "C:/Users/Sagar/PycharmProjects/DealTrack/images/R0010005.JPG"
        self.dealdetail.UploadDocuments(name)
        time.sleep(4)
        self.dealdetail.ClickUploadButton()
        time.sleep(25)
        self.dealdetail.VerifyPhotoAddedSuccessfully()

    # TC-05 "Untagged photo slot keeps count of all untagged photos "
    """
    
    "Untagged photo slot keeps count of all untagged photos "
    1.Navigate to deal with no uploaded photos
    2.Click on photo grid slot that does NOT have a photo tag label
    3.Upload four photos
    
    Expected:
    There should be a count at the top of that photo grid slot that says “+3 more”
    
    """

    other_photos_upload_link = "//div[7]//div[1]//div[1]//strong[1]"
    count_untagged_photo = "//div[contains(text(),'+ 3 more')]"
    click_other_photo_after_upload = ".tag:nth-child(6) > img"

    def UntaggedPhotoSlotKeepsCountOfAllUntaggedPhotos(self):
        time.sleep(4)
        self.dealdetail.ClickUploadedImage()
        time.sleep(2)
        self.innerScroll(self.other_photos_upload_link)
        time.sleep(2)
        for i in range(0, 3):
            self.elementClick(self.other_photos_upload_link)
            time.sleep(2)
            name = "C:/Users/Sagar/PycharmProjects/DealTrack/images/R0010005.JPG"
            self.dealdetail.UploadDocuments(name)
            time.sleep(4)
            self.dealdetail.ClickUploadButton()
            time.sleep(25)

        self.dealdetail.ClickPhotoModalCloseIcon()
        time.sleep(2)
        text = "+ 3 more"
        text_untagged_photo = self.getText(self.count_untagged_photo)
        self.verifyTextContains(actualText=text,
                                expectedText=text_untagged_photo)

    # TC-06 Deal details > Adding/editing photo tags
    """
    Preconditions

    User should be on deal details screen
    Images should be attached

    Steps:
    "Order of the tags on photos from deal details page"
    1.Click on any deal from the dealist screen
    2.Add photos if not added
    3.Click on "..." icon from any uploaded photo
    4.Click on Add tag option
    5.Select any of the tag
    6.Repeat steps 3-5 on remaining photos
    7.Click on Save button

    Expected:
    Order of tagged photos should be :
    - Main
    - Streetscape
    - Signage
    - Interior
    - Exterior
    - Lobby
        
    """

    photo_menu_icon = ".photo-tour--tag-group:nth-child(1) .sc-1dok22n-0"
    edit_photo_tag = "//strong[contains(text(),'Edit photo tag')]"
    streetscape = "//p[contains(text(),'Streetscape')]"
    save_button = "//button[contains(text(),'Save')]"

    def ClickPhotoMenuIcon(self):
        self.elementClick(self.photo_menu_icon, locatorType='css')

    def EditTag(self):
        time.sleep(2)
        self.dealdetail.ClickUploadedImage()
        time.sleep(2)
        self.ClickPhotoMenuIcon()
        time.sleep(2)
        self.elementClick(self.edit_photo_tag)
        time.sleep(2)
        self.elementClick(self.streetscape)
        time.sleep(2)
        self.elementClick(self.save_button)

    signage_upload_link = ".photo-tour--tag-group:nth-child(3) .Strong-sc-jrot7n"
    click_uploaded_image = "//div[@id='app']/div/div[2]/div/div/div/div[2]/div/div[3]/div[2]/div/div/img"
    zoom_button = "(//button[@type='button'])[3]"
    close_icon = ".ril-close"

    def ClickUploadSignageToAddPhoto(self):
        time.sleep(4)
        self.elementClick(self.signage_upload_link, locatorType='css')
        time.sleep(3)
        name = "C:/Users/Sagar/PycharmProjects/DealTrack/images/R0010005.JPG"
        self.dealdetail.UploadDocuments(name)
        time.sleep(4)
        self.dealdetail.ClickUploadButton()
        time.sleep(25)
        self.elementClick(self.click_uploaded_image)
        self.elementPresenceCheck(self.zoom_button, byType='xpath')
        time.sleep(2)
        self.elementClick(self.close_icon, locatorType='css')

    click_upload_new_photo_main_section = "//div[@id='app']/div/div[2]/div/div/div/div[2]/div/div/div[2]/div/div/div/span/span"
    remove_tag = "//button[contains(text(),'Remove tag')]"
    count_untagged_photo_after_update = "//div[contains(text(),'+ 4 more')]"

    def RemoveTag(self):
        time.sleep(2)
        self.elementClick(self.click_upload_new_photo_main_section)
        time.sleep(2)
        name = "C:/Users/Sagar/PycharmProjects/DealTrack/images/R0010005.JPG"
        self.dealdetail.UploadDocuments(name)
        time.sleep(4)
        self.dealdetail.ClickUploadButton()
        time.sleep(20)
        self.ClickPhotoMenuIcon()
        time.sleep(2)
        self.elementClick(self.edit_photo_tag)
        time.sleep(2)
        self.elementClick(self.remove_tag)
        time.sleep(2)
        self.dealdetail.ClickPhotoModalCloseIcon()
        time.sleep(2)
        text = "+ 4 more"
        text_untagged_photo = self.getText(
            self.count_untagged_photo_after_update)
        self.verifyTextContains(actualText=text,
                                expectedText=text_untagged_photo)

    delete_photo_link = "//strong[contains(text(),'Delete photo')]"
    delete_button = "//button[contains(text(),'Delete photo')]"

    def DeletePhoto(self):
        time.sleep(2)
        self.VerifyUploadPhotoReplaceDefaultPhoto()
        time.sleep(2)
        self.dealdetail.ClickUploadedImage()
        time.sleep(2)
        self.ClickPhotoMenuIcon()
        time.sleep(2)
        self.elementClick(self.delete_photo_link)
        time.sleep(4)
        self.elementClick(self.delete_button)
        time.sleep(4)
        self.elementPresenceCheck(self.click_upload_new_photo_main_section,
                                  byType='xpath')
Esempio n. 6
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
Esempio n. 7
0
class UnReleasePages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.release = ReleasePage(self.driver)
        self.driver = driver

    # C27844 Unrelease D>E
    '''
    
     Preconditions

    User should be on deal details screen having stage D
    Steps
    
    1.Click on More icon "..." displayed on top-right corner of the screen
    2.Click on Move back to E(Discovery) button from modal box
    3.Click on Submit button from confirmation box
        
    '''

    select_sourcing = "//div[5]/div/div/div[2]/div[2]/div/img"
    select_term_sheet = "//div[5]/div/div/div[2]/div[4]/div/img"
    select_c_to_b = "//div[5]/div/div/div[2]/div[5]/div/img"
    select_leasing = "//div[5]/div/div/div[2]/div[6]/div/img"
    click_move_back_to_E = "//p[contains(text(),'Move back to ')]"
    reset_button = "//button[contains(text(),'Reset')]"
    select_lease_signed = "//div[5]/div/div/div[2]/div[8]/div/img"

    def ClickResetButton(self):
        time.sleep(2)
        self.elementClick(self.reset_button)

    def SelectSourcing(self):
        time.sleep(2)
        self.elementClick(self.select_sourcing)

    def GlobalFilterSelection(self):
        self.deal.MoreFilterIcon()
        self.ClickResetButton()
        time.sleep(2)
        self.deal.ClickStageField()

    def ClickMenuIcon(self):
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.dealdetail.ClickMenuIcon()
        time.sleep(3)
        self.elementClick(self.click_move_back_to_E)
        time.sleep(3)
        self.dealdetail.SubmitButton()

    def UnreleaseDTOE(self):
        self.deal.ClickBackArrow()
        time.sleep(2)
        self.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.select_sourcing)
        time.sleep(2)
        self.ClickMenuIcon()
        time.sleep(3)
        text = self.getText(self.release.release_to_d_button)
        button_text = "Release to D"
        self.verifyTextContains(actualText=text, expectedText=button_text)

    # C27845  Unrelease C>D
    '''
    
    Preconditions

    User should be on deal details screen having stage C
    Steps
    
    1.Click on More icon "..." displayed on top-right corner of the screen
    2.Click on Move back to D(Sourcing) button from modal box
    3.Click on Submit button from confirmation box
    Expected Result
    
    Deal should get unreleased from stage C to D & an Email should be sent to all the deal team members
    
    '''

    # def PressBackArrow(self, key):
    #     self.elementClick(self.deal.ClickStageField())
    #     time.sleep(2)
    #     self.sendKeys(key, self.deal.ClickStageField())

    def ClickReset(self):
        self.elementClick(self.reset_button)

    def UnReleaseCTOD(self):
        self.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.select_term_sheet)
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.ClickMenuIcon()
        time.sleep(4)
        text = self.getText(self.release.button_request_release_to_c)
        button_text = "Request release"
        self.verifyTextContains(actualText=text, expectedText=button_text)

    # C27846 Unrelease B>C
    '''
    
     Preconditions

    User should be on deal details screen having stage B
    Steps
    
    1.Click on More icon "..." displayed on top-right corner of the screen
    2.Click on Move back to C(Term Sheet) button from modal box
    3.Click on Submit button from confirmation box
    Expected Result
    
    Deal should get unreleased from stage B to C & an Email should be sent to all the deal team members
    
    '''

    def UnReleaseBTOC(self):
        time.sleep(2)
        self.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.select_leasing)
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.ClickMenuIcon()
        time.sleep(4)
        text = self.getText(self.release.button_request_release_to_b)
        button_text = "Request release"
        self.verifyTextContains(actualText=text, expectedText=button_text)

    # C27847 Unrelease A>B
    '''
    
     Preconditions

    User should be on deal details screen having stage A
    Steps
    
    1.Click on More icon "..." displayed on top-right corner of the screen
    2.Click on Move back to B(Leasing) button from modal box
    3.Click on Submit button from confirmation box
    Expected Result
    
    Deal should get unreleased from stage A to B & an Email should be sent to all the deal team members
        
    '''

    button_release_to_a = "//span[contains(text(),'Request release')]"

    def UnReleaseATOB(self):
        time.sleep(2)
        self.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.select_lease_signed)
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.ClickMenuIcon()
        time.sleep(4)
        text = self.getText(self.button_release_to_a)
        button_text = "Request release"
        self.verifyTextContains(actualText=text, expectedText=button_text)

    # C39536 Budget as new required doc while releasing B-A
    '''
    Preconditions

    User should be logged into the app
    Steps
    
    "Additional required document to be uploaded"
    1.Click on any deal having stage B
    2.Click on Release to stage A button
    
    Expected : 
    1.Request release B-> A modal box should get invoked & new optional document field as "Budget" should be displayed on it
    2.Document should have a optional tag near it
    3.Document should in excel format
    4.It should be displayed in the same way the other release documents do

    '''

    add_budget_file = "//div[5]//p[2]//a[1]"
    optional_tag = "//p[contains(text(),'optional')]"
    verify_added_file = "//p[contains(text(),'1 file added')]"
    verify_error_msg = "//div[@id='__filestack-picker']/div/div[2]/div"
    upload_pop_up_close = ".fsp-picker__close-button"

    def AddBudgetFile(self):
        self.elementClick(self.add_budget_file)
        time.sleep(2)

    def BudgetAsNewRequiredDocWhileReleasingBToA(self):
        time.sleep(2)
        self.GlobalFilterSelection()
        time.sleep(2)
        self.elementClick(self.select_leasing)
        time.sleep(2)
        self.deal.ClickApplyButton()
        time.sleep(2)
        self.elementClick(self.button_release_to_a)
        time.sleep(3)
        self.AddBudgetFile()
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/v4.2_Proforma(1).xlsb"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(45)
        text = self.getText(self.verify_added_file)
        original_text = "1 file added; 4 remaining"
        self.verifyTextContains(actualText=text, expectedText=original_text)

    # upload the document and click on cancel button
    cancel_button_on_popup = "//button[contains(text(),'Cancel')]"

    def VerifyByUploadRequiredDocAndCancelTheProcess(self):
        time.sleep(2)
        self.elementClick(self.cancel_button_on_popup)
        time.sleep(2)
        text = self.getText(self.button_release_to_a)
        button_text = "Request release"
        self.verifyTextContains(actualText=text, expectedText=button_text)

    # upload invalid documents and verify the error message.

    def BudgetAsNewRequiredDocWhileReleasingBToA_VerifyInvalidFileUpload(self):
        time.sleep(2)
        self.elementClick(self.button_release_to_a)
        time.sleep(2)
        self.AddBudgetFile()
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/1.pdf"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(2)
        text = self.getText(self.verify_error_msg)
        error_text = "File 1.pdf is not an accepted file type. The accepted file types are .xls,.xlsx,.xlsm,.xlsb"
        self.verifyTextContains(actualText=text, expectedText=error_text)

    # C54649 Lease document validation
    '''
    
    Preconditions

    User should be logged in
    Steps
    
    "Uploading lease document informs user of access control"
    1.Find or create deal that is stage B
    2.Create release request
    3.When uploading documents begin to upload lease

    Expected Result
    There exists text that informs the user that lease documents will not be viewable on Dealtrack after submission
    
    '''

    lease_text = "//div[@id='app']/div/div/div[2]/div/div[2]/div/div/div[9]/div[2]/div[4]/div[2]/span"
    lock_icon = ".Regular-sc-ju30to svg"
    lease_text_on_popup = "//p[contains(text(),'will not be accessible from application')]"

    def VerifyLeaseTextOnPopUp(self):
        time.sleep(2)
        self.elementClick(self.upload_pop_up_close, locatorType='css')
        time.sleep(2)
        text = self.getText(self.lease_text_on_popup)
        text_to_verify = "will not be accessible from application"
        self.verifyTextContains(actualText=text, expectedText=text_to_verify)

    '''
    
    "Lease document from cancelled release request is not viewable"
    1.Find or create deal in stage B
    2.Create release request to A
    3.Add approvers and upload documents
    4.Cancel release request
    
    Expected :
    Lease approval document has moved to "Attachments" section but is dimmed and locked
    Clicking on document does nothing
    
    '''

    scroll_to_documents = "//a[contains(text(),'Documents')]"

    def VerifyLeaseAttachementByClickingLeaseDocument(self):
        time.sleep(2)
        self.elementClick(self.cancel_button_on_popup)
        time.sleep(2)
        self.release.ReleasePopUpFieldEntry()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(3)
        self.elementClick(self.scroll_to_documents)
        time.sleep(2)
        self.elementClick(self.lock_icon, locatorType='css')
        time.sleep(2)
        financial_text = self.getText(self.scroll_to_documents)
        text = 'Documents'
        self.verifyTextContains(actualText=text, expectedText=financial_text)

    # C54915 Global approvers do not exist on C>B deals
    '''
     Preconditions

    Log in to dealtrack
    
    Steps:
    "On C>B deals, global approvers section shows copy instead of approvers list"
    Navigate to deal in C>B stage
    
    Expected : 

    Under approvers section, “Global approvers” bucket should not have any users listed out and should read “Global Approvers are not required for C>B deals”
    Regional approvers should be listed as normal

    '''

    global_approver_c_to_b = "//p[contains(text(),'Global Approvers are not required for C>B deals')]"
Esempio n. 8
0
class ReleasePage(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.driver = driver

    # C27840 Release E>D
    '''
    Preconditions

    User should be on deal details screen
    Steps
    
    1.Click on Release to D button
    2.Add Real estate manger in the first field of E>D modal box
    3.Select any Product type from the drop-down menu
    4.Click on Desks field and its value
    5.Click on RSF field and its value
    6.Add Est. C release date from calendar view
    7.Add Possession date from calendar view
    8.Select region
    9.Select territory
    10.Check Tour completed? field
    11.Click on Submit button
    Expected Result
    
    Deal should get released to stage D

    '''

    release_to_d_button = "//span[contains(text(),'Release to D')]"
    enter_value_real_state_manager = "//input[@placeholder='Enter a name']"
    #= "//div[@id='app']/div/div[2]/div/div/div/div/div/div[2]/div/div/div/input"
    #select_value_real_state_manager = "//li[contains(.,'Gaurav Dave')]"
    select_value_real_state_manager = "//li[2]/p"
    enter_desk = "//input[@name='desks']"
    enter_rsf = "//input[@name='rsf']"
    est_c_release_calendar = "//input[@id='estimatedReleaseFromDToCDate']"
    possession_date = "//input[@id='possessionDate']"
    add_floor_button_after_release = "//span[contains(text(),'Add floors')]"
    '''
    
    import datetime
    base = datetime.datetime.now()
    for x in range(0, 3):
      a = (base + datetime.timedelta(days=x))
      print(a.strftime("%m/%d/%Y"))
      
    '''

    def ReleaseToDButton(self):
        self.elementClick(self.release_to_d_button)

    def EnterRealStateManager(self, name):  # enter real state manager value.
        self.elementClick(self.enter_value_real_state_manager)
        time.sleep(2)
        self.sendKeys(name, self.enter_value_real_state_manager)

    def EnterCRelease(self, toDate):  # Enter to date
        self.elementClick(self.est_c_release_calendar)
        time.sleep(2)
        self.sendKeys(toDate, self.est_c_release_calendar)

    def EnterPossession(self, possessionDate):  # Enter possession date
        self.elementClick(self.possession_date)
        time.sleep(2)
        self.sendKeys(possessionDate, self.possession_date)

    '''
    
    Steps:
    1. Used add deal function wrriten in deal deal page and created a deal
    2. Clicked on release to d button
    3. Add Real estate manger in the first field of E>D modal box
    3. Select any Product type from the drop-down menu
    4. Click on Desks field and its value
    5. Click on RSF field and its value
    6. Add Est. C release date from calendar view
    7. Add Possession date from calendar view
    8. Select region
    9. Select territory
    10. Check Tour completed? field
    11. Click on Submit button
    
    '''

    add_broker_button = "//button[contains(text(),'Add/edit broker')]"
    add_broker_link = "//p[contains(.,'+ Add broker')]"
    broker_textbox1 = "//div[@id='app']/div/div[2]/div[2]/div/div/div/div/div/div/div/div/input"
    select_broker = "//p[contains(.,'Gaurav Dave')]"

    def EnterBroker(self, brokername):
        self.elementClick(self.broker_textbox1)
        time.sleep(2)
        self.sendKeys(brokername, self.broker_textbox1)

    def EnterBrokerValueByClickingAddEditBrokerButton(self):
        self.elementClick(self.add_broker_link)
        brokername = "Gaurav dave"
        self.EnterBroker(brokername)
        time.sleep(2)
        self.elementClick(self.select_broker)
        time.sleep(2)
        self.elementClick(self.dealdetail.click_team_save_button)
        time.sleep(2)

    def ReleaseEToD(self):
        time.sleep(2)
        self.deal.AddNewDeal()
        time.sleep(4)
        self.ReleaseToDButton()
        time.sleep(2)
        name = "Gaurav Dave"
        self.EnterRealStateManager(name)
        time.sleep(2)
        self.elementClick(self.select_value_real_state_manager)
        time.sleep(2)
        self.elementClick(self.add_broker_button)
        time.sleep(2)
        self.EnterBrokerValueByClickingAddEditBrokerButton()
        time.sleep(2)
        num = '100'
        self.dealdetail.EnterDeskValue(num)
        time.sleep(2)
        rsfnum = '100'
        self.dealdetail.EnterRSFValue(rsfnum)
        time.sleep(2)
        self.dateSelection()
        time.sleep(5)
        self.dealdetail.CheckLabelYes()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(2)
        add_floor = "Update floors"
        addFloor = self.getText(self.temp_update_floor_button)
        self.verifyTextContains(actualText=addFloor, expectedText=add_floor)

    # Date selection method created to enter date for possession and opening date

    def dateSelection(self):
        base = datetime.datetime.now()
        for x in range(1, 3):
            if x == 1:
                a = (base + datetime.timedelta(days=x))
                a = (a.strftime("%m/%d/%Y"))
                self.log.info(a)
                self.EnterCRelease(a)
            else:
                a = (base + datetime.timedelta(days=x))
                a = (a.strftime("%m/%d/%Y"))
                self.log.info(a)
                time.sleep(2)
                self.EnterPossession(a)

    # Add Floor by clicking on Add Floor button
    # Enter all the values and click on save button

    temp_update_floor_button = "//span[contains(text(),'Update floors')]"
    button_request_release_to_c = "//span[contains(text(),'Request release')]"

    def ClickButtonReleaseToC(self):
        self.elementClick(self.button_request_release_to_c)

    def AddFloors(self):
        time.sleep(3)
        self.elementClick(self.temp_update_floor_button)
        time.sleep(2)
        # self.elementClick(self.temp_update_floor_button)
        # time.sleep(2)
        self.dealdetail.EnteringFloorValues()
        time.sleep(2)
        verify_button = self.getText(self.button_request_release_to_c)
        verify_button_text = "Request release"
        self.verifyTextContains(actualText=verify_button,
                                expectedText=verify_button_text)

    # C27841 Release D>C
    '''
    
    Preconditions
    
    User should be on deal details screen having stage D
    Floors info is added on deal
    Steps
    
    1.Click on Release to C button
    2.Click on Add file Excel link for adding FiMo file
    3.Select proper excel file
    4.Click on Next button
    5.Add description of the deal
    6.Select market if not selected
    7.Add Landlord name in landlord name field
    8.Add Landlord email id in landlord contract field
    9.Click on Next button
    10.Add approver name in the field
    11.Approve the request if you are approver from deal details screen
    Expected Result
    
    Deal should get released to stage C

    '''

    add_fimo_link_text = "Add file (Excel)"
    #upload_next_button_step1 = "//div[@id='app']/div/div[2]/div/div/div/div/div/div[4]/div[2]/button"
    next_button_step2 = "//div[2]/div[3]/button"
    upload_next_button_step1 = "//div[@class='button--wrapper wdunhr-0 kUWJWD']//button[@class='button--button'][contains(text(),'Next')]"
    description_field = "//textarea[@placeholder='Describe the deal']"
    click_add_edit_landlord = "//button[contains(text(),'Add/edit landlord')]"
    enter_landlord_name = "//input[@placeholder='Company name']"
    select_landlord = "//p[contains(.,'Gunners')]"
    click_save_button = "//span[contains(text(),'Save')]"
    enter_approver = "//div[1]/div/div[2]/div/div/div[1]/div/div/div[3]/div/div/div[1]/div[1]/div/input"
    select_approver = "//li[2]/p"
    request_change_button_for_verification = "//span[contains(text(),'Request changes')]"
    approve_release_button = "//span[contains(text(),'Approve release')]"
    click_approve_button = "//div[@id='app']/div/div[2]/div/div/div/div/div/div[2]/button/span"

    def ClickApproveButtonAfterMovingFromXtoY(self):
        self.elementClick(self.approve_release_button)

    def ClickNextButton(self):
        time.sleep(5)
        self.elementClick(self.upload_next_button_step1)

    def ClickSaveButton(self):
        self.elementClick(self.click_save_button)

    def EnterDescriptionRelease(self, desc):
        self.elementClick(self.description_field)
        time.sleep(1)
        self.sendKeys(desc, self.description_field)

    def EnterLandlordName(self, name):
        self.elementClick(self.enter_landlord_name)
        time.sleep(2)
        self.sendKeys(name, self.enter_landlord_name)

    def AddApprover(self, approver_name):
        self.elementClick(self.enter_approver)
        time.sleep(2)
        self.sendKeys(approver_name, self.enter_approver)

    def AddFileMemoSheet(self):
        self.elementClick(self.add_fimo_link_text, locatorType='link')
        time.sleep(2)
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/v4.2_Proforma(1).xlsb"
        self.dealdetail.UploadDocuments(doc)

    def ApproveReleaseButtonClick(self):
        self.elementClick(self.approve_release_button)
        time.sleep(3)
        self.elementClick(self.click_approve_button)

    def SelectLandlordFromAddEditButton(self):
        time.sleep(2)
        self.elementClick(self.click_add_edit_landlord)
        time.sleep(2)
        name = 'gunner'
        self.EnterLandlordName(name)
        time.sleep(2)
        self.elementClick(self.select_landlord)
        time.sleep(2)
        self.ClickSaveButton()

    def ReleaseDToCForm(self):
        time.sleep(2)
        self.elementClick(self.button_request_release_to_c)
        time.sleep(2)
        self.AddFileMemoSheet()
        time.sleep(45)
        self.log.info("hiiii pass")
        self.ClickNextButton()
        time.sleep(2)
        desc = "Running automation release from D - C"
        self.EnterDescriptionRelease(desc)
        self.SelectLandlordFromAddEditButton()
        time.sleep(2)
        self.elementClick(self.next_button_step2)
        time.sleep(2)
        approver_name = 'Gaurav Dave'
        self.AddApprover(approver_name)
        time.sleep(2)
        self.elementClick(self.select_approver)
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(8)
        verify_deal_after_completion = self.getText(
            self.request_change_button_for_verification)
        text_verify = "Request changes"
        self.verifyTextContains(actualText=verify_deal_after_completion,
                                expectedText=text_verify)

    def ReleaseDToC(self):
        self.ReleaseDToCForm()
        self.ApproveReleaseButtonClick()

    # C27842 Release C>B
    '''
    
    Preconditions

    User should be on deal details screen having stage C
    Floors info is added on deal
    Steps
    
    1.Click on Release to B button
    2.Click on Add file link of Deal Memo field
    3.Select deal memo file and upload it
    4.Click on Add file link of Term sheet field
    5.Select Term sheet file and upload it
    6.Click on Add file link of Financial model field
    7.Select FiMo file and upload it
    8.Click on Next button
    9.Confirm deal team members by adding members in each field
    10.Click on Next button after adding members
    11.Add regional approver(user can add his name also in the field)
    12.Click on Submit button, after confirming global approver
    13.Ask approvers to approve the request
    Expected Result
    
    Deal should get released to stage B

    '''

    button_request_release_to_b = "//span[contains(text(),'Request release')]"
    add_termsheet = "Add file (PDF, Doc)"
    add_deal_memo = "Add file (PDF)"
    select_date_leasing_sign = "//input[@id='date']"
    add_additional_financial_model = "//div[4]//p[2]//a[1]"

    def AddTermSheet(self):
        self.elementClick(self.add_termsheet, locatorType='link')
        time.sleep(2)
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/1.pdf"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(10)

    def AddDealMemo(self):
        self.elementClick(self.add_deal_memo, locatorType='link')
        time.sleep(2)
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/DealMemo.pdf"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(20)

    def AddAdditionalFinancialModelPDf(self):
        self.elementClick(self.add_additional_financial_model)
        time.sleep(2)
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/1.pdf"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(15)

    def EnterLeaseSigningDate(self, leasesign):
        self.elementClick(self.select_date_leasing_sign)
        time.sleep(2)
        self.sendKeys(leasesign, self.select_date_leasing_sign)

    def ReleaseProcessCTOB(self):
        time.sleep(3)
        self.elementClick(self.button_request_release_to_b)
        time.sleep(2)
        self.AddFileMemoSheet()
        time.sleep(35)
        self.AddDealMemo()
        self.AddTermSheet()
        self.AddAdditionalFinancialModelPDf()
        time.sleep(2)
        self.ReleaseProcessCtoBStep2()

    def ReleaseProcessCtoBStep2(self):
        self.elementClick(self.upload_next_button_step1)
        time.sleep(2)
        base = datetime.datetime.now()
        for x in range(1, 2):  # adding method to select lease signing date
            if x == 1:
                a = (base + datetime.timedelta(days=x))
                a = (a.strftime("%m/%d/%Y"))
                self.log.info(a)
                self.EnterLeaseSigningDate(a)
        time.sleep(2)
        self.dealdetail.SelectTransactionManager()
        time.sleep(2)
        self.dealdetail.SelectRealStateAnalystValue()
        time.sleep(2)
        self.dealdetail.SelectSourcer()
        #time.sleep(2)
        #self.dealdetail.SelectInternalCounsel()
        #time.sleep(2)
        self.elementClick(self.next_button_step2)
        time.sleep(2)
        name = "Gaurav Dave"
        self.EnterRealStateManager(name)
        self.elementClick(self.select_value_real_state_manager)
        time.sleep(2)

    # Global approvers do not exist on C>B deals
    '''
    
    "In C>B release request, user cannot add global approvers"

    Navigate to deal in stage C
    Click CTA to “Request release to B (Leasing)”
    Upload all required docs and click next
    Enter all deal team member slots and click next
    
    Expected :
    
    On “Add approvers” section, “Global committee” section should not have options to add users and should read “Global Approvers are not required for C>B deals”
    “Regional committee” section should have ability to add approvers
    
    '''

    global_approver_text_on_popup = "//p[contains(text(),'Global Approvers are not required for C>B deals')]"

    def VerifyGlobalApproversDoNotExistOnCToBDeals(self):
        self.ReleaseProcessCTOB()
        ### not required now as per the new flow
        #$text = "Global Approvers are not required for C>B deals"
        #globe_text = self.getText(self.global_approver_text_on_popup)
        #self.verifyTextContains(actualText=text, expectedText=globe_text)

    # adding meeting note method

    add_meeting_notes_button = "//span[contains(text(),'Add meeting notes')]"
    enter_meeting_notes = "//textarea[@placeholder='Enter text here']"
    enter_meeting_date = "//input[@id='regionalCommitteeMeetingDate']"
    enter_time = ".tdxc9i-0"

    def AddMeetingNoteButton(self):
        self.elementClick(self.add_meeting_notes_button)

    def EnterMeetingNote(self, text):
        self.elementClick(self.enter_meeting_notes)
        time.sleep(2)
        self.sendKeys(text, self.enter_meeting_notes)

    def EnterMeetingDate(self, a):
        self.elementClick(self.enter_meeting_date)
        time.sleep(2)
        base = datetime.datetime.now()
        a = (base + datetime.timedelta())
        a = (a.strftime("%m/%d/%Y"))
        self.log.info(a)
        self.sendKeys(a, self.enter_meeting_date)

    def EnterTime(self, tt):
        time.sleep(2)
        self.sendKeys(tt, self.enter_time, locatorType='css')

    def PressArrowKey(self, value):
        self.sendKeys(value, self.enter_time, locatorType='css')

    def AddMeetingNote(self):
        time.sleep(2)
        self.elementClick(self.add_meeting_notes_button)
        self.EnterValueInMeetingNotesModalBox()
        self.ClickSaveButton()

    def EnterValueInMeetingNotesModalBox(self):
        time.sleep(2)
        text = 'This is automatic meeting notes'
        self.EnterMeetingNote(text)
        time.sleep(2)
        base = datetime.datetime.now()
        a = (base + datetime.timedelta())
        a = (a.strftime("%m/%d/%Y"))
        self.log.info(a)
        self.EnterMeetingDate(a)
        time.sleep(2)
        tt = "1212PM"
        self.elementClick(self.enter_time, locatorType='css')
        self.PressArrowKey(Keys.ARROW_LEFT)
        self.PressArrowKey(Keys.ARROW_LEFT)
        self.EnterTime(tt)
        time.sleep(2)

    def ReleaseCToB(self):
        self.dealdetail.SubmitButton()
        time.sleep(4)
        self.ApproveReleaseButtonClick()
        time.sleep(4)
        self.AddMeetingNote()
        time.sleep(3)
        button = self.getText(self.move_to_b_button)
        button_text = "Release to B"
        self.verifyTextContains(actualText=button, expectedText=button_text)

    move_to_b_button = "//span[contains(text(),'Release to B')]"
    button_release = "//button[contains(text(),'Release')]"
    release_to_a_button = "//span[contains(text(),'Request release')]"

    def ReleaseMoveToB(self):
        time.sleep(2)
        self.elementClick(self.move_to_b_button)
        time.sleep(2)
        self.deal.SelectFirstDateFromCalendar()
        time.sleep(4)
        base = datetime.datetime.now()
        for x in range(1, 2):  # adding method to select lease signing date
            if x == 1:
                a = (base + datetime.timedelta(days=x))
                a = (a.strftime("%m/%d/%Y"))
                self.log.info(a)
                self.EnterLeaseSigningDate(a)
        time.sleep(2)
        self.elementClick(self.button_release)
        #time.sleep(3)
        #button = self.getText(self.release_to_a_button)
        #button_text = "Request release"
        #self.verifyTextContains(actualText=button, expectedText=button_text)

    approver_1 = "//div[3]/div/div/div/div[1]/div/div/input"
    approver_2 = "//div[3]/div/div/div/div[2]/div/div/input"
    approver_4 = "//div[3]/div/div/div/div[4]/div/div/input"
    close_icon = ".icon--close"
    select_value_real_state_manager_dhiraj = "//li[contains(.,'Dhiraj')]"

    def EnterApprover1(self, app1):
        self.elementClick(self.approver_1)
        time.sleep(2)
        self.sendKeys(app1, self.approver_1)

    def EnterApprover2(self, app2):
        self.elementClick(self.approver_2)
        time.sleep(2)
        self.sendKeys(app2, self.approver_2)

    def EnterApprover4(self, app4):
        self.elementClick(self.approver_4)
        time.sleep(2)
        self.sendKeys(app4, self.approver_4)

    def ClickCloseIcon(self):
        self.elementClick(self.close_icon, locatorType='css')

    def ReleasePopUpFieldEntry(self):
        time.sleep(2)
        self.elementClick(self.release_to_a_button)
        time.sleep(2)
        self.AddFileMemoSheet()
        time.sleep(45)
        self.AddDealMemo()
        time.sleep(2)
        self.AddTermSheet()
        time.sleep(2)
        self.AddAdditionalFinancialModelPDf()
        self.ClickNextButton()
        time.sleep(2)
        self.elementClick(self.next_button_step2)
        time.sleep(2)
        app1 = "Gaurav Dave"
        self.EnterApprover1(app1)
        self.elementClick(self.select_value_real_state_manager)
        time.sleep(2)
        # self.ClickCloseIcon()
        # app2 = "Gaurav Dave"
        # self.EnterApprover2(app2)
        # self.elementClick(self.select_value_real_state_manager)
        time.sleep(2)
        app4 = "Gaurav Dave"
        self.EnterApprover4(app4)
        time.sleep(2)
        self.elementClick(self.select_value_real_state_manager)

    def ReleaseToA(self):
        self.ReleasePopUpFieldEntry()
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(2)
        self.ApproveReleaseButtonClick()
class OverviewSectionPages(SeleniumDriver):
    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

    # Overview section should be beneath the photo grid
    '''
    
    Preconditions
    User is logged into Dealtrack
    
    Steps
    Scroll to photogrid
    Look under photo grid
    
    Expected Result
    There should be a section representing a quick overview of the deal. It has the description of the deal on the left side and on the right you will see Details (Adjusted NPV, Free Rent, Product type. Below Details there is a Space section which includes USF, RSF, Desks, Floors and See more hyperlink.


    '''

    detail_tag = "//span[contains(text(),'Details')]"
    adjusted_npv_tag = "//span[contains(text(),'Adjusted NPV')]"
    space_tag = "//span[contains(text(),'Space')]"
    see_more_link = "//strong[contains(text(),'See more >')]"
    rsf = "//span[contains(text(),'RSF')]"
    usf = "//span[contains(text(),'USF')]"
    desk = "//span[contains(text(),'Desks')]"
    floors = "//span[contains(text(),'Floors')]"

    def OverviewSectionShouldBeBeneathThePhotoGrid(self):
        time.sleep(2)
        self.deal.AddNewDeal()
        time.sleep(2)
        self.elementPresenceCheck(self.detail_tag, byType='xpath')
        self.elementPresenceCheck(self.adjusted_npv_tag, byType='xpath')
        self.elementPresenceCheck(self.space_tag, byType='xpath')
        self.elementPresenceCheck(self.see_more_link, byType='xpath')
        self.elementPresenceCheck(self.rsf, byType='xpath')
        self.elementPresenceCheck(self.usf, byType='xpath')
        self.elementPresenceCheck(self.desk, byType='xpath')
        self.elementPresenceCheck(self.floors, byType='xpath')

    # "See more" link launches floors modal
    '''
    
    Preconditions
    User is logged into Dealtrack
    
    Steps
    Go to a deal in C
    Go to overview section
    Click on 'See More' text link next to "Space" heading
    
    Expected Result
    The floors edit modal should launch
    User should be able to do any floors related activities (add/remove floors, USF, RSF, Desks)
    Making changes in modal persists in overview section 

    '''

    add_floor_text = "//p[contains(text(),'Add floors')]"
    floor_count = "//div[@id='overview']//div[4]//div[1]//span[1]"
    enter_floor = "//div[@id='app']/div/div[2]/div/div/div/div[2]/div/input"
    enter_rsf = "//tr[2]//td[2]//input[1]"
    enter_usf = "//tr[2]//td[3]//input[1]"
    enter_desk = "//tr[2]//td[4]//input[1]"

    def EnterFloor(self, floor_num):
        self.elementClick(self.enter_floor)
        time.sleep(2)
        self.sendKeys(floor_num, self.enter_floor)

    def pressEnter(self, value):
        self.sendKeys(value, self.enter_floor)

    def EnterRSF(self, rsf_num):
        self.elementClick(self.enter_rsf)
        time.sleep(2)
        self.sendKeys(rsf_num, self.enter_rsf)

    def EnterUSF(self, usf_num):
        self.elementClick(self.enter_usf)
        time.sleep(2)
        self.sendKeys(usf_num, self.enter_usf)

    def EnterDesk(self, desk_num):
        self.elementClick(self.enter_desk)
        time.sleep(2)
        self.sendKeys(desk_num, self.enter_desk)

    def EnteringSecondFloorValues(self):
        floor_num = '3'
        self.EnterFloor(floor_num)
        time.sleep(2)
        self.pressEnter(Keys.ENTER)
        rsf_num = '10'
        self.EnterRSF(rsf_num)
        time.sleep(2)
        usf_num = '15'
        self.EnterUSF(usf_num)
        time.sleep(2)
        desk_num = '12'
        self.EnterDesk(desk_num)
        time.sleep(2)
        self.elementClick(self.dealdetail.click_Save_button)

    def SeeMoreLinkLaunchesFloorsModal(self):
        time.sleep(2)
        self.elementClick(self.see_more_link)
        time.sleep(2)
        self.elementPresenceCheck(self.add_floor_text, byType='xpath')

    def UserShouldBeAbleToADDFloors(self):
        time.sleep(2)
        self.dealdetail.EnteringFloorValues()
        time.sleep(2)
        text = self.getText(self.floor_count)
        expected = "1"
        self.verifyTextContains(actualText=text, expectedText=expected)

    def UserShouldBeAbleToUpdateFloors(self):
        time.sleep(2)
        self.elementClick(self.see_more_link)
        time.sleep(2)
        self.EnteringSecondFloorValues()
        time.sleep(2)
        text = self.getText(self.floor_count)
        expected = "2"
        self.verifyTextContains(actualText=text, expectedText=expected)

    # Validate TI allowance and Free Rent from proforma
    '''
    
    Preconditions
    User is logged into dealtrack
    User must have excel

    Steps
    User finds/creates a deal in D.
    Release request to C and upload a proforma (4.2 proforma, add approvers (add yourself as an approver))
    Open proforma in excel, unhide the submit to log tab
    look for Free rent from possession in months value, TI allowance value (currency)

    Expected Result
    The values in the proforma matches the values displayed in the overview section.


    '''

    # Updating floors in modal, updates overview section
    '''
    
    Preconditions
    User is logged into dealtrack
    User finds a deal with floors added
    
    Steps
    Click on the 'see more' hyperlink in overview section next to 'Space'
    Add an additional floor with RSF, USF, Desks
    Click save

    Expected Result
    Floor gets added and 'Space' in overview section is updated with the total value for RSF,USF, Desks, and Total number of floors
    
    '''

    rsf_value = "(//span[@type='3'])[4]"
    usf_value = "(//span[@type='3'])[5]"
    desk_value = "(//span[@type='3'])[6]"

    def UpdatingFloorsInModalUpdatesOverviewSection(self):
        time.sleep(2)
        rsf_text = self.getText(self.rsf_value)
        usf_text = self.getText(self.usf_value)
        desk_text = self.getText(self.desk_value)
        time.sleep(2)
        rsf_expected = "20"
        usf_expected = "30"
        desk_expected = "24"
        self.verifyTextContains(actualText=rsf_text, expectedText=rsf_expected)
        self.verifyTextContains(actualText=usf_text, expectedText=usf_expected)
        self.verifyTextContains(actualText=desk_text,
                                expectedText=desk_expected)

    # Adding Product type in Terms tab
    '''
    
    Preconditions

    User is logged into dealtrack

    Steps

    Go to any deal
    Go to Terms tab
    Click on Product type
    Select an additional product type in multi-select dropdown
    Click save

    Expected Result

    Product types that were added persist in Terms tab and in overview section the product types are displayed with 
    comma separating them


    '''

    product_types = "(//span[@type='3'])[3]"
    click_overview = "//a[contains(text(),'Overview')]"

    def AddingProductTypeInTermsTab(self):
        time.sleep(2)
        self.elementClick(self.dealdetail.scroll_to_text)
        time.sleep(2)
        self.dealdetail.TermsTab()
        time.sleep(2)
        self.elementClick(self.click_overview)
        time.sleep(2)
        text = self.getText(self.product_types)
        expected = "Corporate"
        self.verifyTextContains(actualText=text, expectedText=expected)
Esempio n. 10
0
class DocumentSpecificPages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deall = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.release = ReleasePage(self.driver)
        self.unrelease = UnReleasePages(self.driver)
        self.request = RequestRevisionPages(self.driver)
        self.driver = driver


    # C63079 Document View

    """
    
    Preconditions

    User is logged into dealtrack
    Create a new deal by clicking on the (+) on the bottom left side of the page, Add an address and Click Add

    Steps

    Scroll below General info tab
    
    Expected Result

    'Documents' section is displayed with the following associated tags in this order (Financial model, term sheet, deal memo, lease first then the rest in alphabetical order)
    1. Financial Model
    2. Term Sheet
    3. Deal Memo
    4. Lease
    5. Budget
    6. Ops Rider
    7. Programming package (pkg)
    8. Project schedule
    9. Test Fit
    10. RevOps FiMo
    
    Below the associated file tag you have a grey thumbnail with a (+) icon in the center

    Below target tags there is an 'Other attachments' section with a (+) icon next to it to upload attachments.
    
    Depending on side of the page the documents thumbnail displays will shift, if screen is wide enough all the target tags will be on one row, number of rows increase depending on how small the screen is but the size of the thumbnail does not change


    """

    scroll_to_documents = "//a[contains(text(),'Documents')]"
    financial_model = "//span[contains(text(),'Financial model')]"
    deal_memo = "//span[contains(text(),'Deal memo')]"
    lease = "//span[contains(text(),'Lease')]"
    budget = "//span[contains(text(),'Budget')]"
    ops_rider = "//span[contains(text(),'Ops rider')]"
    programing_pkg = "//span[contains(text(),'Programming pkg')]"
    project_schedule = "//span[contains(text(),'Project schedule')]"
    revops = "//span[contains(text(),'RevOps FiMo')]"
    testFit = "//span[contains(text(),'Test fit')]"


    def Scroll_to_documents(self):
        self.elementClick(self.scroll_to_documents)

    def VerifyDocumentView(self):
        time.sleep(2)
        self.deall.ClickBackArrow()
        time.sleep(2)
        self.deall.AddNewDeal()
        time.sleep(2)
        self.Scroll_to_documents()
        time.sleep(2)
        self.elementPresenceCheck(self.deal_memo, byType='xpath')
        self.elementPresenceCheck(self.financial_model, byType='xpath')
        self.elementPresenceCheck(self.lease, byType='xpath')
        self.elementPresenceCheck(self.budget, byType='xpath')
        self.elementPresenceCheck(self.ops_rider, byType='xpath')
        self.elementPresenceCheck(self.programing_pkg, byType='xpath')
        self.elementPresenceCheck(self.project_schedule, byType='xpath')
        self.elementPresenceCheck(self.revops, byType='xpath')
        self.elementPresenceCheck(self.testFit, byType='xpath')


    # Specific target tag upload view

    '''
    
    Preconditions

    User is logged into dealtrack
    User has created a new deal and is in stage E: (https://wework.testrail.net/index.php?/cases/view/59784 )
    
    Upload each documents one by one. 


    '''
    click_new_financial_model = ".sc-12w36a0-0:nth-child(2) svg"
    click_lease_upload_pdf = ".sc-12w36a0-0:nth-child(5) svg"
    click_budget_upload_xls = ".sc-12w36a0-0:nth-child(6) svg"
    click_ops_rider_upload_pdf = ".sc-12w36a0-0:nth-child(7) svg"
    click_programing_pkg_upload_pdf = ".sc-12w36a0-0:nth-child(8) svg"
    click_project_schedule_upload_pdf = ".sc-12w36a0-0:nth-child(9) svg"
    click_revOps_upload_xls = ".sc-12w36a0-0:nth-child(10) svg"
    click_test_fit_upload_pdf = ".sc-12w36a0-0:nth-child(10) svg"
    click_other_attachment_upload_pdf = ".sc-12w36a0-0:nth-child(12) svg"


    def UploadPDF(self):
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/1.pdf"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(20)

    def UploadCSV(self):
        doc = "C:/Users/Sagar/PycharmProjects/DealTrack/files/v4.2_Proforma(1).xlsb"
        self.dealdetail.UploadDocuments(doc)
        time.sleep(45)

    def ClickNewFinancialModel(self):
        self.elementClick(self.click_new_financial_model, locatorType='css')
        self.UploadPDF()

    def LeaseUpload(self):
        self.elementClick(self.click_lease_upload_pdf, locatorType="css")
        self.UploadPDF()

    def BudgetUpload(self):
        self.elementClick(self.click_budget_upload_xls, locatorType="css")
        self.UploadCSV()

    def OpsRiderUpload(self):
        self.elementClick(self.click_ops_rider_upload_pdf, locatorType="css")
        self.UploadPDF()

    def ProgramingPkgUpload(self):
        self.elementClick(self.click_programing_pkg_upload_pdf, locatorType="css")
        self.UploadPDF()

    def ProjectScheduleUpload(self):
        self.elementClick(self.click_project_schedule_upload_pdf, locatorType="css")
        self.UploadPDF()

    def RevOpsUpload(self):
        self.elementClick(self.click_revOps_upload_xls, locatorType="css")
        self.UploadCSV()

    def TestFitUpload(self):
        self.elementClick(self.click_test_fit_upload_pdf, locatorType="css")
        self.UploadPDF()

    def OtherAttachmentUpload(self):
        self.elementClick(self.click_other_attachment_upload_pdf, locatorType="css")
        self.UploadPDF()

    def UploadDocumentOneByOne(self):
        time.sleep(2)
        self.dealdetail.TermSheetDocument()
        self.dealdetail.FinacialDocuments()
        self.dealdetail.DealMemo()
        self.ClickNewFinancialModel()
        self.LeaseUpload()
        self.BudgetUpload()
        self.OpsRiderUpload()
        self.ProgramingPkgUpload()
        self.ProjectScheduleUpload()
        self.RevOpsUpload()
        self.TestFitUpload()
        self.OtherAttachmentUpload()


    # Lease target upload

    """
    
    Lease thumbnail has a locked icon and is not viewable and does not download when clicked on
    
    """

    lock_icon = ".Regular-sc-178ixox path"

    def LockIcon(self):
        self.getElement(self.lock_icon, locatorType='css')

    def VerifyLockIconAfterUploadingLeaseDocument(self):
        time.sleep(2)
        self.isElementPresent(self.LockIcon())


    # Deal in stage D-C

    '''
    
    Preconditions

    User is logged into dealtrack
    User created/ finds a deal in stage D
    Create a new deal by clicking on the (+) on the bottom left side of the page, Add an address and Click Add, Click release to D (Add release estate manager, Desks, RSF, Est C release date, possession date and press submit)

    Step 	Expected Result
    1 Go to Documents section of deal details page
        
    
    Next to Documents with orange caution icon it says 1 needed
    
    Under target tag Financial Model it says "Upload needed" with an orange caution icon
    
    2 Click on the (+) under financial model and upload a proforma

    Financial model thumbnail says {"D to C release"}{Time: Just now}
    
    Under Financial model tag it says 'Ready for approval''
    
    Next to 'Documents' section it says 'Ready for approval'
    
    3 Click on "Release to C"
    Modal opens and Financial modal has the document that was added on the deal details page under Financial model
    
    4  Enter "edit deal info" details (description, market and landlord)
    
    Add approvers and press submit

    Modal closes (approval buttons appear if you made yourself an approver)
    
    unable to go back and upload any required document, can still cancel release request

    
    '''

    # test_04VerifyDocumentDealInStageDtoC

    text_ready_for_approval = "//div[@id='documents']/div/div/div/div/div[2]"

    def DocumentDealInStageDtoC(self):
        time.sleep(2)
        self.release.ReleaseEToD()
        self.release.AddFloors()
        self.Scroll_to_documents()
        time.sleep(2)
        self.dealdetail.FinacialDocuments()
        self.elementPresenceCheck(self.text_ready_for_approval, byType='xpath')
        self.release.ReleaseDToC()

    # test_05VerifyDocumentDealInStageCtoB

    def DocumentDealInStageCtoB(self):
        time.sleep(2)
        self.Scroll_to_documents()
        time.sleep(2)
        text_to_verify = self.getText(self.text_ready_for_approval)
        original_text = "4 needed"
        self.verifyTextContains(actualText=text_to_verify, expectedText=original_text)
        time.sleep(2)
        self.dealdetail.TermSheetDocument()
        self.dealdetail.FinacialDocuments()
        self.dealdetail.DealMemo()
        self.ClickNewFinancialModel()
        self.elementPresenceCheck(self.text_ready_for_approval, byType='xpath')
        time.sleep(2)
        self.release.ClickButtonReleaseToC()
        self.release.ReleaseProcessCtoBStep2()
        self.release.ReleaseCToB()
        self.release.ReleaseMoveToB()

    # test_06VerifyDocumentDealInStageBtoA

    def DocumentDealInStageBtoA(self):
        time.sleep(2)
        self.Scroll_to_documents()
        time.sleep(2)
        text_to_verify = self.getText(self.text_ready_for_approval)
        original_text = "4 needed"
        self.verifyTextContains(actualText=text_to_verify, expectedText=original_text)
        time.sleep(2)
        self.dealdetail.TermSheetDocument()
        self.dealdetail.FinacialDocuments()
        self.dealdetail.DealMemo()
        self.ClickNewFinancialModel()
        self.LeaseUpload()
        text_to_verify_after_uploading = self.getText(self.text_ready_for_approval)
        original_text_after_uploading = "Ready for approval"
        self.verifyTextContains(actualText=text_to_verify_after_uploading, expectedText=original_text_after_uploading)
        self.elementPresenceCheck(self.text_ready_for_approval, byType='xpath')
        time.sleep(2)


    # Request changes newly uploaded required doc is on thumbnail

    '''
    Step 	
    1 Press Request changes button      
    Expected Result
    Request changes Modal appears
    
    2 Select "What needs to change" and comment and press submit
    Expected Result 
    Modal is closed and "Upload documents" cta appears
    
    3 Click "Upload documents" and change the Financial model that is present with a different financial model and press submit  
    Expected Result
    under documents, the most recent financial modal is in the thumbnail and on the thumbnail it states {"D to C release"}{Time: Just now}
        
    
    '''

    uploaded_needed = "//strong[contains(text(),'Upload needed')]"
    close_icon_to_remove_file = "//img[@class='close']"
    check_text_after_uploading_the_document = "//span[text()='D to C release']"

    # test_07VerifyRequestChangesNewlyUploadedRequiredDocIsOnThumbnail

    def RequestChangesNewlyUploadedRequiredDocIsOnThumbnail(self):
        time.sleep(2)
        self.release.ReleaseEToD()
        self.release.AddFloors()
        self.release.ReleaseDToCForm()
        time.sleep(2)
        self.request.NoApprovalButtonsAfterRequestChanges()
        time.sleep(2)
        self.elementClick(self.request.update_document)
        time.sleep(2)
        self.elementClick(self.close_icon_to_remove_file)
        time.sleep(2)
        self.release.AddFileMemoSheet()
        time.sleep(30)
        self.request.RequestModalSubmitButton()
        time.sleep(2)
        self.Scroll_to_documents()
        time.sleep(2)
        actual_text = self.getText(self.check_text_after_uploading_the_document)
        expected_text = "D to C release"
        self.verifyTextContains(actualText=actual_text, expectedText=expected_text)


    # Canceling a release request

    '''
    
    Preconditions

    User is logged into dealtrack
    User has a deal awaiting a release request approval
    User completed
    
    Steps:
    
    Click on the 'Cancel Release' CTA
    
    Expected :
    Release request is canceled and all the documents that were added for the release in the thumbnail displays: 
    {Stage canceled}{name}{Time}
    Example: {D to C release Canceled}{Rumi Begum, 2days ago} 

    
    '''

    # test_08VerifyCancelingAReleaseRequest

    click_cancel_release_request_from_overflow_menu = "//p[contains(text(),'Cancel release request')]"
    text_release_canceled = "//span[contains(text(),'(Canceled)')]"

    def CancelingAReleaseRequest(self):
        time.sleep(2)
        self.dealdetail.ClickMenuIcon()
        time.sleep(2)
        self.elementClick(self.click_cancel_release_request_from_overflow_menu)
        time.sleep(2)
        self.dealdetail.SubmitButton()
        time.sleep(2)
        self.Scroll_to_documents()
        time.sleep(2)
        actual_text = self.getText(self.text_release_canceled)
        expected_text = "Canceled"
        self.verifyTextContains(actualText=actual_text, expectedText=expected_text)
Esempio n. 11
0
class DealDetailTest(unittest.TestCase):
    log = cl.customLogger(logging.DEBUG)

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

    def test_01AddDeal(self):
        self.log.info("*#" * 20)
        self.log.info(" AddDeal ")
        self.log.info("*#" * 20)
        self.deal_details.DealDetails()

    def test_02DealDetailsAddingPictures(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details adding/editing pictures ")
        self.log.info("*#" * 20)
        self.deal_details.AddPhotos()

    def test_03DealDetailsAddingDescription(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details adding/editing pictures ")
        self.log.info("*#" * 20)
        self.deal_details.Description()

    def test_07DealDetailsTeamMemberRealStateManager(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details DealMemo documents ")
        self.log.info("*#" * 20)
        self.deal_details.TeamMemberRealStateManager()

    def test_08DealDetailsTransactionManger(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details TransactionManger ")
        self.log.info("*#" * 20)
        self.deal_details.TransactionManger()

    # def test_09DealDetailsSourcer(self):
    #     self.log.info("*#" * 20)
    #     self.log.info(" Deal details Sourcer ")
    #     self.log.info("*#" * 20)
    #     self.deal_details.Sourcer()

    def test_10DealDetailsRealStateAnalyst(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details RealStateAnalyst ")
        self.log.info("*#" * 20)
        self.deal_details.RealStateAnalyst()

    # def test_11DealDetailsInternalCounsel(self):
    #     self.log.info("*#" * 20)
    #     self.log.info(" Deal details InternalCounsel ")
    #     self.log.info("*#" * 20)
    #     self.deal_details.InternalCounsel()

    # def test_12DealDetailsGeneralInfoTab(self):
    #     self.log.info("*#" * 20)
    #     self.log.info(" Deal details General info tab")
    #     self.log.info("*#" * 20)
    #     self.deal_details.GeneralInfoTab()

    def test_13DealDetailsTermsTab(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details Terms tab")
        self.log.info("*#" * 20)
        self.deal_details.TermsTab()

    def test_14DealDetailsPerformanceTab(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details Performance tab")
        self.log.info("*#" * 20)
        self.deal_details.PerformanceTab()

    # def test_15DealDetailsFloorsTab(self):
    #     self.log.info("*#" * 20)
    #     self.log.info(" Deal details Floors tab")
    #     self.log.info("*#" * 20)
    #     self.deal_details.FloorsTab()

    def test_17DealChangingStatus(self):
        self.log.info("*#" * 20)
        self.log.info(" DealChangingStatus to closed")
        self.log.info("*#" * 20)
        self.deal_details.DealChangingStatus()

    # def test_18LocationWalkscoreGooglePlaceAmenities(self):
    #     self.log.info("*#" * 20)
    #     self.log.info(" Location, Walkscore & Google place amenities")
    #     self.log.info("*#" * 20)
    #     self.deal_details.LocationScreenGoogle()

    def test_19ButtonORlinkToCreateDealAtExistingLocation(self):
        self.log.info("*#" * 20)
        self.log.info(" Location, Walkscore & Google place amenities")
        self.log.info("*#" * 20)
        self.deal_details.CreateDealFromExistingDeal()

    def test_20ButtonORlinkToCreateDealAtExistingLocation(self):
        self.log.info("*#" * 20)
        self.log.info(" Button/link to create deal at existing location")
        self.log.info("*#" * 20)
        self.deal_details.AddDealFromCreatedDeal()

    def test_22VerifyGrossConstructionCostOnPerformanceTab(self):
        self.log.info("*#" * 20)
        self.log.info(" test_22VerifyGrossConstructionCostOnPerformanceTab ")
        self.log.info("*#" * 20)
        self.deal_details.GrossConstructionCostONPerformanceTab()

    def test_23GrossConstructionFieldEditable(self):
        self.log.info("*#" * 20)
        self.log.info(" test_23GrossConstructionFieldEditable ")
        self.log.info("*#" * 20)
        self.deal_details.GrossConstructionFieldEditable()

    def test_24DealDetailsUploadFinancialDocs(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details Financial Documents  ")
        self.log.info("*#" * 20)
        self.deal_details.DealDetails()
        self.deal_details.FinacialDocuments()

    def test_25DealDetailsUploadTermSheetDocs(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details Term sheet documents ")
        self.log.info("*#" * 20)
        self.deal_details.TermSheetDocument()

    def test_26DealDetailsDealMemoDocs(self):
        self.log.info("*#" * 20)
        self.log.info(" Deal details DealMemo documents ")
        self.log.info("*#" * 20)
        self.deal_details.DealMemo()

    def test_27DealDetailVerifyPerformanceSectionNotEditableAfterUploadCsv(
            self):
        self.log.info("*#" * 20)
        self.log.info(
            " test_27DealDetailVerifyPerformanceSectionNotEditableAfterUploadCsv "
        )
        self.log.info("*#" * 20)
        self.deal_details.VerifyPerformanceSectionTabNotEditable()
Esempio n. 12
0
 def objectSetup(self, oneTimeSetUp):
     self.deal_details = DealDetailScreenPages(self.driver)