本文整理汇总了Python中pages.desktop.page_provider.PageProvider.submit_article方法的典型用法代码示例。如果您正苦于以下问题:Python PageProvider.submit_article方法的具体用法?Python PageProvider.submit_article怎么用?Python PageProvider.submit_article使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pages.desktop.page_provider.PageProvider
的用法示例。
在下文中一共展示了PageProvider.submit_article方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_article_can_be_created
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_created(self, mozwebqa):
"""
Creates a new knowledge base article.
Verifies creation.
Deletes the article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article["comment"])
# verify article contents
kb_edit_article = kb_article_history.navigation.click_edit_article()
actual_summary_text = kb_edit_article.article_summary_text
Assert.equal(mock_article["summary"], actual_summary_text)
actual_contents_text = kb_edit_article.article_contents_text
Assert.equal(mock_article["content"], actual_contents_text)
# delete the same article
kb_article_history = kb_edit_article.navigation.click_show_history()
kb_article_history.delete_entire_article_document()
示例2: test_that_article_can_be_deleted
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_deleted(self, mozwebqa):
"""
Creates a new knowledge base article.
Deletes the article.
Verifies the deletion.
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article["comment"])
# go to article and get URL
kb_article = kb_article_history.navigation.click_article()
article_url = kb_article.url_current_page
# delete the same article
kb_article_history = kb_article.navigation.click_show_history()
kb_article_history.delete_entire_article_document()
kb_article_history.selenium.get(article_url)
actual_page_title = kb_article_history.page_title
Assert.contains("Page Not Found", actual_page_title)
示例3: test_that_article_can_be_created
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_created(self, mozwebqa, variables):
"""
Creates a new knowledge base article.
Verifies creation.
Deletes the article
"""
user = variables['users']['admin']
kb_new_article = PageProvider(mozwebqa).new_kb_article_page(
user['username'], user['password'])
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
# verify article contents
kb_edit_article = kb_article_history.navigation.click_edit_article()
actual_summary_text = str(kb_edit_article.article_summary_text)
Assert.equal(mock_article['summary'], actual_summary_text)
actual_contents_text = str(kb_edit_article.article_contents_text)
Assert.equal(mock_article['content'], actual_contents_text)
# delete the same article
kb_article = kb_edit_article.navigation.click_show_history()
kb_article.delete_entire_article_document()
示例4: test_that_article_can_be_translated
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_translated(self, mozwebqa):
"""
Creates a new knowledge base article.
Translate article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article["comment"])
# translating
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language("Esperanto (eo)")
# enter the tranlation
mock_article_esperanto = MockArticle(suffix="_esperanto")
kb_translate_pg.type_title(mock_article_esperanto["title"])
kb_translate_pg.type_slug(mock_article_esperanto["slug"])
kb_translate_pg.type_search_result_summary(mock_article_esperanto["summary"])
kb_translate_pg.click_submit_review()
change_comment = mock_article_esperanto["comment"]
kb_translate_pg.type_modal_describe_changes(change_comment)
kb_article_history = kb_translate_pg.click_modal_submit_changes_button()
# verifying
Assert.equal(change_comment, kb_article_history.most_recent_revision_comment)
Assert.contains("Esperanto", kb_article_history.revision_history)
# deleting
kb_article_history.delete_entire_article_document()
示例5: test_that_article_can_be_translated
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_translated(self, mozwebqa):
"""
Creates a new knowledge base article.
Translate article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
article_info_dict = self._create_new_generic_article(kb_new_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box()
# translating
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language('Esperanto (eo)')
if not kb_translate_pg.is_type_title_visible:
pytest.xfail(reason='Bug 790626 - [STAGE] translating a question sometimes returns 500 page')
timestamp = datetime.datetime.now()
kb_translate_pg.type_title('artikolo_titolo%s' % timestamp)
kb_translate_pg.type_slug('artikolo_limako_%s' % timestamp)
kb_translate_pg.type_search_result_summary('artikolo_serco_rezulto_resumo_%s' % timestamp)
kb_translate_pg.click_submit_review()
change_comment = 'artikolo sangoj %s' % timestamp
kb_translate_pg.type_modal_describe_changes(change_comment)
kb_article_history = kb_translate_pg.click_modal_submit_changes_button()
# verifying
Assert.equal(change_comment, kb_article_history.most_recent_revision_comment)
Assert.equal('Esperanto', kb_article_history.revision_history)
# deleting
kb_article_history.delete_entire_article_document()
示例6: test_that_article_can_be_translated
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_translated(self, mozwebqa):
"""
Creates a new knowledge base article.
Translate article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
article_info_dict = self._create_new_generic_article(kb_new_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box()
# translating
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language('Esperanto (eo)')
timestamp = datetime.datetime.now()
kb_translate_pg.type_title('artikolo_titolo%s' % timestamp)
kb_translate_pg.type_slug('artikolo_limako_%s' % timestamp)
kb_translate_pg.click_submit_review()
change_comment = 'artikolo sangoj %s' % timestamp
kb_translate_pg.type_modal_describe_changes(change_comment)
kb_article_history = kb_translate_pg.click_modal_submit_changes_button()
# verifying
Assert.equal(change_comment, kb_article_history.most_recent_revision_comment)
Assert.equal('Esperanto', kb_article_history.revision_history)
# deleting
kb_article_history.delete_entire_article_document()
示例7: test_logout_from_edit_kb_article_page
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_logout_from_edit_kb_article_page(self, mozwebqa):
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
kb_edit_article = kb_article_history.navigation.click_edit_article()
# sign out
register_page = kb_edit_article.sign_out()
register_page.is_the_current_page
Assert.true(register_page.header.is_user_logged_out)
示例8: test_logout_from_translate_kb_article_page
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_logout_from_translate_kb_article_page(self, mozwebqa):
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language('Esperanto (eo)')
# sign out
login_page = kb_translate_pg.sign_out()
login_page.is_the_current_page
Assert.true(login_page.header.is_user_logged_out)
示例9: test_logout_from_translate_kb_article_page
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_logout_from_translate_kb_article_page(self, mozwebqa):
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language('Deutsch (de)')
# sign out
register_page = kb_translate_pg.sign_out()
register_page._page_title = 'Anmelden / Registrieren | Mozilla-Hilfe'
register_page.is_the_current_page
Assert.true(register_page.header.is_user_logged_out)
示例10: test_logout_from_edit_kb_article_page
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_logout_from_edit_kb_article_page(self, mozwebqa, variables):
user = variables['users']['default']
kb_new_article = PageProvider(mozwebqa).new_kb_article_page(
user['username'], user['password'])
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
kb_edit_article = kb_article_history.navigation.click_edit_article()
# sign out
register_page = kb_edit_article.sign_out()
register_page.is_the_current_page
Assert.true(register_page.header.is_user_logged_out)
示例11: test_that_article_can_be_edited
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_edited(self, mozwebqa, variables):
"""
Creates a new knowledge base article.
Verifies creation.
Edits the article, verifies the edition.
Deletes the article
"""
user = variables['users']['admin']
kb_new_article = PageProvider(mozwebqa).new_kb_article_page(
user['username'], user['password'])
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
# edit that same article (keep the title the same as original)
mock_article_edited = MockArticle(suffix="_edited", title=mock_article['title'])
kb_edit_article = kb_article_history.navigation.click_edit_article()
kb_article_history = kb_edit_article.edit_article(mock_article_edited)
kb_edit_article = kb_article_history.navigation.click_edit_article()
# verify the contents of the edited article
actual_page_title = kb_edit_article.page_title
Assert.contains(mock_article_edited['title'], actual_page_title)
actual_summary_text = kb_edit_article.article_summary_text
Assert.equal(mock_article_edited['summary'], actual_summary_text)
actual_content_text = kb_edit_article.article_contents_text
Assert.equal(mock_article_edited['content'], actual_content_text)
# delete the same article
kb_article_history = kb_edit_article.navigation.click_show_history()
kb_article_history.delete_entire_article_document()
示例12: test_that_article_can_be_edited
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_edited(self, mozwebqa):
"""
Creates a new knowledge base article.
Verifies creation.
Edits the article, verifies the edition.
Deletes the article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
article_info_dict = self._create_new_generic_article(kb_new_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box()
# edit that same article
timestamp = datetime.datetime.now()
edited_article_summary = "this is an automated summary__%s_edited" % timestamp
edited_article_content = "automated content__%s_edited" % timestamp
article_info_dict_edited = {'title': article_info_dict['title'],\
'category': 'How to', 'keyword': 'test',\
'summary': edited_article_summary, 'content': edited_article_content}
kb_edit_article = kb_article_history.navigation.click_edit_article()
kb_article_history = kb_edit_article.edit_article(article_info_dict_edited)
kb_edit_article = kb_article_history.navigation.click_edit_article()
# verify the contents of the edited article
actual_page_title = kb_edit_article.page_title
Assert.contains(article_info_dict_edited['title'], actual_page_title)
actual_summary_text = kb_edit_article.article_summary_text
Assert.equal(edited_article_summary, actual_summary_text)
actual_content_text = kb_edit_article.article_contents_text
Assert.equal(edited_article_content, actual_content_text)
# delete the same article
kb_article_history = kb_edit_article.navigation.click_show_history()
kb_article_history.delete_entire_article_document()
示例13: test_that_article_can_be_created
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_created(self, mozwebqa):
"""
Creates a new knowledge base article.
Verifies creation.
Deletes the article
"""
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
article_info_dict = self._create_new_generic_article(kb_new_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box()
# verify article contents
kb_edit_article = kb_article_history.navigation.click_edit_article()
actual_summary_text = kb_edit_article.article_summary_text
Assert.equal(article_info_dict['summary'], actual_summary_text)
actual_contents_text = kb_edit_article.article_contents_text
Assert.equal(article_info_dict['content'], actual_contents_text)
# delete the same article
kb_article_history = kb_edit_article.navigation.click_show_history()
kb_article_history.delete_entire_article_document()
示例14: test_that_article_can_be_translated
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def test_that_article_can_be_translated(self, mozwebqa, variables):
"""
Creates a new knowledge base article.
Translate article
"""
user = variables['users']['admin']
kb_new_article = PageProvider(mozwebqa).new_kb_article_page(
user['username'], user['password'])
# create a new article
mock_article = MockArticle()
kb_new_article.set_article(mock_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box(mock_article['comment'])
# translating
kb_translate_pg = kb_article_history.navigation.click_translate_article()
kb_translate_pg.click_translate_language('Deutsch (de)')
# enter the translation
mock_article_deutsch = MockArticle(suffix="_deutsch")
kb_translate_pg.type_title(mock_article_deutsch['title'])
kb_translate_pg.type_slug(mock_article_deutsch['slug'])
kb_translate_pg.type_search_result_summary(mock_article_deutsch['summary'])
kb_translate_pg.click_submit_review()
change_comment = mock_article_deutsch['comment']
kb_translate_pg.type_modal_describe_changes(change_comment)
kb_article_history = kb_translate_pg.click_modal_submit_changes_button()
# verifying
Assert.equal(change_comment, kb_article_history.most_recent_revision_comment)
Assert.contains('Deutsch', kb_article_history.revision_history)
# deleting
kb_article_history.delete_entire_article_document()
示例15: _create_new_kb_article
# 需要导入模块: from pages.desktop.page_provider import PageProvider [as 别名]
# 或者: from pages.desktop.page_provider.PageProvider import submit_article [as 别名]
def _create_new_kb_article(self, mozwebqa):
kb_new_article = PageProvider(mozwebqa).new_kb_article_page()
article_info_dict = self._create_new_generic_article(kb_new_article)
kb_new_article.submit_article()
kb_article_history = kb_new_article.set_article_comment_box()
return kb_article_history