Пример #1
0
    def test_docs_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_docs_page()
        docs_page = page.DocsPage(self.driver)
        assert docs_page.is_page_valid()

        docs_page.wait_for_page_loaded()
        side_menu_btns = docs_page.get_main_items_in_side_menu()
        number_of_btns = len(side_menu_btns)
        for i in range(number_of_btns):
            # print(side_menu_btns[i].get_attribute('href'))
            linkL1 = side_menu_btns[i].text
            side_menu_btns[i].click()
            self.driver.implicitly_wait(5)
            assert docs_page.is_page_valid()

            active_side_links = docs_page.get_links_in_active_side_item()
            if not active_side_links:
                docs_page.iterate_links_doc_content()
                side_menu_btns = docs_page.get_main_items_in_side_menu()
                continue
            number_of_active_links = len(active_side_links)
            for j in range(number_of_active_links):
                # print(active_side_links[j].get_attribute('href'))
                linkL2 = active_side_links[j].text
                active_side_links[j].click()
                self.driver.implicitly_wait(5)
                cur_page = page.BasePage(self.driver)
                assert cur_page.is_page_valid()

                docs_page.iterate_links_doc_content(linkL1, linkL2)
                # get the side links again
                active_side_links = docs_page.get_links_in_active_side_item()

            side_menu_btns = docs_page.get_main_items_in_side_menu()
Пример #2
0
    def test_blog_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_blog_page()
        blog_page = page.BlogPage(self.driver)
        assert blog_page.is_page_valid()

        blog_page.wait_for_page_loaded()
        while True:
            # iterate links
            links = blog_page.get_links_in_container_blog()
            number_of_links = len(links)
            for i in range(number_of_links):
                # print(links[i].get_attribute('href'))
                print('Blog Page: {}'.format(links[i].text))
                if links[i].text == 'Older' or links[
                        i].text == 'Newer' or links[i].get_attribute(
                            'href') == 'https://slateci.io/feed.xml':
                    continue
                links[i].click()
                self.driver.implicitly_wait(5)
                cur_page = page.BasePage(self.driver)
                assert cur_page.is_page_valid()
                self.driver.back()
                blog_page.wait_for_page_loaded()
                links = blog_page.get_links_in_container_blog()

            # click Order button
            older_btn = blog_page.get_older_btn()
            if not older_btn:
                break
            older_btn.click()
            blog_page.wait_for_page_loaded()
Пример #3
0
 def segue_to_page(self, driver, page_name):
     start_page = page.BasePage(driver)
     assert start_page.is_page_valid()
     cur_page = None
     if page_name == 'clusters':
         start_page.go_to_clusters_page()
         cur_page = page.ClustersPage(driver)
     elif page_name == 'applications':
         start_page.go_to_apps_page()
         cur_page = page.AppsPage(driver)
     elif page_name == 'secrets':
         start_page.go_to_secrets_page()
         cur_page = page.SecretsPage(driver)
     elif page_name == 'instances':
         start_page.go_to_instances_page()
         cur_page = page.InstancesPage(driver)
     elif page_name == 'my_groups':
         start_page.go_to_my_groups_page()
         cur_page = page.MyGroupsPage(driver)
     elif page_name == 'all_groups':
         start_page.go_to_all_groups_page()
         cur_page = page.GroupsPage(driver)
     elif page_name == 'cli_access':
         start_page.go_to_cli_access_page()
         cur_page = page.CLIAccessPage(driver)
     assert cur_page.is_page_valid()
     return cur_page
Пример #4
0
    def test_home_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_home_page()
        home_page = page.HomePage(self.driver)
        assert home_page.is_page_valid()

        home_page.wait_for_page_loaded()
        links_in_try_slate = home_page.get_links_in_try_slate()
        number_of_links = len(links_in_try_slate)
        for i in range(number_of_links):
            print('Home Page: Try SLATE -> {}'.format(
                links_in_try_slate[i].text))
            links_in_try_slate[i].click()
            self.driver.implicitly_wait(5)
            cur_page = page.BasePage(self.driver)
            assert cur_page.is_page_valid()
            self.driver.back()
            home_page.wait_for_page_loaded()
            links_in_try_slate = home_page.get_links_in_try_slate()
