def test_create_new_note(self): app = MainPage() cnt_before_creation = app.active_tab.notes_count() notes_tab = app.nav.create_note() cnt_after_creation = notes_tab.notes_count() notes_tab.active_note.title_should_be('') notes_tab.first_note().date_should_be('a few seconds ago') assert 1 + cnt_before_creation == cnt_after_creation, 'Количество заметок не увеличилось на 1'
def open_app(request, login=simple_accounts[0][0], password=simple_accounts[0][1]): LoginPage().open().login(login=login, pwd=password)\ .nav.open_tab(MainPage().nav.all_notes) def teardown(): app = MainPage() app.nav.open_tab(app.nav.all_notes).delete_all_notes() request.addfinalizer(teardown)
def login_via_google(self, login, pwd): self._google_oauth_btn.click() s("#identifierId").set(login).press_enter() s(by.name("password")).set(pwd).press_enter() return MainPage()
def login(self, login, pwd): self._username_field.set(login).press_enter() self._password_field.set(pwd).press_enter() return MainPage()
def login_as(self, user): self.username_input.set(user.name) self.password_input.set(user.password) self.login_btn.click() return MainPage()
def test_note_deleting(self, title): notes_tab = MainPage().active_tab notes_tab.open_note(title=title).note_header.open_actions_dropdown().delete_note()\ .confirm_action() notes_tab.note_should_not_exist(title)
def test_note_changing(self, title): app = MainPage() notes_tab = MainPage().active_tab notes_tab.open_note(title=title).set_title('title был 变') notes_tab.active_note.set_body('текст 改变了 too') app.refresh_page() notes_tab.first_note().title_should_be('title был 变') notes_tab.first_note().body_should_be('текст 改变了 too') notes_tab.active_note.title_should_be('title был 变') notes_tab.active_note.body_should_be('текст 改变了 too')
def test_note_opening(self, title): notes_tab = MainPage().active_tab notes_tab.open_note(title=title).title_should_be(title)
def new_note(): return MainPage().nav.create_note().active_note
def teardown(): app = MainPage() app.nav.open_tab(app.nav.all_notes).delete_all_notes()
def main(cls, platform): cls.getClient().restart_app(platform) return MainPage()
def login(self, user): self.login_input.set(user.login) self.password_input.set(user.password) self.login_btn.click() return MainPage()