[ARVADOS] updated: d322fffbaa6eccc23c86f3271641845072f127e8

git at public.curoverse.com git at public.curoverse.com
Thu Aug 14 14:17:15 EDT 2014


Summary of changes:
 apps/workbench/app/mailers/issue_reporter.rb       |  4 +-
 .../views/application/_report_issue_popup.html.erb | 10 ++-
 .../test/integration/application_layout_test.rb    | 73 +++++++++++++++++++++-
 3 files changed, 81 insertions(+), 6 deletions(-)

       via  d322fffbaa6eccc23c86f3271641845072f127e8 (commit)
      from  a15dde47e5ab8a562a03f04d65a7c2bc9369a4ff (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit d322fffbaa6eccc23c86f3271641845072f127e8
Author: radhika <radhika at curoverse.com>
Date:   Thu Aug 14 14:15:07 2014 -0400

    3112: add tests for the new show version info and report problem buttons in help menu. yes, the tests did uncover a couple edge cases not covered by manual testing.

diff --git a/apps/workbench/app/mailers/issue_reporter.rb b/apps/workbench/app/mailers/issue_reporter.rb
index 533883b..5f3cf13 100644
--- a/apps/workbench/app/mailers/issue_reporter.rb
+++ b/apps/workbench/app/mailers/issue_reporter.rb
@@ -5,6 +5,8 @@ class IssueReporter < ActionMailer::Base
   def send_report(user, params)
     @user = user
     @params = params
-    mail(subject: 'Issue reported')
+    subject = 'Issue reported'
+    subject += " by #{@user.email}" if @user
+    mail(subject: subject)
   end
 end
diff --git a/apps/workbench/app/views/application/_report_issue_popup.html.erb b/apps/workbench/app/views/application/_report_issue_popup.html.erb
index 105af38..4a56fde 100644
--- a/apps/workbench/app/views/application/_report_issue_popup.html.erb
+++ b/apps/workbench/app/views/application/_report_issue_popup.html.erb
@@ -1,7 +1,8 @@
 <%
   api_version = arvados_api_client.discovery[:source_version]
   generated_at = arvados_api_client.discovery[:generatedAt]
-  wb_version = Rails.configuration.source_version + ' ' + Rails.configuration.local_modified
+  wb_version = Rails.configuration.source_version
+  wb_version += Rails.configuration.source_version if Rails.configuration.local_modified
   arvados_base = Rails.configuration.arvados_v1_base
   support_email = Rails.configuration.support_email_address
 
@@ -17,7 +18,10 @@
   additional_info['arvados_base'] = arvados_base
   additional_info['support_email'] = support_email
   additional_info['error_message'] = @popup_params[:error_message] if @popup_params[:error_message]
+  additional_info['api_error_request_url'] = @popup_params[:api_error_request_url] if @popup_params[:api_error_request_url]
+  additional_info['api_error_response'] = @popup_params[:api_error_response] if @popup_params[:api_error_response]
 %>
+
 <div class="modal-dialog modal-with-loading-spinner">
   <div class="modal-content">
 
@@ -47,7 +51,7 @@
         </div>
 
         <div class="form-group">
-          <label for="server_version" class="col-sm-4 control-label"> Server Version </label>
+          <label for="server_version" class="col-sm-4 control-label"> Server version </label>
           <div class="col-sm-8">
             <p class="form-control-static" name="server_version"><%=api_version%></p>
           </div>
@@ -76,7 +80,7 @@
 
         <% if @popup_params[:popup_type] == 'report' %>
           <div class="form-group">
-            <label for="report_text" class="col-sm-4 control-label"> Report text </label>
+            <label for="report_text_label" class="col-sm-4 control-label"> Report text </label>
             <div class="col-sm-8">
               <textarea class="form-control" rows="1" name="report_text" type="text"/>
             </div>
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 8a0ebc3..9b1085a 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -64,15 +64,64 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
   end
 
   # test the help menu
-  def check_help_menu
+  def check_help_menu user
     within('.navbar-fixed-top') do
       page.find("#arv-help").click
       within('.dropdown-menu') do
         assert page.has_link? 'Tutorials and User guide'
         assert page.has_link? 'API Reference'
         assert page.has_link? 'SDK Reference'
+        assert page.has_link? 'Show version / debugging info'
+        assert page.has_link? 'Report a problem'
+
+        # check show version info link      
+        click_link 'Show version / debugging info'
       end
     end
+
+    if user && user['is_active']  # TBD - no user as well as inactive user also should be able to report issue
+    within '.modal-content' do
+      assert page.has_text? 'Version / debugging info'
+      assert page.has_no_text? 'Report a problem'
+      assert page.has_text? 'Server version'
+      assert page.has_text? 'Server restarted at'
+      assert page.has_text? 'Workbench version'
+      assert page.has_text? 'Arvados base'
+      assert page.has_text? 'Additional info'
+      assert page.has_no_text? 'Report text'
+      assert page.has_button? 'Close'
+      assert page.has_no_button? 'Report issue'
+      click_button 'Close'
+    end
+
+    # check report issue link      
+    within('.navbar-fixed-top') do
+      page.find("#arv-help").click
+      within('.dropdown-menu') do
+        click_link 'Report a problem'
+      end
+    end
+
+    within '.modal-content' do
+      assert page.has_text? 'Report a problem'
+      assert page.has_no_text? 'Version / debugging info'
+      assert page.has_text? 'Server version'
+      assert page.has_text? 'Server restarted at'
+      assert page.has_text? 'Workbench version'
+      assert page.has_text? 'Arvados base'
+      assert page.has_text? 'Additional info'
+      assert page.has_text? 'Report text'
+      assert page.has_no_button? 'Close'
+      assert page.has_button? 'Report issue'
+      assert page.has_button? 'Cancel'
+
+      # enter a report text and click on report
+      page.find_field('report_text').set 'my test report text'
+      click_button 'Report issue'
+    end
+    end   # TBD - when no user and inactive user work, this should go away
+
+    assert page.has_no_text? 'Version / debugging info'
   end
 
   def verify_system_menu user
@@ -226,6 +275,21 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
       # we should see 'not found' error page
       assert page.has_text? 'Not Found'
+      assert page.has_link? 'Report problem'
+      click_link 'Report problem'
+      within '.modal-content' do
+        assert page.has_text? 'Report a problem'
+        assert page.has_no_text? 'Version / debugging info'
+        assert page.has_text? 'Server version'
+        assert page.has_text? 'Server restarted at'
+        assert page.has_text? 'Report text'
+        assert page.has_button? 'Report issue'
+        assert page.has_button? 'Cancel'
+
+        # enter a report text and click on report
+        page.find_field('report_text').set 'my test report text'
+        click_button 'Report issue'
+      end
 
       # let's search for the anonymously accessible project
       publicly_accessible_project = api_fixture('groups')['anonymously_accessible_project']
@@ -261,6 +325,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
     ['active_no_prefs', api_fixture('users')['active_no_prefs'], true, false],
     ['active_no_prefs_profile', api_fixture('users')['active_no_prefs_profile'], true, false],
   ].each do |token, user, invited, has_profile|
+
     test "visit home page when profile is configured for user #{token}" do
       # Our test config enabled profile by default. So, no need to update config
       if !token
@@ -291,14 +356,16 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
         visit page_with_token(token)
       end
 
-      check_help_menu
+      check_help_menu user
     end
+
   end
 
   [
     ['active', api_fixture('users')['active'], true, true],
     ['admin', api_fixture('users')['admin'], true, true],
   ].each do |token, user|
+
     test "test system menu for user #{token}" do
       visit page_with_token(token)
       verify_system_menu user
@@ -313,5 +380,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       visit page_with_token(token)
       verify_search_box user
     end
+
   end
+
 end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list