Пример #1
0
    def test_project_searchable_admin_page_export(self):
        project_name = self.configAB["check_admin_import"]["project_name"]
        project_objective = self.configAB["check_admin_import"]["objective"]
        home_page = HomePage(self.webdriver, self.config)
        audience_page = AudiencePage(self.webdriver, self.config)

        home_page.searchProjects(project_name)
        project_page = ProjectPage(self.webdriver, self.config)
        project_page.project_menu_icon(project_name).click()
        home_page.project_edit_icon(project_name).click()
        project_page.AddObjective().clear()
        sleep(3)
        audience_page.icon_greentick_objective().click()
        sleep(5)
        self.webdriver.switch_to_default_content()
        home_page.lbl_Audience_Explorer_omni().click()
        sleep(20)
        iframe = self.webdriver.find_elements_by_tag_name('iframe')[0]
        self.webdriver.switch_to.frame(iframe)
        home_page.cog_button().click()
        sleep(10)
        home_page.chk_admin_audience_setting().click()
        sleep(5)
        home_page.drp_admin_project().click()
        sleep(10)
        self.webdriver.find_element_by_xpath("//option[text()='" +
                                             project_name + "']").click()
        home_page.drp_admin_project().click()
        self.webdriver.switch_to_default_content()
        home_page.lbl_Audience_Explorer_omni().click()
        iframe = self.webdriver.find_elements_by_tag_name('iframe')[0]
        self.webdriver.switch_to.frame(iframe)
        sleep(10)
        home_page.searchProjects(project_name)
        project_page.project_menu_icon(project_name).click()
        home_page.project_edit_icon(project_name).click()
        project_page.AddObjective().send_keys(project_objective)
        sleep(5)
        audience_page.icon_greentick_objective().click()
        sleep(5)
        self.webdriver.switch_to_default_content()
        home_page.lbl_Audience_Explorer_omni().click()
        sleep(20)
        iframe = self.webdriver.find_elements_by_tag_name('iframe')[0]
        self.webdriver.switch_to.frame(iframe)
        home_page.cog_button().click()
        sleep(10)
        home_page.chk_admin_audience_setting().click()
        sleep(5)
        home_page.drp_admin_project().click()
        sleep(10)
        self.webdriver.find_element_by_xpath("//option[text()='" +
                                             project_name + "']").click()
        home_page.drp_admin_project().click()
 def test_public_project_other_user(self):
     rand = my_random_string(3)
     home_page = HomePage(self.webdriver, self.config)
     project_page = ProjectPage(self.webdriver, self.config)
     audience_page = AudiencePage(self.webdriver, self.config)
     project_name = 'Test Proj' + rand
     print ("This is the project name created " + project_name)
     home_page.createProject(project_name, 'NA - United States')
     sleep(10)
     self.webdriver.switch_to_default_content()
     # actions = ActionChains(self.webdriver)
     # actions.move_to_element(project_page.img_profile()).perform()
     home_page.img_profile().click()
     sleep(5)
     home_page.link_signout().click()
     sleep(15)
     login_page = LoginPage(self.webdriver, self.config)
     login_page.login('ADMINQA.test', 'Welcome@321')
     sleep(15)
     WebDriverWait(self.webdriver, 100).until(EC.visibility_of_element_located((By.XPATH, "//button[@class='header_nav_btn']"))).click()
     sleep(5)
     WebDriverWait(self.webdriver, 100).until(EC.visibility_of_element_located((By.XPATH, "//span[text()='Audience Explorer (Omni)']"))).click()
     sleep(5)
     iframe = self.webdriver.find_elements_by_tag_name('iframe')[0]
     self.webdriver.switch_to.frame(iframe)
     home_page.searchProjects(project_name)
     project_page.project_menu_icon(project_name).click()
     home_page.project_edit_icon(project_name).click()
     # project_page.AddObjective().send_keys("Test 123")
     project_page.AddObjective().clear()
     project_page.AddObjective().send_keys('Test run time objective')
     sleep(5)
     audience_page.icon_greentick_objective().click()
     sleep(3)
     project_page.project_menu_icon(project_name).click()
     project_page.project_delete_icon(project_name).click()
     sleep(3)
     project_page.AlertOkButton().click()
     sleep(5)