[ARVADOS] updated: 929fb274e4ab903a1bbfcde16f8b93882dfff883

git at public.curoverse.com git at public.curoverse.com
Mon Jan 4 18:44:47 EST 2016


Summary of changes:
 .../test/integration/application_layout_test.rb    | 92 ++++++++++------------
 .../test/fixtures/api_client_authorizations.yml    |  6 ++
 services/api/test/fixtures/users.yml               | 13 +++
 3 files changed, 61 insertions(+), 50 deletions(-)

       via  929fb274e4ab903a1bbfcde16f8b93882dfff883 (commit)
      from  dfbdc1ba1ae2d41aec76f6bd7a7afe538419a3f9 (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 929fb274e4ab903a1bbfcde16f8b93882dfff883
Author: radhika <radhika at curoverse.com>
Date:   Mon Jan 4 18:42:34 2016 -0500

    7607: Update application layout tests; by default getting_started is disabled and hence the help menu will not include this option.
    Also, added an additional test case for user with profile but no getting_started flag and expect the popup upon first login.

diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index db072e4..4a6a553 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -80,7 +80,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
     within('.navbar-fixed-top') do
       page.find("#arv-help").click
       within('.dropdown-menu') do
-        assert_selector 'a', text:'Getting Started ...'
+        assert_no_selector 'a', text:'Getting Started ...'
         assert_selector 'a', text:'Public Pipelines and Data sets'
         assert page.has_link?('Tutorials and User guide'), 'No link - Tutorials and User guide'
         assert page.has_link?('API Reference'), 'No link - API Reference'
@@ -130,65 +130,57 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
         visit page_with_token(token)
       end
 
-      verify_homepage user, invited, has_profile
-    end
-
-    test "check help for user #{token}" do
-      if !token
-        visit ('/')
-      else
-        visit page_with_token(token)
-      end
-
       check_help_menu
-    end
-
-    test "test system menu for user #{token}" do
-      if !token
-        visit ('/')
-      else
-        visit page_with_token(token)
-      end
-
+      verify_homepage user, invited, has_profile
       verify_system_menu user
     end
   end
 
-  test "test getting started help menu item" do
-    visit page_with_token('active')
-    within '.navbar-fixed-top' do
-      find('.help-menu > a').click
-      find('.help-menu .dropdown-menu a', text: 'Getting Started ...').click
-    end
-
-    within '.modal-content' do
-      assert_text 'Getting Started'
-      assert_selector 'button:not([disabled])', text: 'Next'
-      assert_no_selector 'button:not([disabled])', text: 'Prev'
+  [
+    ['active', true],
+    ['active_with_prefs_profile_no_getting_started_shown', false],
+  ].each do |token, getting_started_shown|
+    test "getting started help menu item #{getting_started_shown}" do
+      Rails.configuration.enable_getting_started_popup = true
+
+      visit page_with_token(token)
+
+      if getting_started_shown
+        within '.navbar-fixed-top' do
+          find('.help-menu > a').click
+          find('.help-menu .dropdown-menu a', text: 'Getting Started ...').click
+        end
+      end
 
-      # Use Next button to enable Prev button
-      click_button 'Next'
-      assert_selector 'button:not([disabled])', text: 'Prev'  # Prev button is now enabled
-      click_button 'Prev'
-      assert_no_selector 'button:not([disabled])', text: 'Prev'  # Prev button is again disabled
+      within '.modal-content' do
+        assert_text 'Getting Started'
+        assert_selector 'button:not([disabled])', text: 'Next'
+        assert_no_selector 'button:not([disabled])', text: 'Prev'
 
-      # Click Next until last page is reached and verify that it is disabled
-      (0..20).each do |i|   # currently we only have 4 pages, and don't expect to have more than 20 in future
+        # Use Next button to enable Prev button
         click_button 'Next'
-        begin
-          find('button:not([disabled])', text: 'Next')
-        rescue => e
-          break
+        assert_selector 'button:not([disabled])', text: 'Prev'  # Prev button is now enabled
+        click_button 'Prev'
+        assert_no_selector 'button:not([disabled])', text: 'Prev'  # Prev button is again disabled
+
+        # Click Next until last page is reached and verify that it is disabled
+        (0..20).each do |i|   # currently we only have 4 pages, and don't expect to have more than 20 in future
+          click_button 'Next'
+          begin
+            find('button:not([disabled])', text: 'Next')
+          rescue => e
+            break
+          end
         end
-      end
-      assert_no_selector 'button:not([disabled])', text: 'Next'  # Next button is disabled
-      assert_selector 'button:not([disabled])', text: 'Prev'     # Prev button is enabled
-      click_button 'Prev'
-      assert_selector 'button:not([disabled])', text: 'Next'     # Next button is now enabled
+        assert_no_selector 'button:not([disabled])', text: 'Next'  # Next button is disabled
+        assert_selector 'button:not([disabled])', text: 'Prev'     # Prev button is enabled
+        click_button 'Prev'
+        assert_selector 'button:not([disabled])', text: 'Next'     # Next button is now enabled
 
-      first('button', text: 'x').click
+        first('button', text: 'x').click
+      end
+      assert_text 'Active pipelines' # seeing dashboard now
     end
-    assert_text 'Active pipelines' # seeing dashboard now
   end
 
   test "test arvados_public_data_doc_url config unset" do
@@ -199,8 +191,8 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
       find('.help-menu > a').click
 
       assert_no_selector 'a', text:'Public Pipelines and Data sets'
+      assert_no_selector 'a', text:'Getting Started ...'
 
-      assert_selector 'a', text:'Getting Started ...'
       assert page.has_link?('Tutorials and User guide'), 'No link - Tutorials and User guide'
       assert page.has_link?('API Reference'), 'No link - API Reference'
       assert page.has_link?('SDK Reference'), 'No link - SDK Reference'
diff --git a/services/api/test/fixtures/api_client_authorizations.yml b/services/api/test/fixtures/api_client_authorizations.yml
index 85c2c79..7169ebd 100644
--- a/services/api/test/fixtures/api_client_authorizations.yml
+++ b/services/api/test/fixtures/api_client_authorizations.yml
@@ -211,6 +211,12 @@ active_no_prefs_profile_with_getting_started_shown:
   api_token: 3kg612cdc0f3415c245786758f33bdfb07babcd1b00e86qdmi
   expires_at: 2038-01-01 00:00:00
 
+active_with_prefs_profile_no_getting_started_shown:
+  api_client: untrusted
+  user: active_with_prefs_profile_no_getting_started_shown
+  api_token: 3kg612cdc0f3415c245786758f33bdfb07befgh1b00e86qdmi
+  expires_at: 2038-01-01 00:00:00
+
 user_foo_in_sharing_group:
   api_client: untrusted
   user: user_foo_in_sharing_group
diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml
index db9607b..b15ada1 100644
--- a/services/api/test/fixtures/users.yml
+++ b/services/api/test/fixtures/users.yml
@@ -245,6 +245,19 @@ active_no_prefs_profile_with_getting_started_shown:
     test: abc
     getting_started_shown: 2015-03-26 12:34:56.789000000 Z
 
+active_with_prefs_profile_no_getting_started_shown:
+  owner_uuid: zzzzz-tpzed-000000000000000
+  uuid: zzzzz-tpzed-nogettinstarted
+  email: active_nogettinstarted at arvados.local
+  first_name: HasPrefsProfile
+  last_name: NoGettingStartedShown
+  identity_url: https://active_nogettinstarted.openid.local
+  is_active: true
+  prefs:
+    profile:
+      organization: example.com
+      role: Computational biologist
+
 # Fixtures to test granting and removing permissions.
 
 user_foo_in_sharing_group:

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list