diff options
author | Walmyr Lima <walmyr@gitlab.com> | 2019-07-05 21:15:22 +0300 |
---|---|---|
committer | Walmyr Lima <walmyr@gitlab.com> | 2019-07-05 21:15:22 +0300 |
commit | 7c8ce1fe1733761a444c9a203c04ce4853137847 (patch) | |
tree | 0b0350438b73732d2422b107692462ea34604a35 /qa | |
parent | 10b307083ca86673ac48fe0243ab80222b1fbd4c (diff) |
Refactor end-to-end test
- to be explicit when fabricating resources via API or browser UI
- and to improve test speed by fabricating some resources via API
instead of via the GUI.
Diffstat (limited to 'qa')
-rw-r--r-- | qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb index 013cea0a40e..5eceeb9661c 100644 --- a/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb +++ b/qa/qa/specs/features/browser_ui/2_plan/issue/check_mentions_for_xss_spec.rb @@ -9,12 +9,12 @@ module QA Runtime::Browser.visit(:gitlab, Page::Main::Login) Page::Main::Login.perform(&:sign_in_using_credentials) - user = Resource::User.fabricate! do |user| + user = Resource::User.fabricate_via_api! do |user| user.name = "eve <img src=x onerror=alert(2)<img src=x onerror=alert(1)>" user.password = "test1234" end - project = Resource::Project.fabricate! do |resource| + project = Resource::Project.fabricate_via_api! do |resource| resource.name = 'xss-test-for-mentions-project' end project.visit! @@ -24,10 +24,11 @@ module QA page.add_member(user.username) end - Resource::Issue.fabricate_via_browser_ui! do |issue| + issue = Resource::Issue.fabricate_via_api! do |issue| issue.title = issue_title issue.project = project end + issue.visit! Page::Project::Issue::Show.perform do |show_page| show_page.select_all_activities_filter |