def setup_suite(self):
     utilities.wait(5)
     # Navigate to search page
     # Select repo and search for the assembly
     # Add metadata and publish the assembly using api endpoints and wait for the unpublish button to display
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     utilities.page_reload(self.driver)
     # search_page.search_for_module_and_click(self.driver, constants.published_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(
         self.driver, constants.assembly_new_draft_version)
     display_module_page.add_metadata_and_publish(self.driver)
     utilities.wait_for_element(self.driver, By.ID,
                                locators.MODULE_DISPLAY_UNPUBLISH_BUTTON_ID)
     # Navigate to search page
     # Select repo and search for the module
     # Add metadata and publish the module using api endpoints and wait for the unpublish button to display
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     # search_page.search_for_module_and_click(self.driver, constants.published_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(
         self.driver, constants.module_new_draft_version)
     display_module_page.add_metadata_and_publish(self.driver)
     utilities.wait_for_element(self.driver, By.ID,
                                locators.MODULE_DISPLAY_UNPUBLISH_BUTTON_ID)
 def no_repo_selected(self):
     utilities.wait(2)
     utilities.click_element(self.driver, By.LINK_TEXT,
                             locators.MENU_SEARCH_PAGE_LINK_TEXT)
     utilities.page_reload(self.driver)
     utilities.wait(1)
     # clicking on filter funnel icon twice to close and re-open the filter by repo pannel
     utilities.click_element(self.driver, By.ID, locators.TOGGLE_ID)
     utilities.wait(1)
     utilities.click_element(self.driver, By.ID, locators.TOGGLE_ID)
     utilities.wait(1)
     check_that(
         "Filter by repo section is displayed",
         utilities.find_element(
             self.driver, By.CLASS_NAME,
             locators.FILTER_BY_REPO_SECTION_CLASS_NAME).is_displayed(),
         is_true())
     check_that(
         "No results found warning message",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.NO_MODULE_RESULTS_FOUND_CSS),
         contains_string(constants.no_results_found))
     utilities.click_element(self.driver, By.XPATH,
                             locators.FILTER_BY_REPO_TOGGLE_XPATH)
     utilities.wait(1)
     utilities.click_element(self.driver, By.XPATH,
                             locators.FILTER_BY_REPO_TOGGLE_XPATH)
     utilities.wait(1)
     check_that(
         "Repository list is displayed after expanding Filter by Repo",
         utilities.find_element(self.driver, By.XPATH,
                                locators.REPO_LIST_XPATH).is_displayed(),
         is_true())
예제 #3
0
 def product_info_on_customer_portal(self):
     utilities.wait(5)
     utilities.page_reload(self.driver)
     utilities.click_element(self.driver, By.PARTIAL_LINK_TEXT,
                             "View on Customer Portal")
     try:
         utilities.wait(5)
         utilities.switch_to_latest_tab(self.driver)
         utilities.wait(6)
         updated_date_on_portal = utilities.find_shadow_dom_element(
             self.driver, locators.UPDATED_DATE_ON_PORTAL_CSS,
             locators.MODULE_BODY_ON_PORTAL_CSS).get_attribute(
                 "textContent")
         check_that("updated date reflected on view page",
                    updated_date_on_portal,
                    contains_string(self.first_pub_date_details_page))
         published_date_on_portal = utilities.find_shadow_dom_element(
             self.driver, locators.PUBLISHED_DATE_ON_PORTAL_CSS,
             locators.MODULE_BODY_ON_PORTAL_CSS).get_attribute(
                 "textContent")
         check_that("published date reflected on view page",
                    published_date_on_portal,
                    contains_string(self.last_pub_date_details_page))
     except (TimeoutException, StaleElementReferenceException,
             NoSuchElementException) as e:
         lcc.log_error(
             "Some problem accessing the Customer Portal, please check.")
         lcc.log_error(e)
     finally:
         if (len(self.driver.window_handles) > 1):
             self.driver.close()
             utilities.switch_to_first_tab(self.driver)
