Exemplo n.º 1
0
def test_otus():
    browser.open_url('https://otus.ru/')
    # print(browser.title())  # 'Онлайн курсы для профессионалов'
    browser.element(by.text('Отзывы')).click()
    el = browser.elements(by.css('.review-tile')).first().text
    print(el)
    browser.should(have.text('Selenium'))
Exemplo n.º 2
0
 def __init__(self):
     self._header = s('app-lbl[ng-reflect-key="Header_Toolbar_WelcomeTo"]')
     self.pl = s(by.xpath('//div[text()="PL"]'))
     self.en = s(by.xpath('//div[text()="EN"]'))
     ############################################################
     self._new_job_mane = s('#jobsListNewJobNameInput')
     self._add_button = s('#jobsListNewJobNameButton')
     self.jobs_list = ss(by.xpath(' //*[starts-with(@id,"jobsListJob")]//h3'))
     self.first_job = browser.element(by.xpath(' (//*[starts-with(@id,"jobsListJob")]//h3)[1]'))
     self.removes = browser.elements(by.xpath('//h3[@class="mat-line"]/../../button'))
     self._body = s('mat-toolbar.mat-primary > span:nth-child(1)')
     self.job = 'h3.mat-line'
     self.work_plate = '#canvasPanel'
     ############################################################
     self.allert = s(by.xpath('//snack-bar-container//span'))
     ############################################################
     self.work_tab = s(by.xpath('//app-lbl[text()="Work"]'))
Exemplo n.º 3
0
def ss(css_selector_or_by):
    return browser.elements(css_selector_or_by)
Exemplo n.º 4
0
 def get_elements_count(self, css_selector):
     return browser.elements(css_selector).size()
Exemplo n.º 5
0
 def read_texts(self, css_selector):
     return [e.text for e in browser.elements(css_selector)]