def setUp(self):
     super(TestCase, self).setUp()
     productPageURL = TT_Constants['Base_URL']+"store/p1/Leatherback_Turtle_Picture.html"
     self.navigate_to_page(productPageURL)
     common_obj = Common(self.driver)
     common_obj.wait_for_element_visibility(10, 
                                            "id", 
                                            "wsite-com-product-option-Quantity"
     )
     mainWindowHandle  = self.driver.window_handles
     common_obj.click(10, "xpath", "//a[@title='Share on Facebook']")
     allWindowsHandles = self.driver.window_handles
     for handle in allWindowsHandles:
       if handle != mainWindowHandle[0]:
         common_obj.switch_to_window(handle)
         break
     common_obj.wait_for_element_visibility(10, 
                                            "id", 
                                            "email"
     )
     common_obj.fill_out_field("id",
                               "email", 
                               TT_Constants['Facebook_Username']
     )
     common_obj.fill_out_field("id", 
                               "pass", 
                               TT_Constants['Facebook_Password']
     )
     common_obj.click(10, "name", "login")
     common_obj.wait_for_element_visibility(10, 
                                            "name", 
                                            "share"
     )
Exemplo n.º 2
0
    def test_SearchProductTest(self):
        common_obj = Common(self.driver)
        # Wait for the "search" field to display. We are locating the search field by name.
        common_obj.wait_for_element_visibility(10, 
                                               "name",
                                               "q"
        )
        # Enter the word "leatherback" into the search field
        common_obj.fill_out_field("name",
                                  "q",
                                  "leatherback"
        )
        # Submit the search by clicking the "search submit" button. We are locating the search field by class using Css Selector.
        common_obj.click(10, "cssSelector", "span.wsite-search-button")
        
        # Verify that the turtle picture is displayed. We are locating the picture item by class using Css Selector
        common_obj.wait_for_element_visibility(10, 
                                               "cssSelector",
                                               "div.wsite-search-product-image-container"
        )

        """
        Just using time.sleep() so that you see the last webdriver action.
        I do not recommend using this in your tests.
        """
        time.sleep(5)
Exemplo n.º 3
0
 def setUp(self):
     super(TestCase, self).setUp()
     productPageURL = TT_Constants[
         'Base_URL'] + "store/p1/Leatherback_Turtle_Picture.html"
     self.navigate_to_page(productPageURL)
     common_obj = Common(self.driver)
     # Wait for the "Quantity" drop-down to display
     common_obj.wait_for_element_visibility(
         10, "id", "wsite-com-product-option-Quantity")
     # Click the "Twitter" share link and switch to the "Twitter" login page
     mainWindowHandle = self.driver.window_handles
     common_obj.click(10, "xpath", "//a[@title='Share on Twitter']")
     allWindowsHandles = self.driver.window_handles
     for handle in allWindowsHandles:
         if handle != mainWindowHandle[0]:
             common_obj.switch_to_window(handle)
             break
     #Verify that the Twitter username/email field is displayed
     common_obj.wait_for_element_visibility(10, "id", "username_or_email")
     # Enter Twitter credentials and click the "Sign In and Tweet" button
     common_obj.fill_out_field("id", "username_or_email",
                               TT_Constants['Twitter_Username'])
     common_obj.fill_out_field("id", "password",
                               TT_Constants['Twitter_Password'])
     common_obj.click(10, "xpath", "//input[@value='Sign in and Tweet']")
     # Wait for the "Tweet" button to display. We locate the "Tweet" button by value using Css Selector
     common_obj.wait_for_element_visibility(10, "cssSelector",
                                            "input[value=Tweet]")
