Commit a33b8fdc authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'qa-rewrite-content-editor-spec-with-ff' into 'master'

Rewrite content_editor_spec to run with ff on and off

See merge request gitlab-org/gitlab!75066
parents ad43a0f2 08f6a0fb
......@@ -442,6 +442,8 @@ export default {
>
<gl-button
data-testid="toggle-editing-mode-button"
data-qa-selector="editing_mode_button"
:data-qa-mode="toggleEditingModeButtonText"
variant="link"
@click="toggleEditingMode"
>{{ toggleEditingModeButtonText }}</gl-button
......
......@@ -15,6 +15,7 @@ module QA
element :wiki_message_textbox
element :wiki_submit_button
element :try_new_editor_container
element :editing_mode_button
end
base.view 'app/assets/javascripts/pages/shared/wikis/components/delete_wiki_modal.vue' do
......@@ -36,6 +37,10 @@ module QA
def click_submit
click_element(:wiki_submit_button)
wait_until(reload: false) do
has_no_element?(:wiki_title_textbox)
end
end
def delete_page
......@@ -43,11 +48,19 @@ module QA
Page::Modal::DeleteWiki.perform(&:confirm_deletion)
end
def use_new_editor
within_element(:try_new_editor_container) do
click_button('Use the new editor')
def use_new_editor(toggle)
# Update once the feature is released, see https://gitlab.com/gitlab-org/gitlab/-/issues/345398
if toggle
click_element(:editing_mode_button, mode: 'Edit rich text')
else
within_element(:try_new_editor_container) do
click_button('Use the new editor')
end
end
wait_until(reload: false) do
has_element?(:content_editor_container)
end
has_element?(:content_editor_container)
end
end
end
......
# frozen_string_literal: true
module QA
RSpec.describe 'Create', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/346149', type: :stale } do
RSpec.describe 'Create', :requires_admin do # remove :requires_admin once the ff is enabled by default in https://gitlab.com/gitlab-org/gitlab/-/issues/345398
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' }
let!(:toggle) { Runtime::Feature.enabled?(:wiki_switch_between_content_editor_raw_markdown) }
before do
Flow::Login.sign_in
......@@ -23,7 +24,7 @@ module QA
Page::Project::Wiki::Edit.perform do |edit|
edit.set_title(page_title)
edit.use_new_editor
edit.use_new_editor(toggle)
edit.add_heading('Heading 1', heading_text)
edit.upload_image(File.absolute_path(File.join('qa', 'fixtures', 'designs', image_file_name)))
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment