spec: add test for rce-next header format dropdown

Change-Id: I8b276d8d627775b19d30416b6567bcf6d9590fff
refs: CORE-2633
Reviewed-on: https://gerrit.instructure.com/196130
Tested-by: Jenkins
Reviewed-by: Robert Lamb <rlamb@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jeremy Putnam <jeremyp@instructure.com>
This commit is contained in:
Jeremy Putnam 2019-05-31 16:49:27 -06:00
parent 2ee9d607dd
commit 974829ad55
2 changed files with 38 additions and 0 deletions

View File

@ -60,6 +60,10 @@ module RCENextPage
f('#rcs-LinkToNewPage-submit')
end
def wiki_body
f('#tinymce')
end
def wiki_body_anchor
f('#tinymce p a')
end
@ -202,6 +206,14 @@ module RCENextPage
# put align right button locator here
end
def formatting_dropdown
f("button[aria-label='Blocks'")
end
def header_option
f('[role="menuitemcheckbox"][title="Header"]')
end
def rce_next_toolbar
f(".tox-toolbar__primary")
end
@ -369,6 +381,14 @@ module RCENextPage
align_right_button.click
end
def click_formatting_dropdown
formatting_dropdown.click
end
def click_header_option
header_option.click
end
def click_editor_window
editor_window.click
end

View File

@ -35,6 +35,10 @@ describe "RCE Next toolbar features" do
stub_rcs_config
end
def create_wiki_page_with_text(page_title)
@course.wiki_pages.create!(title: page_title, body: "<p>The sleeper must awaken.</p>")
end
it "should add bullet lists", priority: "1", test_id: 307623 do
skip('Unskip in CORE-2636')
wysiwyg_state_setup(@course)
@ -234,5 +238,19 @@ describe "RCE Next toolbar features" do
expect(rce_next_toolbar.size.height).to be 39
end
it "should verify selecting Header from dropdown sets H2" do
page_title = "header"
create_wiki_page_with_text(page_title)
visit_existing_wiki_edit(@course, page_title)
select_all_wiki
click_formatting_dropdown
click_header_option
in_frame tiny_rce_ifr_id do
expect(wiki_body).to contain_css('h2')
end
end
end
end