Exemplo n.º 4
0
 def test_SendRequestTest(self):
     common_obj = Common(self.driver)
     common_obj.wait_for_element_visibility(10, "name", "q")
     common_obj.fill_out_field("id", "//input[@id='first']", "Leatherback")
     common_obj.click(10, "xpath", "//span[@class='wsite-search-button']")
     common_obj.wait_for_element_visibility(
         10, "cssSelector", "div[title='Leatherback Turtle Picture']")
     """
     Just using time.sleep() so that you see the last webdriver action.
     I do not recommend using this in your tests.
     """
     time.sleep(5)
    def test_SendRequestTest(self):
        common_obj = Common(self.driver)
        common_obj.wait_for_element_visibility(10, 
                                               "xpath", 
                                               "//input[contains(@name, 'first')]"
        )
        common_obj.fill_out_field("xpath", 
                                  "//input[contains(@name, 'first')]", 
                                  "Paul"
        )
        common_obj.fill_out_field("xpath", 
                                  "//input[contains(@name, 'last')]", 
                                  "Pierce"
        )
        common_obj.fill_out_field("xpath", 
                                  "(//input[contains(@id, 'input')])[3]", 
                                  "*****@*****.**"
        )
        common_obj.fill_out_field("xpath", "//textarea", "My comment")
        common_obj.click(10, "xpath", "//span[.='Submit']")
        common_obj.wait_for_element_visibility(10, 
                                               "xpath", 
                                               "//div[contains(text(), 'Thank you')]"
        )

        """
        Just using time.sleep() so that you see the last webdriver action.
        I do not recommend using this in your tests.
        """
        time.sleep(5)
    def test_SendRequestTest(self):
        common_obj = Common(self.driver)
        common_obj.wait_for_element_visibility(10, 
                                               "name", 
                                               "q"
        )
        common_obj.fill_out_field("name", 
                                  "q", 
                                  "Leatherback"
        )
        
        common_obj.click(10, "cssSelector", "span.wsite-search-button")
        common_obj.wait_for_element_visibility(10, 
                                               "xpath", 
                                               "//span[@title='Leatherback Turtle Picture']"
        )

        """
        Just using time.sleep() so that you see the last webdriver action.
        I do not recommend using this in your tests.
        """
        time.sleep(5)
Exemplo n.º 7
0
 def setUp(self):
     super(TestCase, self).setUp()
     productPageURL = TT_Constants[
         'Base_URL'] + "store/p1/Leatherback_Turtle_Picture.html"
     self.navigate_to_page(productPageURL)
     common_obj = Common(self.driver)
     common_obj.wait_for_element_visibility(
         10, "id", "wsite-com-product-option-Quantity")
     mainWindowHandle = self.driver.window_handles
     common_obj.click(10, "xpath", "//a[@title='Share on Facebook']")
     allWindowsHandles = self.driver.window_handles
     for handle in allWindowsHandles:
         if handle != mainWindowHandle[0]:
             common_obj.switch_to_window(handle)
             break
     common_obj.wait_for_element_visibility(10, "id", "email")
     common_obj.fill_out_field("id", "email",
                               TT_Constants['Facebook_Username'])
     common_obj.fill_out_field("id", "pass",
                               TT_Constants['Facebook_Password'])
     common_obj.click(10, "name", "login")
     common_obj.wait_for_element_visibility(10, "name", "share")
Exemplo n.º 8
0
 def test_SendRequestTest(self):
     common_obj = Common(self.driver)
     common_obj.wait_for_element_visibility(
         10, "xpath", "//input[contains(@name, 'first')]")
     common_obj.fill_out_field("xpath", "//input[contains(@name, 'first')]",
                               "Paul")
     common_obj.fill_out_field("xpath", "//input[contains(@name, 'last')]",
                               "Pierce")
     common_obj.fill_out_field("xpath",
                               "(//input[contains(@id, 'input')])[3]",
                               "*****@*****.**")
     common_obj.fill_out_field("xpath", "//textarea", "My comment")
     common_obj.click(10, "xpath", "//span[.='Submit']")
     common_obj.wait_for_element_visibility(
         10, "xpath", "//div[contains(text(), 'Thank you')]")
     """
     Just using time.sleep() so that you see the last webdriver action.
     I do not recommend using this in your tests.
     """
     time.sleep(5)