[ARVADOS] updated: 4d0866e5d005b1c1631c80809a4757037b6dac1b
git at public.curoverse.com
git at public.curoverse.com
Mon Jul 21 16:55:49 EDT 2014
Summary of changes:
apps/workbench/test/integration/projects_test.rb | 30 ++++++++++++++----------
1 file changed, 17 insertions(+), 13 deletions(-)
via 4d0866e5d005b1c1631c80809a4757037b6dac1b (commit)
from eea48f38868d0663e7c8d690247b84e340109dc4 (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 4d0866e5d005b1c1631c80809a4757037b6dac1b
Author: Brett Smith <brett at curoverse.com>
Date: Mon Jul 21 16:57:07 2014 -0400
2044: Make project sharing tests more forgiving of Ajax timing.
Apparently waiting our default 5 seconds is not always sufficient to
get an Ajax response that requires a roundtrip to the API server.
Wait longer in these cases. Not the most elegant solution, but I
don't see a better option. Refs #2044.
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index eb38cfd..adac0bf 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -89,25 +89,27 @@ class ProjectsTest < ActionDispatch::IntegrationTest
assert(page.has_text?("A Project"), "not on expected project page")
end
- def count_shares
- find('#project_sharing').all('tr').size
+ def share_rows
+ find('#project_sharing').all('tr')
end
def add_share_and_check(share_type, name)
assert(page.has_no_text?(name), "project is already shared with #{name}")
- start_share_count = count_shares
+ start_share_count = share_rows.size
click_on("Share with #{share_type}")
find(".selectable", text: name).click
find(".modal-footer a,button", text: "Add").click
- assert(page.has_link?(name),
- "new share was not added to sharing table")
- assert_equal(start_share_count + 1, count_shares,
- "new share did not add row to sharing table")
+ using_wait_time(Capybara.default_wait_time * 3) do
+ assert(page.has_link?(name),
+ "new share was not added to sharing table")
+ assert_equal(start_share_count + 1, share_rows.size,
+ "new share did not add row to sharing table")
+ end
end
def modify_share_and_check(name)
- start_share_count = count_shares
- link_row = all("#project_sharing tr").select { |row| row.has_text?(name) }
+ start_rows = share_rows
+ link_row = start_rows.select { |row| row.has_text?(name) }
assert_equal(1, link_row.size, "row with new permission not found")
within(link_row.first) do
click_on("Read")
@@ -117,10 +119,12 @@ class ProjectsTest < ActionDispatch::IntegrationTest
"failed to change access level on new share")
click_on "Revoke"
end
- assert(page.has_no_text?(name),
- "new share row still exists after being revoked")
- assert_equal(start_share_count - 1, count_shares,
- "revoking share did not remove row from sharing table")
+ using_wait_time(Capybara.default_wait_time * 3) do
+ assert(page.has_no_text?(name),
+ "new share row still exists after being revoked")
+ assert_equal(start_rows.size - 1, share_rows.size,
+ "revoking share did not remove row from sharing table")
+ end
end
test "project viewer can't see project sharing tab" do
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list