def test_copy_audience_single_criteria_to_other_audience(self):
        section = self.__class__.__name__
        project_name = self.configAB[section]["project_name"]
        audience_name_single = self.configAB[section][
            "audience_name_single_source"]
        audience_name_single_dest = self.configAB[section][
            "audience_name_single_dest"]

        home_page = HomePage(self.webdriver, self.config)
        home_page.searchProjects(project_name)

        project_page = ProjectPage(self.webdriver, self.config)
        project_page.audience_menu_icon(audience_name_single).click()
        project_page.audienceEditIcon(audience_name_single)

        audience_page = AudiencePage(self.webdriver, self.config)
        audience_page.copy_audience_criteria_within_self("Demographic Data")
        self.webdriver.find_element_by_xpath(
            "//div[@class='sources-panel']/div[1]").click()

        project_page.audience_menu_icon(audience_name_single_dest).click()
        project_page.audienceEditIcon(audience_name_single_dest)
        sleep(10)
        self.webdriver.find_element_by_xpath(
            "//div[text()='Insert Copied Criteria']").click()
        audience_page.delete_audience_criteria("Demographic Data")
Esempio n. 2
0
    def test_verify_activation_rate_on_copy_criteria(self):
        section = self.__class__.__name__
        project_name_act_rate = self.configAB["cpm_rate"][
            "project_name_act_rate"]
        source_audience_name = self.configAB["cpm_rate"][
            "source_audience_name"]

        home_page = HomePage(self.webdriver, self.config)
        home_page.searchProjects(project_name_act_rate)

        project_page = ProjectPage(self.webdriver, self.config)
        project_page.audience_menu_icon(source_audience_name).click()
        project_page.audienceEditIcon(source_audience_name)

        audience_page = AudiencePage(self.webdriver, self.config)

        activation_rate1 = WebDriverWait(self.webdriver, 50).until(
            EC.visibility_of_element_located(
                (By.XPATH, "//span[contains(@class,'cost')]"))).text
        audience_page.copy_audience_criteria_within_self("Location Data")
        self.webdriver.find_element_by_xpath(
            "//div[@class='sources-panel']/div[1]").click()

        #Opening criteria builder page
        project_page.AddAudienceButton().click()
        sleep(5)
        self.webdriver.find_element_by_xpath(
            "//div[text()='Insert Copied Criteria']").click()

        activation_rate2 = WebDriverWait(self.webdriver, 50).until(
            EC.visibility_of_element_located(
                (By.XPATH, "//span[contains(@class,'cost')]"))).text

        self.assertEqual(activation_rate1, activation_rate2,
                         'Activation rate differ after copy')
        audience_page.aud_back_arrow().click()