def test_3_contact_form(self): driver = self.driver driver.get("https://*****:*****@staging.caktusgroup.com") # Use the POM class to navigate to contact page navigation = TopNav(driver) navigation.nav_to_contact() # Use the POM class to enter text in the contact form form = ContactForm(driver) form.first_name("MRtest") form.last_name("LastName") form.email("*****@*****.**")
def test_2_count_blog_cards(self): driver = self.driver driver.get("https://*****:*****@staging.caktusgroup.com") # use the page object to nav to blog page instead of find element here navigation = TopNav(driver) navigation.nav_to_blog() # click view more posts and wait(sleep) driver.find_element_by_id("next").click() sleep(3) # count the number of cards posts_count = driver.find_elements_by_class_name( "card-common--image_container") # veify the number of posts that display assert (len(posts_count) == 12)
def test_count_blog_cards(self): # Verify that clicking view more on the blog page loads 6 more posts for a total of 12 TopNav(self.driver).blog() # click view more posts and wait(sleep) Blog(self.driver).load_more() sleep(2) # count the number of cards posts_count = self.driver.find_elements( *BlogLocators.blog_cards_images) # verify the number of posts that display assert (len(posts_count) == 12)
def test_contact_form(self): # Use the POM class to navigate to contact page TopNav(self.driver).contact() # Use the POM class to enter text in the contact form ContactForm(self.driver).first_name("test") ContactForm(self.driver).last_name("LastName") ContactForm(self.driver).email("*****@*****.**") ContactForm(self.driver).submit() # verify that an error is displayed for the required field that was not entered element = WebDriverWait( self.driver, 10).until(lambda x: x.find_element(*ContactLocators.hubspot_error)) assert element.is_displayed()
def test_technical_topic(self): # Verify that the topics on the first 3 cards include 'Technical' TopNav(self.driver).blog() Blog(self.driver).technical_filter() self.assertIn( "Technical", self.driver.find_element(*BlogLocators.first_card_topics).text) self.assertIn( "Technical", self.driver.find_element(*BlogLocators.second_card_topics).text) self.assertIn( "Technical", self.driver.find_element(*BlogLocators.third_card_topics).text)
def test_hero_button_loads_services_page(self): # Verify that the button in the hero image loads the services page TopNav(self.driver).logo() Homepage(self.driver).hero_image_button() assert self.driver.title == PageTitles.services
def test_view_more_events(self): # Verify that clicking the view more events button loads the events page TopNav(self.driver).blog() Blog(self.driver).more_events_button() assert self.driver.title == PageTitles.events
def test_servicedetail_contact_button(self): # Verify that the contact button on services page opens the contact page TopNav(self.driver).services() Services(self.driver).first_card() ServiceDetail(self.driver).contact_button() assert self.driver.title == PageTitles.contact
def test_team_bio_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).colin_bio() assert self.driver.title == PageTitles.colin
def test_view_services_button(self): # Verify that the services button takes the user to the services page TopNav(self.driver).logo() Homepage(self.driver).view_services_button() assert self.driver.title == PageTitles.services
def test_read_our_case_studies_button(self): # Verify that the read our case studies button takes user to correct page TopNav(self.driver).logo() Homepage(self.driver).read_our_case_studies() assert self.driver.title == PageTitles.casestudies
def test_pyladies_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).pyladies() TestUtils(self.driver).switch_new_tab() assert self.driver.title == PageTitles.pyladies
def test_django_girls_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).django_girls() TestUtils(self.driver).switch_new_tab() assert self.driver.title == PageTitles.django_girls
def test_code_durham_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).code_durham() TestUtils(self.driver).switch_new_tab() assert self.driver.title == PageTitles.code_for_durham, print( self.driver.title)
def test_girl_dev_it_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).girl_dev_it() TestUtils(self.driver).switch_new_tab() assert self.driver.title == PageTitles.girl_dev_it
def test_women_in_tech_link(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).women_in_tech() TestUtils(self.driver).switch_new_tab() print(self.driver.title) assert self.driver.title == PageTitles.durham_women_in_tech
def test_our_contributions_button(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).browse_contributions_button() TestUtils(self.driver).switch_new_tab() assert self.driver.current_url == PageTitles.github_url
def test_were_hiring_button(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).were_hiring_button() assert self.driver.title == PageTitles.careers
def test_success_model_link(self): TopNav(self.driver).logo() Homepage(self.driver).why_caktus_success_model() assert self.driver.title == PageTitles.success_model_blog
def test(self): TopNav(self.driver).careers() assert self.driver.title == PageTitles.careers
def test_homepage_service_card_6(self): TopNav(self.driver).logo() Homepage(self.driver).service_card_6() assert self.driver.title == PageTitles.service_card_6
def test_servicedetail_see_more(self): # Verify the see more breadcrumb on service detail page opens services page TopNav(self.driver).services() Services(self.driver).first_card() ServiceDetail(self.driver).see_more() assert self.driver.title == PageTitles.services
def test_featured_casestudy_card(self): # Verify the featured case study on the homepage takes the user to the correct page TopNav(self.driver).logo() Homepage(self.driver).featured_case_study() assert self.driver.title == PageTitles.featured_casestudy
def test_blog_page_title(self): # Navigates to the blog with the top navigation and verifies the title includes the word Blog TopNav(self.driver).blog() # verify that Blog is in the title of the blog page assert self.driver.title == PageTitles.blog
def test_resource_blog_card_title(self): # Verify that the blog link in resource card takes user to blog page TopNav(self.driver).logo() Homepage(self.driver).resources_blog_card_title() assert self.driver.title == PageTitles.blog
def test_(self): # Verify that the Our Work option in the top nav loads the /casestudies page TopNav(self.driver).our_work() assert self.driver.title == PageTitles.casestudies
def test_services_sixth_card(self): TopNav(self.driver).services() Services(self.driver).sixth_card() assert self.driver.title == PageTitles.service_card_6
def test_view_more_press(self): TopNav(self.driver).about_us_nav() AboutUs(self.driver).view_more_press_button() assert self.driver.title == PageTitles.press