diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-08 18:10:23 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-08 18:10:23 +0000 |
commit | 8a03b5424b73679d852fbf43781d9422c83869f7 (patch) | |
tree | a24a9c56fce9530492d60a640572922dd65d1072 /spec/docs_screenshots/wiki_docs.rb | |
parent | 0ebbf19f2d2b87e1f2aca1c59efde1aa6a766cf6 (diff) | |
download | gitlab-ce-8a03b5424b73679d852fbf43781d9422c83869f7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/docs_screenshots/wiki_docs.rb')
-rw-r--r-- | spec/docs_screenshots/wiki_docs.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/docs_screenshots/wiki_docs.rb b/spec/docs_screenshots/wiki_docs.rb new file mode 100644 index 00000000000..ce30b07182c --- /dev/null +++ b/spec/docs_screenshots/wiki_docs.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Wiki', :js do + include DocsScreenshotHelpers + include WikiHelpers + + let(:user) { create(:user) } + let(:project) { create(:project, namespace: user.namespace, creator: user) } + let(:wiki) { create(:project_wiki, user: user, project: project) } + + before do + page.driver.browser.manage.window.resize_to(1366, 1024) + + sign_in(user) + visit wiki_path(wiki) + + click_link "Create your first page" + end + + context 'switching to content editor' do + it 'user/project/wiki/img/use_new_editor_button' do + screenshot_area = find('.js-quick-submit') + scroll_to screenshot_area + expect(screenshot_area).to have_content 'Use new editor' + set_crop_data(screenshot_area, 10) + end + end + + context 'content editor' do + it 'user/project/wiki/img/content_editor' do + content_editor_testid = '[data-testid="content-editor"]' + + click_button 'Use new editor' + + expect(page).to have_css(content_editor_testid) + + screenshot_area = find(content_editor_testid) + scroll_to screenshot_area + + find("#{content_editor_testid} [contenteditable]").send_keys '## Using the Content Editor' + + set_crop_data(screenshot_area, 50) + end + end +end |