summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb')
-rw-r--r--qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
new file mode 100644
index 00000000000..2a46604f8ac
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/3_create/wiki/content_editor_spec.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+module QA
+ RSpec.describe 'Create' do
+ context 'Content Editor' do
+ let(:initial_wiki) { Resource::Wiki::ProjectPage.fabricate_via_api! }
+ let(:page_title) { 'Content Editor Page' }
+ let(:heading_text) { 'My New Heading' }
+ let(:image_file_name) { 'testfile.png' }
+
+ before do
+ Flow::Login.sign_in
+ end
+
+ after do
+ initial_wiki.project.remove_via_api!
+ end
+
+ it 'creates a formatted Wiki page with an image uploaded', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1861' do
+ initial_wiki.visit!
+
+ Page::Project::Wiki::Show.perform(&:click_new_page)
+
+ Page::Project::Wiki::Edit.perform do |edit|
+ edit.set_title(page_title)
+ edit.use_new_editor
+ edit.add_heading('Heading 1', heading_text)
+ edit.upload_image(File.absolute_path(File.join('qa', 'fixtures', 'designs', image_file_name)))
+ end
+
+ Page::Project::Wiki::Edit.perform(&:click_submit)
+
+ Page::Project::Wiki::Show.perform do |wiki|
+ aggregate_failures 'page shows expected content' do
+ expect(wiki).to have_title(page_title)
+ expect(wiki).to have_heading('h1', heading_text)
+ expect(wiki).to have_image(image_file_name)
+ end
+ end
+ end
+ end
+ end
+end