예제 #4
0
 def authenticated_user_view_unpublished_module(self):
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     utilities.page_reload(self.driver)
     # search_page.search_for_module_and_click(self.driver, constants.unpublished_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(self.driver,
                                              constants.unpublished_module)
     check_that(
         "Button",
         utilities.get_text(self.driver, By.ID,
                            locators.MODULE_DISPLAY_PUBLISH_BUTTON_ID),
         contains_string("Publish"))
     check_that(
         "Button",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_PREVIEW_BUTTON_CSS),
         contains_string("Preview"))
     check_that(
         "First Published date",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_FIRST_PUBLISHED_CSS),
         contains_string("--"))
     check_that(
         "Last Published date",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_LAST_PUBLISHED_CSS),
         contains_string("--"))
     check_that(
         "Module display page title",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_TITLE_CSS),
         contains_string(constants.unpublished_module))
def select_repo(driver, title):
    lcc.log_info("Selecting repo::{}".format(title))
    utilities.click_element(driver, By.LINK_TEXT,
                            locators.MENU_SEARCH_PAGE_LINK_TEXT)
    # Poll until all the repos are listed in the filter
    poll(lambda: len(
        driver.find_elements(By.CLASS_NAME, locators.
                             SELECT_REPO_CHECKBOX_CLASS_NAME)) >= 1,
         ignore_exceptions=[NoSuchElementException],
         timeout=15,
         step=1)
    utilities.enter_text(driver, By.XPATH,
                         locators.FILTER_BY_REPO_SEARCH_BAR_XPATH, title)
    # Poll until repo matching the search criteria is listed in the filter
    poll(lambda: len(
        driver.find_elements(By.CLASS_NAME, locators.
                             SELECT_REPO_CHECKBOX_CLASS_NAME)) == 1,
         ignore_exceptions=[NoSuchElementException],
         timeout=15,
         step=1)
    # utilities.wait(7)
    print(
        len(
            driver.find_elements(By.CLASS_NAME,
                                 locators.SELECT_REPO_CHECKBOX_CLASS_NAME)))
    utilities.click_element(driver, By.CLASS_NAME,
                            locators.SELECT_REPO_CHECKBOX_CLASS_NAME)
    utilities.wait(3)
예제 #6
0
 def view_on_portal_link_test(self):
     try:
         utilities.wait(5)
         utilities.click_element(self.driver, By.CSS_SELECTOR,
                                 locators.VIEW_ON_PORTAL_LINK_CSS)
         utilities.wait(5)
         utilities.switch_to_latest_tab(self.driver)
         utilities.wait(7)
         lcc.log_info(
             "Find the CP preview in the attachment below for debugging purposes"
         )
         self.driver.save_screenshot("cp_preview_module.png")
         lcc.save_attachment_file("cp_preview_module.png")
         check_that("View on Portal URL path", self.driver.current_url,
                    contains_string(constants.view_on_portal_page_url))
         module_id_regex = re.compile(
             r'^[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}$'
         )
         current__module_id = self.driver.current_url.split("/topic/")[1]
         check_that("View on Portal URL id", current__module_id,
                    match_pattern(module_id_regex))
         # content_body_on_portal = utilities.find_element(self.driver, By.CSS_SELECTOR, locators.MODULE_BODY_ON_PORTAL_CSS)
     except (TimeoutException, StaleElementReferenceException,
             NoSuchElementException) as e:
         lcc.log_error("Error finding element!!!")
         lcc.log_error(e)
     finally:
         if (len(self.driver.window_handles) > 1):
             self.driver.close()
             utilities.switch_to_first_tab(self.driver)
 def invalid_product_version_url_fragment(self):
     #Verify invalid input for url fragment
     utilities.enter_text(self.driver, By.ID, locators.NEW_PRODUCT_VERSION_TEXTBOX_ID, constants.product_version_1)
     utilities.enter_text(self.driver, By.ID, locators.VERSION_URL_FRAGMENT_ID, "#")
     check_that("Warning is displayed", utilities.get_text(self.driver, By.CSS_SELECTOR, locators.WARNING_ALERT_CSS),
                contains_string(constants.version_url_fragment_warning))
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.CLOSE_WARNING_ALERT_CSS)
     utilities.find_element(self.driver, By.ID, locators.NEW_PRODUCT_VERSION_TEXTBOX_ID).clear()
