884: Manage the user profile

 Test Case #:884

Test Case Name: Manage the user profile

System: OpenLMIS

Subsystem:requisition

Test case designed by: Paulina Borowa

Design Date:29.08.2016

Short description: As an administrator, I want to create, edit and save user records so that I can add new users and keep information updated.

Acceptance Criteria
Verify that: -User Name (string), first name (string), last name (string), email (string with @), timezone, is verified are required -'Is verified?' attribute is boolean. -data entry error handling is enforced if one of the required fields isn't completed

  • User Name (string)
  • First Name (string)
  • Last Name (string)
  • Email (includes a @ and string)
  • Timezone (select from a list of timezones)
  • Home facility - selection of defined facilities
  • Is verified? - (boolean)
  • Restrict Login? - (boolean)
    The above definitions are enforced


                                                                                                                                                   

Pre – conditions:

Generate access token in URL: http://localhost:8081/oauth/token?grant_type=password&username=admin&password=password       

In openlmis-notification repository send an email notification

In Url: http://localhost:8080/notification?access_token=7b928858-09e9-44e8-8508-419413225e11

Method: Post

Body:

{
"from":"notification",
"to":"testowesoldevelo@gmail.com", 
"subject":"subject2",
"content":"content"
}

                                                                                                                                                                                                                                         


Step

Action

Expected system response

Comment

1

                                                                  

Create User enity.

In Url:  http://localhost:8080/api/users?access_token=d581abdb-5dfd-4dde-9332-b0283de852c8

Method: Post

Body:

{

    "username": "UserName",

    "timezone": "timezone",

    "verified":true,

    "lastName": "LAstNAme",

    "firstName": "FirstNAme",

    "email": "test@open.op",

    "active":true,

    "restrictLogin":false

}

                    

Status 200 OK,

                   id: "78b08224-5a2d-49d9-8b13-349da5b64933",                           


2

Check enpoint:  http://localhost:8081/api/users?access_token=d581abdb-5dfd-4dde-9332-b0283de852c8

Method: Get

Status 200 OK

It should be visible created by us earlier User entity

3

Edit previously created User enity.

In Url:  http://localhost:8080/api/users?access_token=d581abdb-5dfd-4dde-9332-b0283de852c8

Method: Post

Body:

{

id: "78b08224-5a2d-49d9-8b13-349da5b64933",  

    "username": "UserName2",

    "timezone": "timezone2",

    "verified":true,

    "lastName": "LAstNAme2",

    "firstName": "FirstNAme2",

    "email": "test@open.op",

    "active":false,

    "restrictLogin":true

}

Status 200 OK


4

Check enpoint:  http://localhost:8081/api/users?access_token=d581abdb-5dfd-4dde-9332-b0283de852c8

Method: Get

Previously displayed data for the user should change 

5

Check: data entry error handling is enforced if one of the required fields isn't completed

In Url:  http://localhost:8080/api/users?access_token=d581abdb-5dfd-4dde-9332-b0283de852c8

Method: Post

e.g Body:

{

"username":"NameUser",

    "timezone": "werwe3rwe",

    "verified":true,

    "active":true,

    "restrictLogin":true

}


Status 400 Bad request

User Name (string), first name (string), last name (string), email (string with @), timezone, is verified are required
6

Check validation for email

e.g : "email": "1231231231231",

Status 400 Bad request

  "email": "invalid email address"

Email (includes a @ and string)

OpenLMIS: the global initiative for powerful LMIS software