Skip to content

Commit

Permalink
Added step definition to relevent feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
domducsutcliffe committed Jan 27, 2023
1 parent 188c61f commit e18097c
Show file tree
Hide file tree
Showing 27 changed files with 56 additions and 1 deletion.
21 changes: 21 additions & 0 deletions app/views/crown_marketplace/manage_users/_users_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,26 @@
<% end %>
</tbody>
</table>
<%else%>
<table class="govuk-table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header govuk-!-font-weight-bold" scope="col" width="60%"><%= t('.email') %></th>
<th class="govuk-table__header govuk-!-font-weight-bold" scope="col" width="15%"><%= t('.status') %></th>
<td class="govuk-table__header" width="15%"></td>
</tr>
</thead>
<tbody class="govuk-table__body">
<% users.each do %>
<tr class="govuk-table__row">
<td class="govuk-table__cell govuk-!-padding-right-2" style="word-break: break-all;"><%= user[:email] %></td>
<td class="govuk-table__cell govuk-!-padding-right-2"><%= govuk_tag_with_text(*enabled_disabled_status_tag(user[:account_status])) %></td>
<td class="govuk-table__cell govuk-!-padding-right-2">
<%= link_to(t('.view_user'), crown_marketplace_manage_user_path(cognito_uuid: user[:cognito_uuid]), class: 'govuk-link govuk-link--no-visited-state', aria: { label: t('.view_user_email', email: user[:email]) }) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%end%>

1 change: 1 addition & 0 deletions app/views/crown_marketplace/manage_users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
</div>
</div>


<div class="govuk-grid-row">
<div class="govuk-grid-column-three-quarters" id="users-table">
<%= render(partial: 'users_table', locals: { users: @search[:users] }) %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Manage users - Super admin - Edit user
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - Super admin - Resend temporary password
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario Outline: There is only a button for FORCE_CHANGE_PASSWORD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Manage users - Super admin - Edit user - Validations
When I click on 'Manage users'
Then I am on the 'Manage users' page
Given I am going to do a search to find users
Then I should not see users table
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
| Account enabled | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Feature: Manage users - Super admin - View user - Assorted Details
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users


Scenario Outline: View Buyer - Different confirmation status
And I search for '[email protected]' and there is a user with the following details:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Feature: Manage users - Super admin - View user - Full Details
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users


Scenario: View Buyer - Full details
And I search for '[email protected]' and there is a user with the following details:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ Feature: Manage users - Super admin - View user - Mixed Roles
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users



Scenario: View Buyer and service admin
And I search for '[email protected]' and there is a user with the following details:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - Super admin - View user - Something went wron
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' there are the following users:
| buyer@test.com | enabled |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - Edit user
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Manage users - User admin - Find users - JavaScript disabled
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table

Scenario: Try and find a user
Given I am going to do a search to find users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Manage users - User admin - Find users - JavaScript enabled
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for 'test@' and there are no users
And I enter 'test@' into the search
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Manage users - User admin - Resend temporary password
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario Outline: There is only a button for FORCE_CHANGE_PASSWORD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - Edit user - Validations
Given I sign in as an 'super admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ Feature: Manage users - User admin - Find users - JavaScript enabled - Validatio
And I click on 'Search'
Then I should see the following error for finding a user:
| You must enter an email address |
Then I should not see users table

Scenario: There is a service error
And I cannot find any user accounts because of the 'service' error
And I enter 'test' into the search
And I click on 'Search'
Then I should see the following error for finding a user:
| An error occured: service |
Then I should not see users table

Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@ Feature: Manage users - User admin - Find a users - JavaScript disabled - Valida
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table

Scenario: I enter no email - JavaScript disabled
And I click on 'Search'
Then I should see the following error for finding a user:
| You must enter an email address |
Then I should not see users table

Scenario: There is a service error
And I cannot find any user accounts because of the 'service' error
And I enter 'test' into the search
And I click on 'Search'
Then I should see the following error for finding a user:
| An error occured: service |
| An error occured: service |
Then I should not see users table
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - View user - Assorted Details
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario Outline: View Buyer - Different confirmation status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - View user - Full Details
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario: View Buyer - Full details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - View user - Mixed Roles
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario: View Buyer and service admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User admin - View user - Something went wron
Given I sign in as an 'user admin' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' there are the following users:
| buyer@test.com | enabled |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Feature: Manage users - User support - Edit user
When I click on 'Manage users'
Then I am on the 'Manage users' page
Given I am going to do a search to find users
Then I should not see users table
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
| Account enabled | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - Resend temporary password
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario Outline: There is only a button for FORCE_CHANGE_PASSWORD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - Edit user - Validations
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' and there is a user with the following details:
| Email verified | true |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - View user - Assorted Details
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario Outline: View Buyer - Different confirmation status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - View user - Full Details
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario: View Buyer - Full details
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - View user - Mixed Roles
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users

Scenario: View Buyer and service admin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Feature: Manage users - User support - View user - Something went wron
Given I sign in as an 'user support' user go to the crown marketplace dashboard
When I click on 'Manage users'
Then I am on the 'Manage users' page
Then I should not see users table
Given I am going to do a search to find users
And I search for '[email protected]' there are the following users:
| buyer@test.com | enabled |
Expand Down

0 comments on commit e18097c

Please sign in to comment.