예제 #8
0
def import_git_repo(driver, repo, branch):
    if (repo is not None):
        utilities.enter_text(driver, By.CSS_SELECTOR,
                             locators.GIT_REPO_URL_TEXTBOX_CSS, repo)
        utilities.enter_text(driver, By.CSS_SELECTOR,
                             locators.GIT_REPO_BRANCH_TEXTBOX_CSS, branch)
    utilities.click_element(driver, By.CSS_SELECTOR,
                            locators.GIT_REPO_SUBMIT_BUTTON_CSS)
 def verify_module_type_from_backend_module_type_inside_file_con(self):
     utilities.click_element(self.driver, By.LINK_TEXT,
                             locators.MENU_SEARCH_PAGE_LINK_TEXT)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.filter_by_content_type(self.driver, "Concept")
     # search_page.filter_by_module_type(self.driver, "Concept")
     open_module_display_page(self.driver, constants.con_module_title1)
     verify_module_type_from_backend(self.driver, "Concept")
 def git_import_for_empty_git_repo(self):
     utilities.click_element(self.driver, By.LINK_TEXT,
                             locators.MENU_GIT_IMPORT_LINK_TEXT)
     git_import_page.import_git_repo(self.driver, None, None)
     check_that(
         "Empty git repo url warning message",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.WARNING_ALERT_CSS),
         contains_string(constants.repo_url_empty_warning_message))
예제 #11
0
def login(driver):
    # utilities.click_element(driver, By.LINK_TEXT, locators.LOGIN_LINK_TEXT)
    assert_that("Assert sso url", driver.current_url,
                contains_string(fixture.sso_url))
    utilities.enter_text(driver, By.ID, locators.USER_NAME_ID, username)
    utilities.click_element(driver, By.ID, locators.LOGIN_NEXT_BUTTON_ID)
    utilities.enter_text(driver, By.ID, locators.PASSWORD_ID, password)
    utilities.click_element(driver, By.ID, locators.LOGIN_BUTTON_ID)
    driver.get(fixture.url + "pantheon/#/")
def add_bulk_metadata(driver):
    utilities.select_value_from_dropdown(driver, By.XPATH,
                                         locators.EDIT_METADATA_SELECT_PRODUCT,
                                         constants.product_name)
    utilities.select_value_from_dropdown(driver, By.XPATH,
                                         locators.EDIT_METADATA_SELECT_VERSION,
                                         constants.product_version)
    utilities.select_value_from_dropdown(driver, By.XPATH,
                                         locators.EDIT_METADATA_SELECT_USECASE,
                                         constants.use_case)
    utilities.click_element(driver, By.XPATH, locators.EDIT_METADATA_SAVE)
예제 #13
0
 def setup_suite(self):
     # Add metadata
     utilities.wait(5)
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     utilities.page_reload(self.driver)
     # search_page.search_for_module_and_click(self.driver, constants.published_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(self.driver,
                                              constants.published_module)
     display_module_page.add_metadata_and_publish(self.driver)
     utilities.wait_for_element(self.driver, By.ID,
                                locators.MODULE_DISPLAY_UNPUBLISH_BUTTON_ID)
