NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#
# test.feature
# This file lists out the steps in the Gherkin language for the test case DPO01-58320 update password for hospital admin
#
# Copyright (c) 2022 DePuy Synthes Inc. All rights reserved.
# THIS FILE CANNOT BE SHARED, MODIFIED OR REDISTRIBUTED WITHOUT THE WRITTEN PERMISSION OF DePuy Synthes Inc.

Feature: Test case for DPO01-58320

update password for hospital admin

Scenario Outline: This test verifies that the request to create a new surgeon is properly handled
Given [Step 1] the Application build number has been recorded
# There are some test steps which doesnt match with polarian as changed as per the need in automation
Given [Step 2] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 2] that the main database is up and running
When [Step 2] I execute the following query on the main database: "select * from previous_password where security_info_id = 1;"
Then [Step 2] the password information should be displayed
Given [Step 3] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 3] I am logged on as a hospital admin
When [Step 3] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/<ID>?newPassword=<new_password>&currentPassword=<correct_current_password>'
Then [Step 3] password should be updated
And [Step 3] the response code is '204 No Content'
Given [Step 4] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 4] that the logging database is up and running
When [Step 4] I execute the following query on the logging database: "select a.*, b.* from log a, internal_log b where a.log_id = b.log_id and a.type = 'ConsoleLog' and a.source like '%::TryUpdatePassword';"
Then [Step 4] the result of the query should display the log id and details
Given [Step 5] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 5] that the main database is up and running
When [Step 5] I execute the following query on the main database: "select * from previous_password where security_info_id = 1;"
Then [Step 5] the password information should be displayed
#And [Step 5] it should be 1 more row than was noted in above step
Given [Step 6] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 6] I am logged on using updated password 'robonyHENewFirst' as a hospital admin
When [Step 6] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/<ID>?newPassword=<new_password>&currentPassword=<wrong_current_password>'
# When [Step 6] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/1? newPassword=NEW&currentPassword=CURRENT'
#And [Step 6] I give my ID, new password, and wrong current password
#And [Step 6] I call the API
Then [Step 6] the error message should be: '{"RemainingLoginAttempts": 9, "Errors": [], "ErrorCode": "InvalidCredentials"}'
And [Step 6] the response code should be '401 Unauthorized'
And [Step 6] the password should not be updated
Given [Step 7] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 7] I am logged on using updated password 'robonyHENewFirst' as a hospital admin
When [Step 7] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/<ID>?newPassword=<new_password>&currentPassword=<new_password>'
#And [Step 7] I give my ID, previously used new password, and current password
#And [Step 7] I call the API
Then [Step 7] the error message should be: '{"Errors": ["PasswordReuse"], "ErrorCode": "InvalidPassword"}'
And [Step 7] the response code should be '400 Bad Request'
And [Step 7] the password should not be updated
Given [Step 8] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 8] I am logged on as a Surgeon
When [Step 8] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/<ID>?newPassword=<2nd_new_password>&currentPassword=<new_password>'
#And [Step 8] I give the ID, new password, and current password
#And [Step 8] I call the API
Then [Step 8] password should be updated
And [Step 8] the response code is '204 No Content'
Given [Step 9] that I'm using the proper tool per the Equipment/Test Setup above
And [Step 9] I am logged on using updated password 'robonyHE2NewFirst' as a hospital admin
When [Step 9] I am in the PUT API 'localhost:3000/api/v1/authentication/password/hospitalEngineer/<ID>?newPassword=<3rd_new_password>&currentPassword=<2nd_new_password>'
#And [Step 9] I give the ID, new password, and current password
#And [Step 9] I call the API
Then [Step 9] password should be updated
And [Step 9] the response code is '204 No Content'
Given [Step 9] that I'm using the proper tool per the Equipment/Test Setup above
When [Step 9] I restart the service
And [Step 9] I try to login as the hospital admin that was updated with the new password 'robonyHE3NewFirst'



Examples:
| ID | new_password | correct_current_password | wrong_current_password | 2nd_new_password | 3rd_new_password |
| 1 | robonyHENewFirst | robonyHEFirst | robonyHEOne | robonyHE2NewFirst | robonyHE3NewFirst |




# -*- coding: utf-8 -*-


@When("[Step |any|] I try to login as the hospital admin that was updated with the new password '|any|'")
@Given("[Step |any|] I am logged on using updated password '|any|' as a hospital admin")
def step(context, step_num, password):
test.log(f"[step {step_num}]")
global apicl
if not apicl:
apicl = ApiClient()
resp = apicl.post(path="authentication/login/" + "1", body=password)
test.log(f"Login API response: {resp}")
test.compare(resp[0], 200, "The API was successfully requested")
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.