Feature: List DNA accounts

  Scenario: Listing all DNA accounts
    Given the following DNA accounts
      | sub          | name          | email                 |
      | sme-dna/2503 | Adalyn Adkins | adalyn.adkins@sme.com |
      | sme-dna/2399 | Brice Berry   | brice.berry@sme.com   |
      | sme-dna/1705 | Carol Cruz    | carol.cruz@sme.com    |
    And I authenticated as admin
    When I visit the accounts page
    Then I should see the following accounts
      | name          | email                 |
      | Carol Cruz    | carol.cruz@sme.com    |
      | Brice Berry   | brice.berry@sme.com   |
      | Adalyn Adkins | adalyn.adkins@sme.com |

  Scenario: Searching DNA accounts by person’s name
    Given the following DNA accounts
      | sub          | name          | email                 |
      | sme-dna/2503 | Adalyn Adkins | adalyn.adkins@sme.com |
      | sme-dna/2399 | Brice Berry   | brice.berry@sme.com   |
      | sme-dna/1705 | Carol Cruz    | carol.cruz@sme.com    |
    And I authenticated as admin
    When I visit the accounts page
    And I submit "carol" into the accounts search box
    Then I should see the following accounts
      | name       | email              |
      | Carol Cruz | carol.cruz@sme.com |
    And I should see "carol" in the DNA account search box

  Scenario: Searching DNA accounts by person’s email address
    Given the following DNA accounts
      | sub          | name          | email                 |
      | sme-dna/2503 | Adalyn Adkins | adalyn.adkins@sme.com |
      | sme-dna/2399 | Brice Berry   | brice.berry@sme.com   |
      | sme-dna/1705 | Carol Cruz    | carol.cruz@sme.com    |
    And I authenticated as admin
    When I visit the accounts page
    And I submit "ice.b" into the accounts search box
    Then I should see the following accounts
      | name        | email               |
      | Brice Berry | brice.berry@sme.com |
    And I should see "ice.b" in the DNA account search box

  Scenario: Visit a DNA account from its list entry
    Given the following DNA accounts
      | sub          | name          | email                 |
      | sme-dna-2503 | Adalyn Adkins | adalyn.adkins@sme.com |
      | sme-dna-2399 | Brice Berry   | brice.berry@sme.com   |
      | sme-dna-1705 | Carol Cruz    | carol.cruz@sme.com    |
    And I authenticated as admin
    When I visit the accounts page
    And I follow the link containing "Brice"
    Then I should see the account detail "Email" as "brice.berry@sme.com"
