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 'qa/qa/page/file/show.rb')
-rw-r--r--qa/qa/page/file/show.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/qa/qa/page/file/show.rb b/qa/qa/page/file/show.rb
index 665b3c34dcc..28b6b3be154 100644
--- a/qa/qa/page/file/show.rb
+++ b/qa/qa/page/file/show.rb
@@ -46,8 +46,16 @@ module QA
has_no_element?(:file_name_content, text: name)
end
- def has_file_content?(text)
- has_element?(:file_content, text: text)
+ def has_file_content?(file_content, file_number = nil)
+ if file_number
+ within_element_by_index(:file_content, file_number - 1) do
+ has_text?(file_content)
+ end
+ else
+ within_element(:file_content) do
+ has_text?(file_content)
+ end
+ end
end
end
end