コード例 #1
0
class BrokerPages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.release = ReleasePage(self.driver)
        self.ut = Util()
        self.driver = driver


    # C54671 Deal details > Broker


    '''
    
    Preconditions

    User should be logged into the app
    
    Step 	
    
    "Clicking broker section opens broker modal"

    1.User should scroll down to the broker section
    2.User should click on the section

    Expected:
    Broker modal should open
    
    '''

    broker = "//h4[contains(text(),'Broker')]"
    verify_edit_broker_modalbox = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/h2"

    def ClickingBrokerSectionOpensBrokerModal(self):
        time.sleep(2)
        self.deal.AddNewDeal()
        time.sleep(2)
        self.innerScroll(self.dealdetail.scroll_to_team)
        time.sleep(2)
        self.elementClick(self.broker)
        time.sleep(2)
        text = "Edit broker"
        broker_text = self.getText(self.verify_edit_broker_modalbox)
        self.verifyTextContains(actualText=broker_text, expectedText=text)


    # Deal details page has empty broker section
    '''
    
    "Deal details page has empty broker section"
    Precondition :
    - User should be logged into the app
    - User should be on deal details screen
    - There should be no broker yet
    
    1.User should scroll down to the broker section

    Expected Result
    It should say "Add Broker"
    
    '''

    add_broker_link = "//p[contains(.,'+ Add broker')]"

    def DealDetailsPageHasEmptyBrokerSection(self):
        time.sleep(2)
        text = "+ Add broker"
        text_link = self.getText(self.add_broker_link)
        self.verifyTextContains(actualText=text, expectedText=text_link)


    '''
    
    "Deal details page has "not applicable" broker section "
    Preconditions
    - User should be logged into the app
    - User should be on deal details screen
    - Broker should be not applicable (Find/Create a deal with Broker as "not applicable")
    
    1.Scroll down to broker section
    
    Expected : 
    There should be text in the broker section that says "Not applicable"
    
    '''

    not_applicable_link = "//p[contains(.,'Not applicable')]"

    def DealDetailsPageHasNotApplicableBrokerSection(self):
        time.sleep(2)
        text = "Not applicable"
        text_link = self.getText(self.not_applicable_link)
        self.verifyTextContains(actualText=text, expectedText=text_link)


    # Submit button should be disabled

    '''
    
    "Save is disabled until a broker or "not applicable" is selected"
    1.Scroll down to broker section
    2.Click on section, to open modal
    
    Expected :
    Submit button should be disabled

    '''

    save_button = "//button[contains(text(),'Save')]"

    def SubmitButtonShouldBeDisabled(self):
        time.sleep(2)
        element = self.getElement(self.save_button)
        result = element.is_enabled()
        self.log.info(result)
        return result



    #  "User can search or create a broker"

    '''
    
     "User can search or create a broker"

    1.Scroll down to broker section
    2.Click on section, to open modal
    3.In modal, select "Add broker"

    Expected : 
    User sees search
    typing into search triggers a dropdown list of brokers and an "add broker" option
    
    '''

    broker_textbox = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/input"
    after_adding_broker = ".broker--name"
    select_broker = "//p[contains(.,'Gaurav Dave')]"

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

    def UserCanSearchAndCreateABroker(self):
        time.sleep(2)
        self.elementClick(self.add_broker_link)
        time.sleep(2)
        brokername = "Gaurav dave"
        self.EnterBroker(brokername)
        self.elementClick(self.select_broker)
        time.sleep(2)
        self.elementClick(self.save_button)
        time.sleep(2)
        verify_broker = self.getText(self.after_adding_broker, locatorType='css')
        self.verifyTextContains(actualText=verify_broker, expectedText=brokername)

    # "User can edit contact "

    '''
    
    "User can edit contact "
    1.Scroll down to broker section
    2.Click on section, to open modal
    3.In modal, select "Add broker"
    4.Search and select an existing broker
        
    Expected :
    A card should appear under the existing brokers name with info filled in
    User should be able to edit that info
    
    '''

    edit_contact_text_box = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div[2]/div/div/input"
    select_edit_contact = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div[2]/div/div/div/div/div"
    verify_edit_contact_on_detail_page = "//p[contains(.,'*****@*****.**')]"

    '''
    
    Steps:
    1. Click broker
    2. Enter contact name
    3. Select from suggestion list
    4. Click save button
    
    Verify added info on deal detail screen
    
    '''


    def EditContactBox(self, contactname):
        self.elementClick(self.edit_contact_text_box)
        time.sleep(2)
        self.sendKeys(contactname, self.edit_contact_text_box)

    def UserCanEditContacts(self):
        time.sleep(2)
        self.elementClick(self.broker)
        time.sleep(2)
        contactname = "g"
        self.EditContactBox(contactname)
        time.sleep(2)
        self.elementClick(self.select_edit_contact)
        time.sleep(2)
        self.elementClick(self.save_button)
        time.sleep(3)
        email_contact = "*****@*****.**"
        emailcontact = self.getText(self.verify_edit_contact_on_detail_page)
        self.verifyTextContains(actualText=email_contact, expectedText=emailcontact)


    # "User can create a new contact"

    '''
    
    "User can create a new contact"
    1.Scroll down to broker section
    2.Click on section, to open modal
    3.In modal, select "Add broker"
    4.Search and select an existing broker
    5.Click on "Add Contact"
    6.Enter Contact name
    7.Enter contact email
    8.press save
    
    Expected :
    Broker is selected and contact is stored. Broker section shows 
    Broker company name with contact card with name and email of broker contact
    
    '''

    click_create_new_broker = ".contact-search--create-option"
    contact_close_icon = ".contact--ex-icon"
    add_contact = ".contact--add"

    def ClickCreateNew(self):
        self.elementClick(self.click_create_new_broker, locatorType='css')

    def ClickAddContact(self):
        self.elementClick(self.add_contact, locatorType='css')

    def ClickContactCloseIcon(self):
        self.elementClick(self.contact_close_icon, locatorType='css')

    '''
    
    Steps:
    1. Click on broker 
    2. Click on close icon of added broker and remove it
    3. Click add broker link
    4. Enter broker name
    5. Click create 
    6. Enter contact name
    7. Click save button
    
    '''

    def UserCanCreateANewContact(self):
        time.sleep(2)
        self.elementClick(self.broker)
        time.sleep(2)
        self.ClickContactCloseIcon()
        time.sleep(2)
        self.elementClick(self.add_broker_link)
        time.sleep(2)
        name = "broker"
        brokername = self.ut.getUniqueName(2)
        brokername = name + brokername
        self.EnterBroker(brokername)
        time.sleep(2)
        self.ClickCreateNew()
        time.sleep(2)
        self.ClickAddContact()
        time.sleep(2)
        name = "broker"
        contactname = self.ut.getUniqueName(2)
        contactname = name + contactname
        self.EditContactBox(contactname)
        time.sleep(2)
        self.ClickCreateNew()
        time.sleep(2)
        self.elementClick(self.save_button)
