Example #1
0
def test_case_1(browser):

    page = Page(browser)

    # Navigate to the URL https://www.sogeti.com/
    page.load()

    # Hover over Services Link
    page.hover('//*[@id="header"]/div[1]/nav/ul/li[3]/div')

    #  and then Click Automation link.
    page.click('//*[@id="header"]/div[1]/div[5]/ul/li[7]/a')

    # Verify that Automation Screen is displayed
    assert 'Automation' in page.title()

    # and “Automation” text is visible in Page
    assert 'Automation' in page.get_attribute_of_element(
        '//*[@id="primary_content"]/div/div[2]/div/h1/span', 'textContent')

    # Hover again over Services Link
    page.hover('//*[@id="header"]/div[1]/nav/ul/li[3]/div')

    # Verify that the Services and Automation are selected
    assert 'selected' in page.get_attribute_of_element(
        '//*[@id="header"]/div[1]/div[5]/ul/li[7]', 'class')
Example #2
0
def test_case_3(browser):
    page = Page(browser)

    #  Navigate to the URL https://www.sogeti.com/
    page.load()

    #  Click the Worldwide Dropdown link in Page Header.
    page.click('//*[@id="header"]/div[1]/div[2]/div[2]/div[2]')

    #  A Country dropdown list is displayed.
    assert True == page.is_displayed('//*[@id="header"]/div[3]')

    #  Assert that all the Country specific Sogeti links are working.
    for link in page.get_links('//*[@id="header"]/div[3]'):
        assert 200 == requests.head(link.get_attribute('href')).status_code
Example #3
0
def test_case_1(browser):
    page = Page(browser)
    #  Navigate to the URL https://www.sogeti.com/
    page.load()
    #  Hover over Services Link
    page.hover('//*[@id="header"]/div[1]/nav/ul/li[3]/div')

    #  and then Click Automation link.
    page.click('//*[@id="header"]/div[1]/div[5]/ul/li[7]/a')

    #  On Automation Page, scroll down to the Contact us Form.
    page.scroll_into_view('//*[@id="99a12a58-3899-4fe1-a5c7-b9065fe635b0"]')

    #  Fill the First Name with Random Generated Data.
    page.input_to('//*[@id="4ff2ed4d-4861-4914-86eb-87dfa65876d8"]', 'test')

    #  Fill the Last Name with Random Generated Data
    page.input_to('//*[@id="11ce8b49-5298-491a-aebe-d0900d6f49a7"]', 'test')

    #  Fill the Email with Random Generated Data
    page.input_to('//*[@id="056d8435-4d06-44f3-896a-d7b0bf4d37b2"]',
                  '*****@*****.**')

    #  Fill the Phone with Random Generated Data
    page.input_to('//*[@id="755aa064-7be2-432b-b8a2-805b5f4f9384"]', 'test')

    #  Fill the Message with Random Generated Data
    page.input_to('//*[@id="88459d00-b812-459a-99e4-5dc6eff2aa19"]', 'test')

    #  Check the I agree checkbox.
    page.click('//*[@id="863a18ee-d748-4591-bb64-ef6eae65910e"]/label/input')

    #  Then Click SUBMIT button.
    page.click('//*[@id="06838eea-8980-4305-83d0-42236fb4d528"]')

    #  After clicking SUBMIT button the form is submitted and Thank you message is displayed. Assert the Thank you message
    assert 'Thank you for contacting us.' in page.get_attribute_of_element(
        '//*[@id="99a12a58-3899-4fe1-a5c7-b9065fe635b0"]/div[1]/div/p',
        'textContent')
Example #4
0
from browser import Browser
from page import Page
from locators import Locators

browser = Browser().create_browser(browser='chrome')
locator = Locators()

page = Page(browser)

page.go_url(
    'http://bvmf.bmfbovespa.com.br/cias-listadas/empresas-listadas/BuscaEmpresaListada.aspx?idioma=pt-br'
)

page.click(*locator.LETTER)
page.click(*locator.TRBODY)
page.click(*locator.REPORTS)

# page.sleep(50)