def search_module_and_click(driver, title):
    lcc.log_info("Searching for title::{}".format(title))
    try:
        wait_for_modules(driver)
        utilities.enter_text(driver, By.CSS_SELECTOR,
                             locators.SEARCH_TITLE_CSS, title)
        # utilities.click_element(driver, By.CSS_SELECTOR, locators.TITLE_SEARCH_ICON_CSS)
        utilities.click_element(driver, By.LINK_TEXT, title)
    except TimeoutException as e:
        lcc.log_info(
            "It appears that the module was not found, please check your test data."
        )
        raise e
 def publish_assembly(self):
     utilities.wait(5)
     utilities.click_element(self.driver, By.ID,
                             locators.MODULE_DISPLAY_PUBLISH_BUTTON_ID)
     check_that(
         "Button",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_PREVIEW_BUTTON_CSS),
         contains_string("Preview"))
     check_that(
         "Button",
         utilities.get_text(self.driver, By.ID,
                            locators.MODULE_DISPLAY_UNPUBLISH_BUTTON_ID),
         contains_string("Unpublish"))
 def create_product_blank_name(self):
     utilities.click_element(self.driver, By.XPATH, locators.MENU_PRODUCTS_LINK_XPATH)
     utilities.click_element(self.driver, By.LINK_TEXT, locators.MENU_NEW_PRODUCT_LINK_TEXT)
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.SAVE_PRODUCT_BUTTON_CSS)
     check_that("Warning is displayed", utilities.get_text(self.driver, By.CSS_SELECTOR, locators.WARNING_ALERT_CSS),
                contains_string(constants.blank_product_name_warning))
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.CLOSE_WARNING_ALERT_CSS)
 def search_for_module(self):
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     utilities.page_reload(self.driver)
     utilities.wait(2)
     utilities.enter_text(self.driver, By.ID, locators.SEARCH_BOX_ID,
                          constants.module_to_search)
     utilities.click_element(self.driver, By.CSS_SELECTOR,
                             locators.SEARCH_BUTTON_CSS)
     utilities.wait(3)
     check_that(
         "module is found on search page",
         utilities.get_text(self.driver, By.XPATH,
                            locators.SEARCH_MODULE_XPATH),
         contains_string(constants.module_to_search))
예제 #18
0
def search_for_module_and_click(driver, title):
    wait_for_search_results(driver)
    lcc.log_info("Searching specific title....")
    try:
        utilities.enter_text(driver, By.ID, locators.SEARCH_BOX_ID, title)
        print("Entered text!")
        utilities.wait(1)
        utilities.click_element(driver, By.CSS_SELECTOR, locators.SEARCH_BUTTON_CSS)
        utilities.wait(1)
        wait_for_module_to_load(driver, title)
        utilities.click_element(driver, By.LINK_TEXT, title)
    except TimeoutException as e:
        lcc.log_info("It appears that the module was not found, please check your test data.")
        raise e