コード例 #2
0
from utilities.util import Util

ut = Util()
print(ut.getUniqueName(6))
コード例 #3
0
class ExploreScreen(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.driver = driver

    # Locators:

    # C27818 - Explore screen
    '''
    
    User should be logged into the app
    Steps
    
    1.Click on Explore tab from left navigation panel
    Expected Result
    
    User should redirected to Explore screen
 
    '''

    explore_icon = "//a[3]//img[1]"
    explore_text = "//h3[contains(text(),'Explore')]"

    def ExploreNavigation(self):
        time.sleep(4)
        self.elementClick(self.explore_icon)
        time.sleep(2)
        text = 'Explore'
        actual_text = self.getText(self.explore_text)
        self.verifyTextContains(actualText=actual_text, expectedText=text)

    # C27819 Search functionality on Explore
    '''
    
    Preconditions
    
    User should be on Explore tab
    Steps
    
    1.Click on Search field
    2.Type some keywords (min. 3 keywords)
    Expected Result
    
    Search suggestions should get displayed accordingly
    
    '''

    search_textbox = "//input[@id='search-bar-input']"
    select_deal = "//li[@id='search-bar-item-3']/div/p[2]"

    def EnterDeal(self, name=''):
        self.elementClick(self.search_textbox)
        self.sendKeys(name, self.search_textbox)

    def SearchDeal(self):
        time.sleep(2)
        self.ut = Util()
        time.sleep(2)
        deal_name = self.ut.getUniqueName(4)
        self.EnterDeal(deal_name)
        time.sleep(3)
        self.elementClick(self.select_deal)
        time.sleep(10)

    # C27821 Adding a new deal from Explore tab
    '''
    
    Preconditions
    
    User should be on Explore tab
    Steps
    
    1.Click on Search field
    2.Type some keywords (min. 3 keywords)
    3.Click on any of suggested properties
    4.Click on Add a deal button, or
    5.Click on that property address
    6.Click on Add a deal button from details screen(empty screen)
    Expected Result
    
    Deal with that property address should get created and user should be redirected to deal details screen
    - Deal's(property) address should get displayed in the search box

    
    '''

    close_icon = "//*[@class='icon--close']"
    add_a_deal_button = "//button[contains(text(),'Add a deal')]"
    deal_detail_text_after_creation = "//span[contains(text(),'Release to D')]"

    def AddNewDeal(self):
        time.sleep(2)
        self.elementClick(self.close_icon)
        self.SearchDeal()
        self.elementClick(self.add_a_deal_button)
        time.sleep(3)
        text_deal_detail_page = self.getText(
            self.deal_detail_text_after_creation)
        text_detail = "Release to D"
        self.verifyTextContains(actualText=text_deal_detail_page,
                                expectedText=text_detail)

    # C27824 Zoom functionality on map-view
    '''
    
     Preconditions

    User should be on Explore tab
    Steps
    
    1.Zoom in/out on map view screen by clicking on +/- or scrolling up/down
    Expected Result
    
    Map view screen should display deals(pins) accordingly
     
    
    '''

    zoomin_button = "(//button[@type='button'])[3]"
    zoomout_button = "(//button[@type='button'])[4]"
    redo_Text = "//button[contains(text(),'Redo ')]"

    def ZoomFunctionality(self):
        time.sleep(2)
        self.elementClick(self.explore_icon)
        time.sleep(2)
        for i in range(4):
            self.elementClick(self.zoomin_button)
            time.sleep(2)
        for i in range(6):
            self.elementClick(self.zoomout_button)
            time.sleep(2)
        time.sleep(2)
        map_text = self.getText(self.redo_Text)
        original_text = "Redo search in this area"
        self.verifyTextContains(actualText=map_text,
                                expectedText=original_text)

    # C27825 Street view on map screen
    '''
    
    Preconditions

    User should be on Explore tab
    Steps

    1.Drag-n-drop the street icon on map screen
    Expected Result

    Street view should get displayed on map screen
 
    
    '''

    street_icon = "//div[@id='app']/div/div/div[2]/div/div[2]/div/div/div/div/div[8]/div[2]"
    drag_drop = "(//button[@type='button'])[2]"
    text_after_drop = "//a[contains(text(),'View on Google Maps')]"

    def StreetView(self):
        time.sleep(2)
        fromElement = self.getElement(self.street_icon)
        toElement = self.getElement(self.redo_Text)
        time.sleep(4)
        actions = ActionChains(self.driver)
        actions.drag_and_drop(fromElement, toElement).perform()
        time.sleep(5)
        actions.click_and_hold(fromElement).move_to_element(
            toElement).release().perform()
        self.log.info("Drag And Drop Element Successful")
        time.sleep(4)
        street_text = self.getText(self.text_after_drop)
        street_text_verify = "View on Google Maps"
        self.verifyTextContains(actualText=street_text,
                                expectedText=street_text_verify)
コード例 #4
0
class LandlordPages(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.deal = DealList(self.driver)
        self.dealdetail = DealDetailScreenPages(self.driver)
        self.release = ReleasePage(self.driver)
        self.broker = BrokerPages(self.driver)
        self.ut = Util()
        self.driver = driver


    #  Deals can have multiple landlords with no parents

    '''
    
    Deals can have multiple landlords with no parents

    Precondition : There should be no landlords under the header yet
    
    Click edit (pencil icon) - Modal should pop up
    Modal should allow inputting multiple landlords - add landlord a, b and c with contact info but, no parents
    Press Save
    
    Expected :
    The landlord section should show all 3 landlords and they’re contact info.
     All 3 landlords should be at the same level (no children no parents)
        
    '''

    landlord_tab = "//h4[contains(text(),'Landlord')]"
    add_landlord_link = "//p[contains(.,'+ Add landlord')]"
    landlord_textbox = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/div/input"
    save_button = "//span[contains(text(),'Save')]"
    check_element_present = "//div[@id='app']/div/div/div[2]/div/div[2]/div/div/div[13]/div/div[2]/div/div[2]/div"

    def Verification(self):
        time.sleep(2)
        self.elementClick(self.save_button)
        time.sleep(3)
        sa = self.elementPresenceCheck(self.check_element_present, byType='xpath')
        self.log.info(sa)

    def EnterLandlord(self, landlord):
        self.elementClick(self.landlord_textbox)
        time.sleep(2)
        self.sendKeys(landlord, self.landlord_textbox)

    def RandomLandlordName(self):
        landname = 'landlord'
        name = self.ut.getUniqueName(4)
        name = landname + name
        self.EnterLandlord(name)

    def DealsCanHaveMultipleLandlordsWithNoParents(self):
        time.sleep(2)
        self.innerScroll(self.landlord_tab)
        time.sleep(2)
        self.elementClick(self.landlord_tab)
        time.sleep(2)
        for i in range(1, 4):
            self.elementClick(self.add_landlord_link)
            time.sleep(2)
            self.RandomLandlordName()
            self.broker.ClickCreateNew()
            time.sleep(2)
        self.elementClick(self.save_button)


    # Landlords can have multiple children

    '''
    
    Landlords can have multiple children

    1.Click edit (pencil icon) - Modal should pop up
    2.Add a landlord (landlord A)
    3.Add 2 landlords (B and C) with A parent
    
    Expected:
    Reexamine the landlord section of deal detail page,
    landlord A should be first with landlords B and C at the same level underneath it
    
    '''

    add_subsidiary_link = "//div[2]/div/div/div/div/div/div/div[1]/div/div[2]/div/div[2]/p"
    subsidiary_company = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div[2]/div/div/div/div/input"
    click_create = ".contact-search--create-option"


    def EnterSubsidiary_company(self, subsidiaryname):
        self.elementClick(self.subsidiary_company)
        time.sleep(2)
        self.sendKeys(subsidiaryname, self.subsidiary_company)

    def RandomSubsidiary_company(self):
        subsidiaryname = 'Subsidiary'
        name = self.ut.getUniqueName(4)
        name = subsidiaryname + name
        self.EnterSubsidiary_company(name)

    def LandlordsCanHaveMultipleSubsidiary(self):
        time.sleep(2)
        self.elementClick(self.landlord_tab)
        time.sleep(2)
        for i in range(1, 4):
            x = [i]
            a = '//div[2]/div/div/div/div/div/div/div'
            c = '/div/div[2]/div/div[2]/p'
            add_subsidiary = a + str(x) + c
            time.sleep(2)
            self.elementClick(add_subsidiary)
            self.RandomSubsidiary_company()
            time.sleep(4)
            self.elementClick(self.click_create, locatorType='css')
        #self.Verification()


    click_add_contact = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div/div[1]/div[1]/div[1]/div[2]/div/div[1]/p'''

    def LandlordsCanHaveMultipleContacts(self):
        time.sleep(3)
        self.elementClick(self.landlord_tab)
        time.sleep(2)
        for i in range(1, 4):
            x = [i]
            a = '//*[@id="app"]/div/div[2]/div/div/div[1]/div/div/div[1]/div'
            c = '/div[1]/div[2]/div/div[1]/p'
            add_contact = a + str(x) + c
            time.sleep(2)
            self.elementClick(add_contact)
            self.RandomSubsidiary_company()
            time.sleep(2)
            self.elementClick(self.click_create, locatorType='css')
            time.sleep(4)
        #self.Verification()

    add_sub_contact = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div/div[1]/div[1]/div[1]/div[2]/div[2]/div[1]/p'''

    def LandlordCanHaveMultipleSubContacts(self):
        time.sleep(3)
        self.elementClick(self.landlord_tab)
        time.sleep(2)
        for i in range(1, 3):
            self.elementClick(self.add_sub_contact)
            self.RandomSubsidiary_company()
            time.sleep(2)
            self.elementClick(self.click_create, locatorType='css')
            time.sleep(4)
コード例 #5
0
class DealList(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.ut = Util()
        self.driver = driver

    # Locators:

    # TC - 01 - Accessing Quick filters
    '''
    Steps:
    Login to app
    click on back arrow near need my approval text
    Click on My deals quick filter
    
    Expected:
    Only those deals that I am part of (as a team member) should be displayed.
    
    '''

    click_arrow_img = "//img[@class='sidebar--header-chevron']"
    click_my_deals = "//p[contains(text(),'My deals')]"
    active_tag = "//div[contains(text(),'Active')]"
    click_need_my_approval = "//p[contains(text(),'Needs my approval')]"
    click_pending_release = "//p[contains(text(),'Pending release')]"
    approve_release_button = "//span[contains(text(),'Approve release')]"

    def ClickNeedMyApproval(self):
        self.elementClick(self.click_need_my_approval)

    def ClickBackArrow(self):
        self.elementClick(self.click_arrow_img)

    def AccessMyDealQuickFilter(self):
        time.sleep(2)
        self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.elementClick(self.click_my_deals)
        time.sleep(2)
        active_text = self.getText(self.active_tag)
        tag_text = 'active'
        self.verifyTextContains(actualText=active_text, expectedText=tag_text)

    # test_02AccessNeedMyApproval

    def AccessNeedMyApprovalFilter(self):
        time.sleep(2)
        self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.ClickNeedMyApproval()
        time.sleep(3)
        button_text = self.getText(self.approve_release_button)
        button_original_text = "Approve release"
        self.verifyTextContains(actualText=button_text,
                                expectedText=button_original_text)

    # test_03AccessPendingRelease

    tag1 = "//div[contains(text(),'Awaiting global approval')]"
    tag2 = "//div[contains(text(),'Awaiting regional approval')]"
    tag3 = "//div[contains(text(),'Awaiting release')]"
    tag4 = "//div[contains(text(),'Documents Required')]"

    def AccessPendingReleaseFilter(self):
        time.sleep(2)
        self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.elementClick(self.click_pending_release)
        time.sleep(2)
        tag1_text = self.getText(self.tag1)
        tag2_text = self.getText(self.tag2)
        tag3_text = self.getText(self.tag3)
        tag4_text = self.getText(self.tag4)
        self.verifyTextContains(actualText=tag1_text,
                                expectedText='Awaiting global approval')
        self.log.info('tag1 verification passed')
        self.verifyTextContains(actualText=tag2_text,
                                expectedText='Awaiting regional approval')
        self.log.info('tag2 verification passed')
        self.verifyTextContains(actualText=tag3_text,
                                expectedText='Awaiting release')
        self.log.info('tag3 verification passed')
        self.verifyTextContains(actualText=tag4_text,
                                expectedText='Documents Required')
        self.log.info('tag4 verification passed')

    # TC -C27808  Search box functionality
    '''
    Steps:
    1.Click on Search field
    2.Type some keywords (min. 2 keywords)
    3.Hit Enter
    
    Expected:
    Relevant search results should get displayed accordingly.
    
    '''

    first_deal_text = "//div[@class='deal-card---deal is-active']//div[@class='deal-card---top-row']"

    # TC - C27809 -- Adding New deal functionality
    '''
    Steps
    
    1.Click on + button from bottom left side of the screen
    2.Type any property address
    3.Click on any of the suggested properties
    4.Click on Add button
    
    Expected Result
    Deal should get created and should get displayed on the deal list screen

    '''

    # test_05AddingNewDealFunctionality

    click_add_new_deal = "//div[@class='add--new-deal']"
    new_deal_textbox = "//input[@id='search-bar-input']"
    click_add_button = "//div[@id='app']/div/div[2]/div/div/div/div/div[2]/div[2]/button"
    select_item_list = "//li[@id='search-bar-item-1']/div/p[2]"
    deal_name_main_page = "//div[@id='app']/div/div/div[2]/div/div[2]//div/h3"
    _toast_message = "//div[@class='Toastify__toast-body']"

    def EnterDeal(self, deal):
        self.sendKeys(deal, self.new_deal_textbox)

    def AddNewDeal(self, deal=''):
        time.sleep(2)
        self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.elementClick(self.click_add_new_deal)
        time.sleep(2)
        deal_name = self.ut.getUniqueName(3)
        self.EnterDeal("ca" + " " + deal_name)
        time.sleep(3)
        self.elementClick(self.select_item_list)
        time.sleep(4)
        #deal_text = self.getElement(self.new_deal_textbox)
        #aa = deal_text.get_attribute('value')
        self.elementClick(self.click_add_button)
        time.sleep(5)
        success_message = self.getText(self._toast_message)
        success_msg = 'Deal successfully added'
        #deal_name_home = self.getText(self.deal_name_main_page)
        self.verifyTextContains(actualText=success_message,
                                expectedText=success_msg)

    # TC -C27810 -- Adding New deal having deals already available
    '''
    
    Steps

    1.Click on + button from bottom left side of the screen
    2.Type any property address having deals already available
    3.Click on any of the suggested properties
    4.Click on Add button
    Expected Result
    
    New deal should get created and should get displayed on deal list screen
        
    '''

    # test_06AddingNewDealHavingDealsAlreadyAvailable

    deal_exist = "//div[@class='add-deal--has-existing']"
    cancel_button = "//button[contains(text(),'Cancel')]"

    def DealAlreadyAvailableText(self):
        time.sleep(2)
        self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.elementClick(self.click_add_new_deal)
        time.sleep(2)
        self.EnterDeal('India')
        time.sleep(3)
        self.elementClick(self.select_item_list)
        time.sleep(2)
        deal_exist_text = self.getText(self.deal_exist)
        deal_text = 'There are already 6 deals at this property. Add anyway?'
        self.verifyTextContains(actualText=deal_exist_text,
                                expectedText=deal_text)
        self.elementClick(self.cancel_button)

    # TC - C27813 -- More filters with Region, Territory, Market, & Landlord fields
    '''
    
     Steps

    1.Click on More filters option
    2.Click on Region field
    3.Select any region from the list
    4.Click on Territory field
    5.Select any territory from the list
    6.Click on Market field
    7.Select any market from the list
    8.Click on Apply button
    Expected Result
    
    Deal list records should get changed according to the user's desirable filters
    
    '''

    # test_07RegionFieldFilter

    more_filter_icon = ".sidebar--header-icon:nth-child(3)"
    region_textfield = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[1]/div/div/div[1]'''
    external_click_close_dropdown = "//p[contains(text(),'Territory')]"
    select_region_list = "//p[contains(text(),'US & Canada East & Israel')]"
    check_after_filter_tag = "//div[contains(text(),'US & Canada East & Israel')]"

    def MoreFilterIcon(self):
        self.elementClick(self.more_filter_icon, locatorType='css')

    # Verify Region Filter
    def RegionFilter(self):
        time.sleep(10)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.region_textfield)
        time.sleep(2)
        self.elementClick(self.select_region_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(3)
        tag_text = self.getText(self.check_after_filter_tag)
        tag_tax_verification = 'US & Canada East & Israel'
        self.verifyTextContains(actualText=tag_text,
                                expectedText=tag_tax_verification)

    # test_08TerritoryFieldFilter

    territory_list = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[2]/div/div/div[1]'''
    select_territory_list = "//p[contains(text(),'South-Central')]"
    apply_button = "//button[contains(text(),'Apply')]"
    check_territory_tag = "//div[contains(text(),'South-Central')]"

    def ClickApplyButton(self):
        self.elementClick(self.apply_button)

    # Verify Territory Filter

    def TerritoryFilter(self):
        time.sleep(5)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.territory_list)
        time.sleep(2)
        self.elementClick(self.select_territory_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(3)
        territory_tag = self.getText(self.check_territory_tag)
        territory_tag_original = 'South-Central'
        self.verifyTextContains(actualText=territory_tag,
                                expectedText=territory_tag_original)

    # test_09MarketFieldFilter

    market_list = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[3]/div/div/div[1]'''
    select_market_list = "//p[contains(text(),'Accra')]"
    check_market_Tag = "//div[contains(text(),'Accra')]"

    # Verify Market Filter

    def MarketFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.market_list)
        time.sleep(3)
        self.elementClick(self.select_market_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(3)
        market_tag = self.getText(self.check_market_Tag)
        market_tag_original = 'Accra'
        self.verifyTextContains(actualText=market_tag,
                                expectedText=market_tag_original)

    # TC - C27814 More filters with Status, Stage, Team member, Release & Product type
    ''''
    Steps
    
    1.Click on More filters option
    2.Click on Status field
    3.Select any status from the list
    4.Click on Stage field
    5.Select any stage from the list
    6.Click on Release field
    7.Select any of the types from the list
    8.Click on Product type field
    9.Select any of the type from the list
    10.Click on Team member field
    11.Select any of the member from the list
    12.Click on Apply button
    Expected Result
    
    Deal list records should get changed according to the user's desirable filters
    
    '''
    # test_10StatusFieldFilter
    # Locators :

    status_field = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[4]/div/div/div[1]'''
    select_status_list = "//p[contains(text(),'Active')]"
    status_after_tag = "//div[contains(text(),'Active')]"

    # Verify status filter

    def StatusFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.status_field)
        time.sleep(2)
        self.elementClick(self.select_status_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(3)
        status_tag = self.getText(self.status_after_tag)
        status_tag_original = 'Active'
        self.verifyTextContains(actualText=status_tag,
                                expectedText=status_tag_original)

    # test_11StageFieldFilter
    # Locators :

    stage_field = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[5]/div/div/div[1]'''
    select_stage_list = "//div[5]/div/div/div[2]/div/div/div/p[contains(text(),'Discovery')]"
    stage_after_tag = "//div[contains(text(),'E (Discovery)')]"

    def ClickStageField(self):
        self.elementClick(self.stage_field)

    # Verify stage filter

    def StageFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.stage_field)
        time.sleep(2)
        self.elementClick(self.select_stage_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        status_tag = self.getText(self.stage_after_tag)
        status_tag_original = 'E (Discovery)'
        self.verifyTextContains(actualText=status_tag,
                                expectedText=status_tag_original)

    # test_12ReleaseFieldFilter
    # Locators :

    release_field = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[7]/div/div/div[1]'''
    select_release_list = "//p[contains(text(),'Awaiting regional approval')]"
    release_after_tag = "//div[contains(text(),'Awaiting regional approval')]"

    def ReleaseFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.release_field)
        time.sleep(2)
        self.elementClick(self.select_release_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        awaiting_tag = self.getText(self.release_after_tag)
        awaiting_tag_original = 'Awaiting regional approval'
        self.verifyTextContains(actualText=awaiting_tag,
                                expectedText=awaiting_tag_original)

    # test_13ProductTypeFieldFilter
    # Verify Product Type Filter
    # Locators :

    product_type_field = '''//*[@id="app"]/div/div[2]/div/div/div[1]/div/div[2]/div[8]/div/div/div[1]'''
    select_product_type_list = "//p[contains(text(),'Club')]"
    product_type_after_tag = "//div[contains(text(),'Club')]"

    def ProductTypeFilter(self):
        time.sleep(2)
        #scr1 = self.getElement(self.product_type_field)
        #self.driver.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", scr1)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.product_type_field)
        time.sleep(2)
        self.elementClick(self.select_product_type_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        awaiting_tag = self.getText(self.product_type_after_tag)
        awaiting_tag_original = 'Club'
        self.verifyTextContains(actualText=awaiting_tag,
                                expectedText=awaiting_tag_original)

    team_member_field = "//div[11]/div/div/div/input"
    select_team_member_list = "//p[contains(text(),'Shazadi Mohammed')]"
    team_member_after_tag = "//div[contains(text(),'Shazadi Mohammed')]"

    def EnterTeamName(self, name='sagar'):
        self.elementClick(self.team_member_field)
        time.sleep(2)
        self.sendKeys(name, self.team_member_field)

    def TeamMemberFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)

        ##### scroll into view #####
        element = self.getElement(self.scroll_possession)
        self.driver.execute_script("arguments[0].scrollIntoView(true);",
                                   element)
        time.sleep(2)
        self.driver.execute_script("window.scrollBy(0, -1000);")
        ##### scroll into view #####

        name = 'Shazadi Mohammed'
        self.EnterTeamName(name)
        time.sleep(2)
        self.elementClick(self.select_team_member_list)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        team_member_tag = self.getText(self.team_member_after_tag)
        self.verifyTextContains(actualText=team_member_tag, expectedText=name)

    #
    desk_input = "//div[12]//input[1]"
    desk_input2 = "//div[12]//input[2]"
    desk_after_tag = "//div[contains(text(),'desks: 100-1000')]"

    def DeskEnterNumber(self, num1=100, num2=1000):
        self.elementClick(self.desk_input)
        time.sleep(2)
        self.sendKeys(num1, self.desk_input)
        time.sleep(2)
        self.elementClick(self.desk_input2)
        time.sleep(2)
        self.sendKeys(num2, self.desk_input2)

    def DeskFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(3)
        # Enter desk number using desk method writtern above. Added default desk value.
        self.DeskEnterNumber()
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        desk_tag = self.getText(self.desk_after_tag)
        desk_original = 'desks: 100-1000'
        self.verifyTextContains(actualText=desk_tag,
                                expectedText=desk_original)

    #
    rsf_input = "//div[13]//input[1]"
    rsf_input2 = "//div[13]//input[2]"
    rsf_after_tag = "//div[contains(text(),'rsf: 100-1000')]"

    def RsfEnterNumber(self, num1=100, num2=1000):
        self.elementClick(self.rsf_input)
        time.sleep(2)
        self.sendKeys(num1, self.rsf_input)
        time.sleep(2)
        self.elementClick(self.rsf_input2)
        time.sleep(2)
        self.sendKeys(num2, self.rsf_input2)

    def RSFFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(3)
        self.RsfEnterNumber()
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        desk_tag = self.getText(self.rsf_after_tag)
        desk_original = 'rsf: 100-1000'
        self.verifyTextContains(actualText=desk_tag,
                                expectedText=desk_original)

    #
    usf_input = "//div[14]//input[1]"
    usf_input2 = "//div[14]//input[2]"
    usf_after_tag = "//div[contains(text(),'usf: 100-1000')]"

    def UsfEnterNumber(self, num1=100, num2=1000):
        self.elementClick(self.usf_input)
        time.sleep(2)
        self.sendKeys(num1, self.usf_input)
        time.sleep(2)
        self.elementClick(self.usf_input2)
        time.sleep(2)
        self.sendKeys(num2, self.usf_input2)

    def USFFilter(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(3)
        self.UsfEnterNumber()
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)
        desk_tag = self.getText(self.usf_after_tag)
        desk_original = 'usf: 100-1000'
        self.verifyTextContains(actualText=desk_tag,
                                expectedText=desk_original)

    # css = .CalendarDay__today
    # id=possessionDate
    # xpath=(//input[@id='possessionDate'])[2]
    # id=(//input[@id='openingDate'])[1]
    # xpath=(//input[@id='openingDate'])[2]

    possession_date = "(//input[@id='possessionDate'])[1]"
    possession_end_date = "(//input[@id='possessionDate'])[2]"
    scroll_possession = "//p[contains(text(),'Possession date')]"
    select_date = ".CalendarDay__today"
    select_end_date = ".CalendarDay__hovered_span"
    possession_date_after_tag = "//div[contains(text(),'possession: ')]"

    def SelectFirstDateFromCalendar(self):
        self.elementClick(self.select_date, locatorType='CSS')

    def SelectLastDateWeekFromCalendar(self):
        self.elementClick(self.select_end_date, locatorType='CSS')

    def PosseDate(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)

        ##### scroll into view #####
        element = self.getElement(self.scroll_possession)
        self.driver.execute_script("arguments[0].scrollIntoView(true);",
                                   element)
        time.sleep(2)
        self.driver.execute_script("window.scrollBy(0, -350);")
        ##### scroll into view #####

        time.sleep(2)
        self.elementClick(self.possession_date)
        time.sleep(2)
        self.SelectFirstDateFromCalendar()
        time.sleep(2)
        self.SelectLastDateWeekFromCalendar()
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)

        ## Split the possession tag
        get_date_text = self.getText(self.possession_date_after_tag)
        get_date_text = get_date_text.split()
        get_date_text = get_date_text[0]
        # Verify result after split
        self.verifyTextContains(actualText=get_date_text,
                                expectedText="possession:")

    opening_date = "(//input[@id='openingDate'])[1]"
    opening_end_date = "(//input[@id='openingDate'])[2]"
    opening_after_tag = "//div[contains(text(),'opening:')]"

    def OpeningDate(self):
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)

        ##### scroll into view #####
        element = self.getElement(self.scroll_possession)
        self.driver.execute_script("arguments[0].scrollIntoView(true);",
                                   element)
        time.sleep(2)
        self.driver.execute_script("window.scrollBy(0, -1000);")
        ##### scroll into view #####

        time.sleep(2)
        self.elementClick(self.opening_date)
        time.sleep(2)
        self.SelectFirstDateFromCalendar()
        time.sleep(2)
        self.SelectLastDateWeekFromCalendar()
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(2)

        ## Split the possession tag
        get_date_text = self.getText(self.opening_after_tag)
        get_date_text = get_date_text.split()
        get_date_text = get_date_text[0]
        # Verify result after split
        self.verifyTextContains(actualText=get_date_text,
                                expectedText="opening:")

    # C27817 Pagination of deallist screen
    '''
          
    User should be logged into the app
    Steps
    
    1.Click on Next button from bottom-left panel of the screen
    2.Click on Previous button from bottom-left panel of the screen
    Expected Result
    
    User should get navigated to Next page & Previous page

    '''

    # pagination

    next_button = "//button[contains(text(),'Next')]"
    previous_button = "//button[contains(text(),'Previous')]"
    reset_button = "//button[contains(text(),'Reset')]"

    def Pagination(self):
        time.sleep(2)
        #self.elementClick(self.click_arrow_img)
        time.sleep(2)
        self.MoreFilterIcon()
        time.sleep(2)
        self.elementClick(self.reset_button)
        time.sleep(2)
        self.elementClick(self.apply_button)
        time.sleep(4)
        ##### scroll into view #####
        element = self.getElement(self.next_button)
        self.driver.execute_script("arguments[0].scrollIntoView(true);",
                                   element)
        time.sleep(2)
        self.driver.execute_script("window.scrollBy(0, -1000);")
        ##### scroll into view #####
        time.sleep(2)
        self.elementClick(self.next_button)
        time.sleep(2)
        ##### scroll into view #####
        element = self.getElement(self.next_button)
        self.driver.execute_script("arguments[0].scrollIntoView(true);",
                                   element)
        time.sleep(2)
        self.driver.execute_script("window.scrollBy(0, -1000);")
        ##### scroll into view #####
        self.elementClick(self.previous_button)
コード例 #6
0
class ExternalCounselPages(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


    # Display External counsel

    '''
    Pre condition :
    
    
    User should be on deal details screen
    
    Note : Save button will be disabled until Firm has been added
    
    
    Steps:
    "External counsel appears below broker"

    1.Scroll to broker section
    2.Look below


    Expected: 
    User should see external counsel section

    
    '''

    contacts = "//a[contains(text(),'Contacts')]"
    text_external_counsel = "//h4[contains(text(),'External counsel')]"

    def ClickContacts(self):
        self.elementClick(self.contacts)

    def UserShouldSeeExternalCounselSection(self):
        self.deal.AddNewDeal()
        time.sleep(2)
        self.ClickContacts()
        time.sleep(2)
        self.elementPresenceCheck(self.text_external_counsel, byType='xpath')



    '''
    
    "External counsel has empty state"

    Add a new deal
    Go to new deal's deal details page
    Look at external counsel section

    Expected:
    Should say "Add external counsel"
    
    '''

    empty_label_text = "//p[contains(text(),'Add external counsel')]"

    def ExternalCounselHasEmptyState(self):
        time.sleep(2)
        self.elementPresenceCheck(self.empty_label_text, byType='xpath')



    '''
    
    "Clicking on external counsel section launches edit modal"

    1.Go to external counsel section
    2.Click section
    
    Expected:
    External counsel modal launches

    '''

    click_add_external_contact = ".contact--add"

    def ClickAddExternalContact(self):
        self.elementClick(self.click_add_external_contact, locatorType='css')

    def ClickingOnExternalCounselSectionLaunchesEditModal(self):
        time.sleep(2)
        self.elementClick(self.text_external_counsel)
        time.sleep(2)
        self.isElementDisplayed(self.click_add_external_contact, locatorType='css')


    '''
    
    "Clicking "+ add external counsel" shows typeahead"

    1.Scroll to external counsel section
    2.Launch external counsel modal
    3.Click on blue text that says "+ Add external counsel"

    
    Expected:
    Typeahead component should appear that has label "Firm name"


    '''

    firm_label = ".contact-search--input-label"


    def ClickingAddExternalCounselShowsTypeahead(self):
        time.sleep(2)
        self.ClickAddExternalContact()
        time.sleep(2)
        self.isElementDisplayed(self.firm_label, locatorType='css')


    # User can search for existing firms

    '''
    
    Preconditions

    User is logged into Dealtrack
    User is on deal details page of deal with no external counsel
    
    Steps

    1.Scroll to external counsel section
    2.Launch external counsel modal
    3.click on blue text that says "+ Add external counsel"
    4.Start typing in typeahead component
    
    Expected Result

    Dropdown should appear and results should populate if there are any
    bottom of dropdown should have blue text that says "+ Create "[text that user is typing in search]""

    
    '''

    add_new_firm_textbox = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/div/input"
    click_existing_firm = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/div/div/div/div"

    def AddNewFirm(self, frimname):
        time.sleep(2)
        self.elementClick(self.add_new_firm_textbox)
        time.sleep(2)
        self.sendKeys(frimname, self.add_new_firm_textbox)

    def UserCanSearchForExistingFirms(self):
        time.sleep(2)
        firmname = 'law'
        self.AddNewFirm(firmname)
        time.sleep(2)
        self.elementClick(self.click_existing_firm)


    # user can search for existing lawyer at firm or add new lawyer

    '''
    
    Preconditions

    User is logged into Dealtrack
    User is on deal details page of deal with no external counsel
    
    Steps:
    
    1.Scroll to external counsel section
    2.Launch external counsel modal
    3.click on blue text that says "+ Add external counsel"
    4.Type [some new value] into typeahead component
    5.Select existing firm
    6.In new card, click "add lawyer"
    
     Expected Result

    Typeahead should pre-populate with lawyers that exist at the firm already



    '''

    lawyer_textbox = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/div[3]/div/div/input"


    def EnterLawyer(self, landlord):
        self.elementClick(self.lawyer_textbox)
        time.sleep(2)
        self.sendKeys(landlord, self.lawyer_textbox)

    def RandomLawyerName(self):
        landname = 'landlord'
        name = self.ut.getUniqueName(4)
        name = landname + name
        self.EnterLawyer(name)

    verify_entered_lawyer = "//div[@id='app']/div/div[2]/div/div/div/div/div/div/div/div/div/div[2]/div/strong"

    def UserCanSearchForExistingLawyerAtFirmOrAddNewLawyer(self):
        time.sleep(2)
        self.ClickAddExternalContact()
        self.RandomLawyerName()
        time.sleep(2)
        self.broker.ClickCreateNew()
        time.sleep(2)
        self.elementPresenceCheck(self.verify_entered_lawyer, byType='xpath')

    # There can be multiple lawyers assigned to a deal

    '''
    
    Preconditions

    User is logged into Dealtrack
    User is on deal details page of deal with pre-existing external counsel firm and lawyers
    
     Steps

    1.Click on external counsel section to launch modal
    2.In modal, click "add lawyer" underneath current lawyers
    
     Expected Result

    User should be able to add as many lawyers as they want. They are displayed on the deal details page side by side in card view


    '''

    def ThereCanBeMultipleLawyersAssignedToADeal(self):
        time.sleep(2)
        for i in range(1, 4):
            self.ClickAddExternalContact()
            time.sleep(2)
            self.RandomLawyerName()
            time.sleep(2)
            self.broker.ClickCreateNew()
            time.sleep(2)
        self.elementClick(self.landlord.save_button)


    # Test 1. User is on deal details page of deal with external counsel that has firm and lawyers

    '''

    Preconditions

    User is logged into Dealtrack

       Test 1. User is on deal details page of deal with external counsel that has firm and lawyers

       Steps:
       Look at external counsel section

       Expected Result:

       Section should say "External counsel"
       Test 1 & 2: Firm should be displayed in bold text w/ icon

   '''

    lawyer_check = ".gvEbHU:nth-child(1)"

    def ExternalCounselThatHasFirmAndLawyers(self):
        time.sleep(2)
        self.elementPresenceCheck(self.counsel_icon, byType='xpath')
        self.isElementPresent(self.lawyer_check, locatorType='css')


    # Functionality behind removing Firm name and lawyers

    '''
    
     Preconditions

    User is logged into Dealtrack
    User is on deal details page of deal with pre-existing external counsel firm and one lawyer

    "User can remove lawyer by clicking 'x'"

    1.Launch external counsel modal
    2.On list of lawyers, click x next to lawyers name
    
    Expected:
    lawyer should be removed from the list
    their should be no lawyers left
    user should be able to save

    
    '''

    close_icon = "//div[@class='lawyer--search']//div[1]//img[2]"

    def UserCanRemoveLawyerByClickingX(self):
        time.sleep(2)
        self.elementClick(self.text_external_counsel)
        time.sleep(2)
        for i in range(1, 5):
            time.sleep(1)
            a = "//div[@class='lawyer--search']//div"
            x = [i]
            c = "//img[2]"
            icon = a + str(x) + c
            time.sleep(2)
            self.elementClick(icon)
        time.sleep(2)
        self.elementClick(self.landlord.save_button)


    # External counsel section shows firm.


    # Test 2. User is on deal details page of deal with external counsel that only has firm

    '''
    Steps:
    Look at external counsel section
    
    Expected:
    Test 2: lawyers should each have a card with full name
    
    '''

    counsel_icon = "//img[@class='counsel--icon']"

    def ExternalCounselShowsOnlyLawyers(self):
        time.sleep(2)
        self.elementPresenceCheck(self.counsel_icon, byType='xpath')


    # "When user clicks 'x' next to firm, it clears firm name and lawyers"

    '''
    
    "When user clicks 'x' next to firm, it clears firm name and lawyers"

    1.Launch external counsel modal
    2.Click x next to firm name
    
    Expected:
    user should see "+ add external counsel" button
    save button should be disabled

    
    '''

    firm_close_icon = ".firm--ex-icon"

    def WhenUserRemoveFirmUsingCrossIcon(self):
        time.sleep(2)
        self.elementClick(self.text_external_counsel)
        time.sleep(2)
        self.elementClick(self.firm_close_icon, locatorType='css')
        time.sleep(4)
        self.elementPresenceCheck(self.add_new_firm_textbox)
コード例 #7
0
class ScreenshotPage(SeleniumDriver):
    def __init__(self, driver):
        super().__init__(driver)
        self.driver = driver

    # Locators
    _click_project = "//p[contains(text(),'12 Calle de Prim - P1')]"
    _add_more_product = "//span[contains(text(),'Add more products')]"
    _first_cell = '''//*[@id="root"]/div/div[3]/div/div/div[2]/div[2]/div/div/div[3]/div[1]/div'''
    _add_assignment = "//div[@id='root']/div/div[3]/div/div/div[3]/div[2]/div[2]/div[2]//a[contains(., 'Assign')]"
    _assign_new_room = "//div[contains(text(),'Assign to new rooms')]"
    _remove_product = "remove product from project"
    _cancel_button_modal_box = "//div[@id='root']/div[3]/div/div/div[3]/div/button/span[contains(text(),'Cancel')]"
    _close_button = "//div//button[@title = 'Close Dialog']"
    _all_rooms = "//span[contains(text(),'All rooms')]"
    _assign_new_product_click = "//div[contains(text(),'Assign new products')]"

    def Home(self):
        time.sleep(15)
        self.ut = Util()
        name = self.ut.getUniqueName(10)
        self.log.info(name)
        self.fullpage_screenshot(name + 'home.png')
        time.sleep(5)
        self.webScroll(direction='up')
        self.webScroll(direction='up')

    def ProjectDetailScreen(self):
        time.sleep(2)
        self.waitForElement(self._click_project)
        self.elementClick(self._click_project)
        time.sleep(5)
        self.fullpage_screenshot('ProjectDetailScreen.png')
        time.sleep(4)
        self.webScroll(direction='up')

    def AssignmentScreen(self):
        time.sleep(2)
        self.elementClick(self._add_assignment)
        time.sleep(2)
        self.screenShot('AssignmentScreen.png')
        time.sleep(2)

    def AssignmentScreenNewRoom(self):
        self.elementClick(self._assign_new_room)
        self.screenShot('AssignmentnewroomScreen.png')
        time.sleep(2)

    def AssignmentScreenRemoveProduct(self):
        self.elementClick(self._remove_product, locatorType='link')
        time.sleep(2)
        self.screenShot('Removeproductpopup.png')
        time.sleep(2)
        self.elementClick(self._cancel_button_modal_box)
        time.sleep(2)
        self.elementClick(self._close_button)

    def ViewByRoomScreen(self):
        time.sleep(2)
        self.elementClick(self._all_rooms)
        self.screenShot('ViewRoom')

    def ViewByRoomEditScreenPopUP(self):
        time.sleep(2)
        self.elementClick(self._add_assignment)
        time.sleep(2)
        self.screenShot('ViewbytypeEditScreen')
        time.sleep(2)

    def ViewByRoomAssignNewProductScreen(self):
        self.elementClick(self._assign_new_product_click)
        time.sleep(2)
        self.screenShot('ViewbytypeNewProductScreen')
        time.sleep(2)
        self.elementClick(self._close_button)

    def CatalogScreen(self):
        time.sleep(5)
        self.elementClick(self._add_more_product)
        time.sleep(2)
        self.fullpage_screenshot('Catalog.png')
        time.sleep(2)
        self.webScroll(direction='up')
        self.webScroll(direction='up')
        time.sleep(2)

    def CatalogDetailScreen(self):
        self.elementClick(self._first_cell)
        time.sleep(2)
        self.fullpage_screenshot('CatalogDetailScreen.png')
        time.sleep(4)
コード例 #8
0
from silasdk import EthWallet
from silasdk.client import App
from utilities.util import Util

# Calling utility class
utility = Util()
"""
Using getUniqueName function to generate unique user_handle name.
Parameters:
        user_handle: name
            
"""
name = utility.getUniqueName(8)
user_handle = "test" + name + ".silamoney.eth"

#  Use app_handle and app_private key which we get at the time of creating the app from https://console.silamoney.com/
app_handle = 'sdap'
app_private_key = 'c2bef64adfcba8004195cdf39fceccafcb169101c3d5d7dc89140c9855c9e0e9'

app = App("SANDBOX", app_private_key, app_handle)

# check_handle_status_401 : taking hardcoded value to verify that the status 401.
check_handle_status_401 = "saty.silamoney.eth"

# It will be used at the time of silatransfer api.
business_uuid = "9f280665-629f-45bf-a694-133c86bffd5e"

# Generate etherium key and eth private address
eth = EthWallet.create()
eth_address = eth["eth_address"]
eth_private_key = eth["eth_private_key"]