Пример #5
0
    def test_tech_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_tech_page()
        tech_page = page.TechPage(self.driver)
        assert tech_page.is_page_valid()

        tech_page.wait_for_page_loaded()
        links = tech_page.get_all_links()
        number_of_links = len(links)
        for i in range(number_of_links):
            # print(links[i].get_attribute('href'))
            print('Tech Page: {}'.format(links[i].text))
            links[i].click()
            self.driver.implicitly_wait(5)
            cur_page = page.BasePage(self.driver)
            assert cur_page.is_page_valid()
            self.driver.back()
            # reload the page and get links
            tech_page.wait_for_page_loaded()
            links = tech_page.get_all_links()
Пример #6
0
    def test_comm_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_comm_page()
        comm_page = page.CommPage(self.driver)
        assert comm_page.is_page_valid()

        comm_page.wait_for_page_loaded()
        links = comm_page.get_links_in_container_community()
        number_of_links = len(links)
        for i in range(number_of_links):
            if 'mailto:' in links[i].get_attribute('href'):
                continue
            print('Community Page: {}'.format(links[i].text))
            links[i].click()
            self.driver.implicitly_wait(5)
            cur_page = page.BasePage(self.driver)
            assert cur_page.is_page_valid()
            self.driver.back()
            comm_page.wait_for_page_loaded()
            links = comm_page.get_links_in_container_community()
Пример #7
0
    def test_about_page(self):
        main_page = page.BasePage(self.driver)
        main_page.go_to_about_page()
        about_page = page.AboutPage(self.driver)
        assert about_page.is_page_valid()

        about_page.wait_for_page_loaded()
        links = about_page.get_all_links()
        number_of_links = len(links)
        for i in range(number_of_links):
            print(links[i].get_attribute('href'))

            links[i].click()
            self.driver.implicitly_wait(5)
            cur_page = page.BasePage(self.driver)
            assert cur_page.is_page_valid()

            print(cur_page.get_page_title())

            if cur_page.get_page_title() == 'SLATE / About':
                continue
            self.driver.back()
            about_page.wait_for_page_loaded()
            links = about_page.get_all_links()
Пример #8
0
    def in_progress_test_edit_cluster_in_group(self):
        helpers = Helpers()
        group_name = 'my-group'
        cluster_name = 'my-cluster'
        my_groups_page = helpers.segue_to_page(self.driver, 'my_groups')
        my_groups_page.wait_until_groups_table_loaded()
        # enter the group page
        group_link = my_groups_page.get_group_link(group_name)
        group_link.click()
        group_profile_page = page.GroupProfilePage(self.driver)
        assert group_profile_page.is_page_valid()
        group_profile_page.wait_until_page_loaded()
        # enter the cluster page
        cluster_link = group_profile_page.get_cluster_link(cluster_name)
        cluster_link.click()

        cluster_profile_page = page.ClusterProfilePage(self.driver)
        assert cluster_profile_page.is_page_valid()
        cluster_profile_page.wait_until_page_loaded()

        # test edit button
        edit_info_btn = cluster_profile_page.get_edit_info_btn()
        edit_info_btn.click()

        cluster_edit_page = page.ClusterEditPage(self.driver)
        assert cluster_edit_page.is_page_valid()
        cluster_edit_page.wait_until_page_loaded()

        cluster_edit_page.set_org_field('SLATE1')
        # cluster_edit_page.set_latitude_field('0.05')
        # cluster_edit_page.set_longitude_field('0.06')
        cluster_edit_page.get_latitude_field().clear()
        cluster_edit_page.get_longitude_field().clear()

        cluster_edit_page.get_update_btn().click()

        nextPage = page.BasePage(self.driver)
        assert nextPage.is_page_valid()