summaryrefslogtreecommitdiff
path: root/spec/support/helpers/features/blob_spec_helpers.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /spec/support/helpers/features/blob_spec_helpers.rb
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'spec/support/helpers/features/blob_spec_helpers.rb')
-rw-r--r--spec/support/helpers/features/blob_spec_helpers.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/helpers/features/blob_spec_helpers.rb b/spec/support/helpers/features/blob_spec_helpers.rb
new file mode 100644
index 00000000000..880a7249284
--- /dev/null
+++ b/spec/support/helpers/features/blob_spec_helpers.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+# These helpers help you interact within the blobs page and blobs edit page (Single file editor).
+module BlobSpecHelpers
+ include ActionView::Helpers::JavaScriptHelper
+
+ def set_default_button(type)
+ evaluate_script("localStorage.setItem('gl-web-ide-button-selected', '#{type}')")
+ end
+
+ def unset_default_button
+ set_default_button('')
+ end
+
+ def editor_value
+ evaluate_script('monaco.editor.getModels()[0].getValue()')
+ end
+
+ def set_editor_value(value)
+ execute_script("monaco.editor.getModels()[0].setValue('#{value}')")
+ end
+end