예제 #19
0
    def product_info_on_view_page(self):
        utilities.click_element(self.driver, By.CSS_SELECTOR,
                                locators.MODULE_DISPLAY_PREVIEW_BUTTON_CSS)
        try:
            utilities.switch_to_latest_tab(self.driver)
            utilities.wait(2)
            product_name = utilities.find_shadow_dom_element(
                self.driver, locators.PRODUCT_NAME_ON_PREVIEW_CSS,
                locators.MODULE_BODY_CONTENT_CSS).text
            check_that("Product name reflected on view page", product_name,
                       contains_string(constants.product_name))
            product_version = utilities.find_shadow_dom_element(
                self.driver, locators.PRODUCT_VERSION_ON_PREVIEW_CSS,
                locators.MODULE_BODY_CONTENT_CSS).text
            check_that("Product version reflected on view page",
                       product_version,
                       contains_string(constants.product_version))
            updated_date_view_page = utilities.find_shadow_dom_element(
                self.driver, locators.UPDATED_DATE_ON_PREVIEW_CSS,
                locators.MODULE_BODY_CONTENT_CSS).text.strip("Updated ")
            check_that("updated date reflected on view page",
                       updated_date_view_page,
                       contains_string(self.first_pub_date_details_page))
            published_date_view_page = utilities.find_shadow_dom_element(
                self.driver, locators.PUBLISHED_DATE_ON_PREVIEW_CSS,
                locators.MODULE_BODY_CONTENT_CSS).text.strip("Published ")
            check_that("published date reflected on view page",
                       published_date_view_page,
                       contains_string(self.last_pub_date_details_page))
            legal_notice = utilities.find_shadow_dom_element(
                self.driver, locators.LEGAL_NOTICE_ON_PREVIEW_CSS,
                locators.MODULE_BODY_CONTENT_CSS)
            check_that(
                "legal notice is displayed at the bottom of preview page",
                legal_notice.text,
                contains_string("Legal Notices for Trademarks"))
            legal_notice_href = legal_notice.get_attribute("href")
            check_that("verify legal notice link", legal_notice_href,
                       contains_string(constants.legal_notice_link))

        except (TimeoutException, StaleElementReferenceException,
                NoSuchElementException) as e:
            lcc.log_error("Element could not be located!!!")
            lcc.log_error(e)
        finally:
            if (len(self.driver.window_handles) > 1):
                self.driver.close()
                utilities.switch_to_first_tab(self.driver)
 def modules_bulk_publish(self):
     poll(lambda: len(
         utilities.find_elements_by_css_selector(self.driver, locators.
                                                 MODULES_LIST_CSS)) == 4,
          ignore_exceptions=[NoSuchElementException],
          timeout=5,
          step=0.5)
     utilities.click_element(self.driver, By.XPATH,
                             locators.MODULES_SELECT_ALL_TITLE_XPATH)
     bulk_publish = utilities.find_element(self.driver, By.CSS_SELECTOR,
                                           locators.BULK_PUBLISH_CSS)
     bulk_publish.click()
     check_that(
         "Confirmation modal title",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODAL_TITLE_CSS), equal_to("Publish"))
     check_that(
         "Count of modules being published",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.TITLES_FOR_PUBLISH_CSS),
         contains_string("4"))
     utilities.click_element(self.driver, By.CSS_SELECTOR,
                             locators.CONFIRM_BUTTON_CSS)
     poll(lambda: utilities.get_text(self.driver, By.CSS_SELECTOR, locators.
                                     PROGRESS_SUCCESS_STATUS) == "100%",
          ignore_exceptions=[NoSuchElementException],
          timeout=20,
          step=1)
     utilities.click_element(self.driver, By.XPATH,
                             locators.VIEW_DETAILS_LINK)
     modules_updated = utilities.find_elements_by_css_selector(
         self.driver, locators.UPDATED_TITLES_LIST_CSS)
     check_that("Count of successfully updated modules",
                len(modules_updated), equal_to(4))
     check_that(
         "Skipped modules section text",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.SKIPPED_TITLE_LIST_CSS),
         equal_to("n/a"))
     check_that(
         "Failed modules section text",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.FAILED_TITLES_LIST_CSS),
         equal_to("n/a"))
     utilities.click_element(self.driver, By.XPATH,
                             locators.CLOSE_DETAILS_XPATH)
     utilities.click_element(self.driver, By.CSS_SELECTOR,
                             locators.CLOSE_STATUS_ALERT)
 def search_for_random_text(self):
     utilities.find_elements_by_id(self.driver,
                                   locators.SEARCH_BOX_ID).clear()
     utilities.enter_text(self.driver, By.ID, locators.SEARCH_BOX_ID,
                          constants.random_string_search)
     utilities.click_element(self.driver, By.CSS_SELECTOR,
                             locators.SEARCH_BUTTON_CSS)
     utilities.wait(2)
     check_that(
         "warning alert displayed",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.ALERT_TITLE_CSS),
         contains_string(constants.no_module_found))
     utilities.click_element(self.driver, By.XPATH,
                             locators.CANCEL_BUTTON_XPATH)
     utilities.wait(2)
 def create_product_blank_version(self):
     # utilities.click_element(self.driver, By.LINK_TEXT, locators.MENU_NEW_PRODUCT_LINK_TEXT)
     lcc.log_info("Product name input: %s " % product_name)
     # Reload new product to clear old values
     utilities.page_reload(self.driver)
     utilities.wait(3)
     # Fill new product form
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_NAME_TEXTBOX_ID, product_name)
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_URL_FRAGMENT_TEXTBOX_ID, constants.url_fragment)
     utilities.find_element(self.driver, By.ID, locators.NEW_PRODUCT_VERSION_TEXTBOX_ID).clear()
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_VERSION_URL_FRAGMENT_ID, constants.product_version)
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_DESCRIPTION_TEXTBOX_ID, constants.new_product_description)
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.SAVE_PRODUCT_BUTTON_CSS)
     check_that("Warning is displayed", utilities.get_text(self.driver, By.CSS_SELECTOR, locators.WARNING_ALERT_CSS),
                contains_string(constants.blank_product_name_warning))
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.CLOSE_WARNING_ALERT_CSS)
def verify_filter_by_content_type(driver, module_type):
    utilities.click_element(driver, By.LINK_TEXT,
                            locators.MENU_SEARCH_PAGE_LINK_TEXT)
    utilities.page_reload(driver)
    search_beta_page.select_repo(driver, fixture.repo_name)
    lcc.log_info("Verifying filter by module type: %s " % module_type)
    search_beta_page.filter_by_content_type(driver, module_type)
    module_type_title_list = utilities.find_elements_by_css_selector(
        driver, locators.ALL_MODULE_TITLES)
    module_type_list = []
    for i in module_type_title_list:
        module_type_list.append(i.text)
    for i in module_type_list:
        check_that("Module type for all titles", i,
                   contains_string(module_type))
    utilities.wait(10)
 def search_for_repo(self):
     utilities.enter_text(self.driver, By.XPATH,
                          locators.FILTER_BY_REPO_SEARCH_BAR_XPATH,
                          self.repo_name)
     utilities.wait(1)
     repo_list = utilities.find_elements_by_css_selector(
         self.driver, locators.REPOSITORY_CHECKBOX_CSS)
     repo_list_count = len(repo_list)
     for i in range(repo_list_count):
         if repo_list[i].text == self.repo_name:
             check_that("Entered repo name is displayed on search results",
                        repo_list[i].text, equal_to(self.repo_name))
     utilities.click_element(
         self.driver, By.CLASS_NAME,
         locators.CANCEL_BUTTON_ON_REPO_SEARCH_BAR_CLASS_NAME)
     utilities.wait(1)
