2017-11-03 17:48:09 +08:00
|
|
|
Given(/^I'm on "([^"]*)" team settings page$/) do |team_name|
|
|
|
|
team = Team.find_by_name(team_name)
|
2018-01-31 19:05:45 +08:00
|
|
|
visit team_path(team)
|
2017-11-03 17:48:09 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^I click on "(.+)" action button within Team members table$/) do |email|
|
|
|
|
mail_td = find('td', text: /\A#{email}\z/)
|
|
|
|
parent = mail_td.first(:xpath, './/..')
|
2018-01-31 19:05:45 +08:00
|
|
|
parent.find('[type="button"]').click
|
2017-11-03 17:48:09 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^I click "(.+)" link within "(.+)" actions dropdown within Team members table$/) do |role, email|
|
|
|
|
mail_td = find('td', text: /\A#{email}\z/)
|
|
|
|
parent = mail_td.first(:xpath, './/..')
|
|
|
|
within(parent) do
|
|
|
|
click_link role
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^I should see "(.+)" in Role column of "(.+)" within Team members table$/) do |role, email|
|
2017-11-06 21:26:01 +08:00
|
|
|
wait_for_ajax
|
2017-11-07 18:29:37 +08:00
|
|
|
sleep 0.3
|
2017-11-03 17:48:09 +08:00
|
|
|
mail_td = find('td', text: /\A#{email}\z/)
|
|
|
|
parent = mail_td.first(:xpath, './/..')
|
|
|
|
expect(parent).to have_css('td', text: /\A#{role}\z/)
|
|
|
|
end
|
|
|
|
|
|
|
|
Then(/^I should not see "([^"]*)" in Team members table$/) do |email|
|
|
|
|
expect(page).to have_no_css('td', text: /\A#{email}\z/)
|
|
|
|
end
|
2018-01-31 19:05:45 +08:00
|
|
|
|
|
|
|
Then(/^I click on team title$/) do
|
|
|
|
find('#team-name').click
|
|
|
|
end
|