class AddCVForm(Form): first_name = TextField(By.css("[placeholder='First Name']")) last_name = TextField(By.css("[placeholder='Last Name']")) email = TextField(By.css("[placeholder='Email']")) country = Dropdown( root=By.css(".country-wrapper"), by_select_locator=By.css(".arrow"), by_option_locator_template=By.xpath( "*root*//*[contains(@id,'select-box-applicantCountry')]//li[.='%s']" )) city = Dropdown( root=By.css(".country-wrapper"), by_select_locator=By.css(".arrow"), by_option_locator_all=By.xpath( "*root*//*[contains(@id,'select-box-applicantCity')]//li")) cv = RFileInput(By.css(".file-upload")) comment = TextArea(By.xpath(".comment-input")) submut = Button(By.xpath("//*[.='Submit']")) cancel = Button(By.xpath("//*[.='Cancel']"))
class MetalColorPage(WebPage): def __init__(self, url, title): super(MetalColorPage, self).__init__(url=url, title=title) calculate_button = Button(By.id("calculate-button")) cb_water = CheckBoxMetalColor(By.xpath("//*[@id='elements-checklist']//*[text()='Water']")) calculate_label = Label(By.id("calculate-button")) nature_check_list = CheckListMetalColor(By.css("#elements-checklist label")) combo_box = ComboBoxMetalColor(select_locator=By.css(".metals .caret"), options_names_locator_template=By.css(".metals li span"), value_locator=By.css(".metals input")) color_dropdown = Dropdown(By.css(".colors .filter-option"), By.css(".colors li span")) summary = Summary(By.id("summary-block"))
def find(self, text): Button(By.css(".search>.icon-search")).click() super(JDISearch, self).find(text)
def get_text(self): return Text(By.css(".metals .filter-option")).get_text()
class CareerPage(WebPage): def __init__(self, url, title): super(CareerPage, self).__init__(url=url, title=title) job_filter = JobFilter(By.css(".job-search-form-ui")) list_menu = None # JDIElements(By.css(".tile-menu>li>a"), Label)
class JobDescriptionPage(WebPage): def __init__(self, url, title): super(JobDescriptionPage, self).__init__(url=url, title=title) add_cv_form = AddCVForm(By.css(".form-constructor")) captcha = Element(By.id("captcha-input"))
class Summary(Section): odds_radio_buttons = RadioButtonsSummary(By.css("#odds-selector p")) odds_selector = SelectorSummary(By.css("#odds-selector p"))
class FrameSection(Section): label_button = Button(By.css("button"))
class SupportPage(WebPage): def __init__(self, url, title): super(SupportPage, self).__init__(url=url, title=title) support_table = Table(by_table_locator=By.css(".uui-table")) support_table.rows.start_index = 1
class JDIPagination(Pagination): next_button = Button(By.css("[class=next] a")) previous_button = Button(By.css("[class=prev] a")) first_button = Button(By.css("[class=first] a")) last_button = Button(By.css("[class=last] a")) page = Button(By.css(".uui-pagination li"))