예제 #25
0
 def authenticated_user_view_published_module(self):
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     # search_page.search_for_module_and_click(self.driver, constants.published_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(self.driver,
                                              constants.published_module)
     # utilities.find_element(self.driver, By.ID, locators.MODULE_DISPLAY_PUBLISH_BUTTON_ID)
     check_that(
         "Button",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.MODULE_DISPLAY_PREVIEW_BUTTON_CSS),
         contains_string("Preview"))
     check_that(
         "Button",
         utilities.get_text(self.driver, By.ID,
                            locators.MODULE_DISPLAY_UNPUBLISH_BUTTON_ID),
         contains_string("Unpublish"))
 def search_for_module_with_asian_chars(self):
     utilities.find_elements_by_id(self.driver,
                                   locators.SEARCH_BOX_ID).clear()
     utilities.enter_text(self.driver, By.ID, locators.SEARCH_BOX_ID,
                          constants.asian_char_module)
     # module will be searchable once CCS-3754 is fixed
     # verifying warning alert as of now
     utilities.click_element(self.driver, By.CSS_SELECTOR,
                             locators.SEARCH_BUTTON_CSS)
     utilities.wait(2)
     check_that(
         "module with asian character should be found once CCS-3754 is fixed, checking for warning alert as of now..",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.ALERT_TITLE_CSS),
         contains_string(constants.no_module_found))
     utilities.click_element(self.driver, By.XPATH,
                             locators.CANCEL_BUTTON_XPATH)
     utilities.wait(2)
 def published_title_add_metadata(self):
     utilities.click_element(self.driver, By.XPATH,
                             locators.FIRST_MODULE_CHECKBOX_XPATH)
     utilities.wait(2)
     bulk_edit_metadata = utilities.find_element(
         self.driver, By.XPATH, locators.BULK_EDIT_METADATA_XPATH)
     bulk_edit_metadata.click()
     utilities.wait(2)
     search_beta_page.add_bulk_metadata(self.driver)
     utilities.wait(2)
     check_that(
         "Alert message displayed when trying to add metadata to published title",
         utilities.get_text(self.driver, By.CSS_SELECTOR,
                            locators.ALERT_TITLE_CSS),
         equal_to(constants.error_message_on_edit_metadata))
     utilities.click_element(self.driver, By.XPATH,
                             locators.CLOSE_DETAILS_XPATH)
     utilities.wait(15)
     lcc.log_info("End of tests, executing teardown")
