Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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