*** Settings ***
Documentation All Test cases related to NES api
Library RequestsLibrary
Force Tags API
Library Collections
Library OperatingSystem
*** Test Cases ***
Login to NES by Token
[
Documentation]
This test case will login to NES by BasicLoginWithToken
...
...
TestRail: https://nymi.testrail.net/index.php?/cases/view/201568&group_by=cases:section_id&group_id=27003&group_order=asc&display_deleted_cases=0
[
Tags] C201568
#Run Keyword And Ignore Error Suppress Insecure Request Warning
#${cert_params}= Create Dictionary verify=${CERTIFICATE_PATH}
#Set Library Search Order Collections OperatingSystem RequestsLibrary
#Filter Warnings ignore::urllib3.exceptions.InsecureRequestWarning
Set Environment Variable REQUESTS_CA_BUNDLE
${CERTIFICATE_PATH}
Create Session API_NES_Basic_Auth
${NES_Link} verify=
${CERTIFICATE_PATH}
${headers}=
Create Dictionary Content-Type=application/json
${payload}=
Create Dictionary Username=nesadmin
Password=9ym1@123$
${response}=
POST On Session API_NES_Basic_Auth /BasicLoginWithToken
headers=
${headers} json=
${payload}
Should Be Equal As Strings ${response.status_code} 200
Should Contain ${response.json()} Expected value
*** Keywords ***
Sign in to NES
Create Session Chrome
${NES_Link}
Suppress Insecure Request Warning
${is_secure} =
Run Keyword And Return Status Evaluate sys.modules.get('requests') is not None
Run Keyword If ${is_secure} Suppress Warnings
Suppress Warnings
[
Documentation]
Suppresses the InsecureRequestWarning
[
Tags] setup
Run Keyword Evaluate import warnings; warnings.filterwarnings("ignore", category=InsecureRequestWarning)
*** Variables ***
${NES_Link} https://nes.qalab.nymi.com/npm554/api${CERTIFICATE_PATH} C:\\Users\\shpatil.qalab\\New folder.pem