Skip to content

Commit

Permalink
use cuprite in members pagination spec
Browse files Browse the repository at this point in the history
  • Loading branch information
toy committed Nov 21, 2024
1 parent 82bb693 commit 48588fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
8 changes: 1 addition & 7 deletions spec/features/members/pagination_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

require "spec_helper"

RSpec.describe "members pagination", :js do
RSpec.describe "members pagination", :js, :with_cuprite do
shared_let(:admin) { create(:admin) }
let(:project) do
create(:project,
Expand Down Expand Up @@ -59,11 +59,9 @@
members_page.set_items_per_page! 2

members_page.visit!
SeleniumHubWaiter.wait
expect(members_page).to have_user "Alice Alison" # members are sorted by last name desc
members_page.add_user! "Peter Pan", as: "Manager"

SeleniumHubWaiter.wait
members_page.go_to_page! 2
expect(members_page).to have_user "Peter Pan"
end
Expand All @@ -82,12 +80,10 @@
members_page.set_items_per_page! 1

members_page.visit!
SeleniumHubWaiter.wait
members_page.remove_user! "Alice Alison"
expect_and_dismiss_flash message: "Removed Alice Alison from project"
expect(members_page).to have_user "Bob Bobbit"

SeleniumHubWaiter.wait
members_page.go_to_page! 2
expect(members_page).to have_user "Peter Pan"
end
Expand All @@ -98,13 +94,11 @@
members_page.set_items_per_page! 1

members_page.visit!
SeleniumHubWaiter.wait
members_page.go_to_page! 2
members_page.edit_user! "Bob Bobbit", add_roles: ["Developer"]
expect(page).to have_text "Successful update"
expect(members_page).to have_user "Bob Bobbit", roles: ["Developer", "Manager"]

SeleniumHubWaiter.wait
members_page.go_to_page! 1
expect(members_page).to have_user "Alice Alison"
end
Expand Down
6 changes: 3 additions & 3 deletions spec/support/pages/members.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def open_filters!
def search_for_name(name)
fill_in "name", with: name
find(".simple-filters--controls input[type=submit]").click
wait_for_network_idle
wait_for_reload
end

def expect_menu_item(text, selected: false)
Expand Down Expand Up @@ -183,7 +183,7 @@ def edit_user!(name, add_roles: [], remove_roles: [])
Array(remove_roles).each { |role| uncheck role }

click_on "Change"
wait_for_network_idle
wait_for_reload
end

def has_group_membership?(user_name)
Expand Down Expand Up @@ -266,7 +266,7 @@ def expect_role(role_name, present: true)

def go_to_page!(number)
find(".op-pagination--pages a", text: number.to_s).click
wait_for_network_idle
wait_for_reload
end
end
end

0 comments on commit 48588fd

Please sign in to comment.