def test_switch_mode(self, connect_url): """Publish a static document """ pf = PublishContentForm() sleep(1) # dialog is racy with event setup pf.title.set_value('NotebookSwitchMode2') pf.publish_without_source.click() pf.submit.click() pf.close.should(be.not_(be.visible)) m = MainToolBar() notification = m.rsconnect_notification notification.should(be.visible) notification.should(have.text('Successfully published content')) # republish sleep(1) # clicking before waiting results in the event not being triggered m.rsconnect_dropdown.click() m.rsconnect_publish.click() sleep(1) # racy dialog pf.publish_with_source.click() pf.submit.click() pf.title_error.should(have.text('Cannot change app mode once deployed'))
def test_publish_source(self, connect_url): """Publish a document with source""" pf = PublishContentForm() # dialog is racy with event setup sleep(1) pf.version_info.should(be.visible) pf.version_info.should(have.text("rsconnect-python version")) pf.title.set_value("NotebookSource") pf.publish_with_source.click() pf.submit.click() cs = ContentSelectionDialog() cs.title.should(be.visible) cs.title.should(have.text("Select deployment location")) cs.new_location.should(be.visible) cs.new_location.click() cs.submit.click() cs.close.should(be.not_(be.visible)) pf.submit.click() m = MainToolBar() notification = m.rsconnect_notification notification.should(be.visible) notification.should(have.text("Successfully published content"))
def test_user_is_able_to_see_sent_message_in_outbox( self, sender, receiver): msg_subject = f"{subject} from {sender.personal_code} to {receiver.personal_code}" web_app.login_page.mobile_id_tab.go_to_tab() web_app.login_page.mobile_id_tab.login( personal_code=sender.personal_code, phone=sender.mobile_phone) web_app.mailbox_page.wait_page_has_loaded() web_app.mailbox_page.header.lang_dropdown.set_lang(Language.en) web_app.mailbox_page.outbox_tab.go_to_tab() message = web_app.mailbox_page.outbox_tab.get_message_by_text( msg_subject) message.title.should(have.text(msg_subject)) message_view = message.see_message() message_view.subject.should(have.text(msg_subject)) message_view.details.should( have.text("To: OSKAR RIATEST (EE10101010005)")) message_view.check_timestamp(date) message_view.body.should(have.text(message_body))
def test_republish(self, connect_url): """Publish a static document""" pf = PublishContentForm() sleep(1) # dialog is racy with event setup pf.title.set_value("NotebookRepublish") pf.publish_without_source.click() pf.submit.click() pf.close.should(be.not_(be.visible)) m = MainToolBar() notification = m.rsconnect_notification sleep(1) # race notification.should(be.visible) notification.should(have.text("Successfully published content")) # republish sleep( 1 ) # clicking before waiting results in the event not being triggered m.rsconnect_dropdown.click() m.rsconnect_publish.click() sleep(1) # racy dialog pf.title.set_value("") pf.title.set_value("Notebook") pf.publish_without_source.click() pf.submit.click() pf.close.should(be.not_(be.visible)) cs = ContentSelectionDialog() cs.title.should(be.visible) cs.title.should(have.text("Select deployment location")) cs.new_location.should(be.visible) cs.new_location.click() cs.submit.click() cs.close.should(be.not_(be.visible)) m.rsconnect_notification.should(be.visible) m.rsconnect_notification.should( have.text("Successfully published content"))
def test_user_is_able_to_receive_read_your_message_email( self, sender, receiver): read_msg_subject = f'The user EE{receiver.personal_code} has read your message' web_app.login_page.mobile_id_tab.go_to_tab() web_app.login_page.mobile_id_tab.login( personal_code=sender.personal_code, phone=sender.mobile_phone) web_app.mailbox_page.wait_page_has_loaded() web_app.mailbox_page.header.lang_dropdown.set_lang(Language.en) web_app.mailbox_page.inbox_tab.container.should(be.visible) message = web_app.mailbox_page.inbox_tab.get_message_by_text( read_msg_subject) message.title.should(have.text(read_msg_subject)) message.is_unread(True) message_view = message.see_message() message_view.subject.should(have.text(read_msg_subject)) message_view.details.should(have.text("From: OSKAR RIATEST")) message_view.details.should(have.text(f"{date.strftime('%d.%m.%Y')}")) message_view.check_timestamp(date) message_view.body.should( have.text("The user OSKAR RIATEST has read your message")) message_view.back_btn.click() message.is_unread(False)
def test_user_is_able_to_receive_sent_message(self, sender, receiver): msg_subject = f"{subject} from {sender.personal_code} to {receiver.personal_code}" web_app.login_page.smart_id_tab.go_to_tab() web_app.login_page.smart_id_tab.login( personal_code=receiver.personal_code, ) web_app.role_page.wait_page_has_loaded() web_app.role_page.select_top_role() web_app.mailbox_page.wait_page_has_loaded() web_app.mailbox_page.header.lang_dropdown.set_lang(Language.en) web_app.mailbox_page.inbox_tab.container.should(be.visible) message = web_app.mailbox_page.inbox_tab.get_message_by_text( msg_subject) message.title.should(have.text(msg_subject)) message.is_unread(True) message_view = message.see_message() message_view.subject.should(have.text(msg_subject)) message_view.details.should( have.text("From: MARY ÄNN O'CONNEŽ-ŠUSLIK")) message_view.check_timestamp(date) message_view.body.should(have.text(message_body)) message_view.back_btn.click() message.is_unread(False)
def test_publish_source(self, connect_url): """Publish a document with source """ pf = PublishContentForm() # dialog is racy with event setup sleep(1) pf.title.set_value('NotebookSource') pf.publish_with_source.click() pf.submit.click() m = MainToolBar() notification = m.rsconnect_notification notification.should(be.visible) notification.should(have.text('Successfully published content'))
def test_publish_static(self, connect_url): """Publish a static document""" pf = PublishContentForm() # dialog is racy with event setup sleep(1) pf.title.set_value("NotebookStatic") pf.publish_without_source.click() pf.submit.click() m = MainToolBar() notification = m.rsconnect_notification sleep(1) # race notification.should(be.visible) notification.should(have.text("Successfully published content"))
def fill_in_required_account_info(first_name, last_name, password, firstname, lastname, address1, city, state, postcode, mobile): s('#customer_firstname').set(first_name) s('#customer_lastname').set(last_name) s('#passwd').set(password) s('#passwd').set(password) s('#firstname').set(firstname) s('#lastname').set(lastname) s('#address1').set(address1) s('#city').set(city) s('#uniform-id_state').click() browser.all('option').element_by(have.text(state)).click() s('#postcode').set(postcode) s('#phone_mobile').set(mobile) s('#submitAccount').click()
def check_error_text_is(self, text): LoginpageLocators.error.should(have.text(text))
def check_timestamp(self, date: datetime): self.timestamp.should(have.text(date.strftime('%d.%m.%Y')))
def check_page_title_is(title): s('h1').should(have.text(title))
def check_username_is(self, username): """Check name in span.username is correct""" username_locator = s('span.username') username_locator.should(have.text(username))
def check_form_header_is(self, text): CheckoutpageLocators.new_customer.should(have.text(text))
def check_if_logged_in_as(username): s('a[title="Log me out"]').should(be.visible) s('.header_user_info').should(have.text(username))