def fill_edit_metadata_form(driver, product_name, product_version, usecase,
                            url_fragment):
    utilities.wait(2)
    utilities.select_value_from_dropdown(driver, By.CSS_SELECTOR,
                                         locators.PRODUCT_NAME_DROPDOWN_CSS,
                                         product_name)
    utilities.wait(5)
    utilities.select_value_from_dropdown(driver, By.CSS_SELECTOR,
                                         locators.PRODUCT_VERSION_DROPDOWN_CSS,
                                         product_version)
    utilities.wait(2)
    utilities.select_value_from_dropdown(driver, By.CSS_SELECTOR,
                                         locators.PRODUCT_USECASE_DROPDOWN_CSS,
                                         usecase)
    utilities.wait(2)
    utilities.enter_text(driver, By.CSS_SELECTOR,
                         locators.PRODUCT_URLFRAGMENT_CSS, url_fragment)
    utilities.wait(5)
    utilities.click_element(driver, By.CSS_SELECTOR,
                            locators.EDIT_METADATA_SAVE_CSS)
    utilities.wait(2)
 def create_product(self):
     # utilities.click_element(self.driver, By.LINK_TEXT, locators.MENU_NEW_PRODUCT_LINK_TEXT)
     lcc.log_info("Product name input: %s " % product_name)
     # Reload new product page to clear old values
     utilities.page_reload(self.driver)
     # Fill new product form
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_NAME_TEXTBOX_ID, product_name)
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_URL_FRAGMENT_TEXTBOX_ID, constants.url_fragment)
     utilities.enter_text(self.driver, By.ID, locators.NEW_PRODUCT_VERSION_TEXTBOX_ID, constants.product_version)
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_VERSION_URL_FRAGMENT_ID, constants.product_version)
     utilities.enter_text(self.driver, By.ID, locators.PRODUCT_DESCRIPTION_TEXTBOX_ID,
                          constants.new_product_description)
     utilities.enter_text(self.driver, By.ID, locators.NEW_PRODUCT_VERSION_TEXTBOX_ID, constants.product_version)
     utilities.click_element(self.driver, By.CSS_SELECTOR, locators.SAVE_PRODUCT_BUTTON_CSS)
     utilities.wait(5)
     products = utilities.find_elements_by_css_selector(self.driver, locators.PRODUCT_NAME_LIST_CSS)
     lcc.log_info(str(len(products)))
     products_list = []
     for product in products:
         products_list.append(product.text)
     check_that("Product created is listed successfully", products_list, has_item(product_name), quiet=False)
예제 #30
0
 def no_product_info_publish_module(self):
     utilities.click_element(self.driver, By.LINK_TEXT, "Search")
     utilities.page_reload(self.driver)
     # # Click on the title if it is displayed on the first page
     utilities.wait(5)
     # search_page.search_for_module_and_click(self.driver, constants.unpublished_module)
     search_beta_page.select_repo(self.driver, fixture.repo_name)
     search_beta_page.search_module_and_click(self.driver,
                                              constants.unpublished_module)
     utilities.wait(5)
     tooltip_icon = utilities.find_element(self.driver, By.CSS_SELECTOR,
                                           locators.NO_URL_TOOLTIP_ICON)
     check_that("No url tooltip icon is displayed",
                tooltip_icon.is_displayed(), is_true())
     utilities.click_element(self.driver, By.ID,
                             locators.MODULE_DISPLAY_PUBLISH_BUTTON_ID)
     check_that(
         "Button contains text",
         utilities.get_text(self.driver, By.ID,
                            locators.MODULE_DISPLAY_PUBLISH_BUTTON_ID),
         contains_string("Publish"))