def test_create_segment(segments_page: SegmentsPage): segment_name = generate_segment_name() segments_page.create_segment(segment_name) assert segments_page.has_segment(segment_name) segments_page.remove_segment(segment_name) segments_page.refresh() assert not segments_page.has_segment(segment_name)
def create_segment(self, segment_name): from ui.pages.segments_page import SegmentsPage self.click(self.locators.VK_DATA) self.click(self.locators.CHOICE_GROUP) self.click(self.locators.ADD_SEGMENT) self.find(self.locators.NAME_FIELD).clear() self.find(self.locators.NAME_FIELD).send_keys(segment_name) self.click(self.locators.CONFIRM_CREATING) return SegmentsPage(self.driver, self.config)
def segments_page(driver): return SegmentsPage(driver=driver)
def open_segments_page(self) -> SegmentsPage: self.click(self.locators.SEGMENTS_BUTTON, timeout=10) sleep(10) return SegmentsPage(self.driver)
def go_to_segments_page(self): self.click(self.locators.SEGMENTS_BUTTON) return SegmentsPage(self.driver)
def go_to_segments(self): from ui.pages.segments_page import SegmentsPage self.click(self.locators.SEGMENTS, 20) return SegmentsPage(self.driver, self.config)
def go_to_segments_page(self): self.click(self.locators.GO_TO_SEGMENTS) return SegmentsPage(self.driver)