Skip to content

Commit 61c1c8e

Browse files
committed
added RESTInstance library
1 parent f34228c commit 61c1c8e

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ The purpose of the project is to display Keyword driven framework for web applic
1313
* Data driven Testing Framework : Excellib (2.0.0)
1414
* Object Repository Design Pattern : Page Object Model
1515
* Test Execution Report: Robotframework HTML
16-
* Test Execution Mode: Parallel (usin Pabot(1.7.0))
16+
* Test Execution Mode: Parallel (using Pabot(1.7.0))
1717
* Browser Compatibility: Chrome and HeadlessChrome
1818
* Screenshot: Take screen shot API to cover the flow and caputer invalid screenshots
1919
* Implicit and explicit wait
20-
* Mouse action, Dropdown, Handling new tabs/windows,Scrolls,HTML Tables and handling browser Popup
20+
* Features: Mouse action, Dropdown, Handling new tabs/windows,Scrolls,HTML Tables and handling browser Popup, REST API(RESTInstance), JSONLibrary, String & BuiltIn Keywords
2121

2222
## Project Structure
2323

Requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ robotframework-pabot
44
robotframework-datadriver
55
xlrd
66
robotframework-excellib
7-
robotframework-requests
7+
robotframework-requests
8+
robotframework-Jsonlibrary
9+
RestInstance
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
*** Settings ***
2+
Library REST https://waheedahmed55.testrail.io/
3+
Library OperatingSystem
4+
Library JSONLibrary
5+
Library String
6+
7+
*** Variables ***
8+
${headers} {"Content-Type":"application/json","Authorization":"Basic d2FoZWVkYWhtZWQ1NUBnbWFpbC5jb206VUhnRFdmVlhkczRFSnRMNVZsUVg="}
9+
${SuiteJson} {"name":"This is a new test suite","description": "Use the description to add additional context details"}
10+
${SectionJson} {"name":"Automated Section"}
11+
${CaseJson} {"title": "This is a test case","type_id": 1,"priority_id": 3,"estimate": "3m","custom_steps_separated": [{"content": "Step 1","expected": "Expected Result 1"},{"content": "Step 2","expected": "Expected Result 2"}]}
12+
${UpdateCaseJson} {"title": "This is a updated test case","type_id": 2,"priority_id": 2,"estimate": "15s","custom_steps_separated": [{"content": "Step 1","expected": "Expected Result 1"},{"content": "Step 2","expected": "Expected Result 2"}]}
13+
14+
*** Test Cases ***
15+
GET PROJECT
16+
&{resp}= GET index.php?/api/v2/get_project/1 headers=${headers}
17+
Output schema response body
18+
Output response body
19+
Should Contain ${resp.body}.name Demo
20+
Integer response body id 1
21+
String response body name DemoAutomation
22+
Integer response status 200
23+
Output response body ${EXECDIR}/Reports/temp.json
24+
25+
ADD SECTION
26+
POST index.php?/api/v2/add_section/1 body=${SectionJson} headers=${headers}
27+
Output response body ${CURDIR}/temp.json
28+
${json_object}= Load JSON From File ${CURDIR}/temp.json
29+
Remove File ${CURDIR}/temp.json
30+
${values}= Get Value From Json ${json_object} $.id
31+
Set Suite Variable ${Section_id} ${values[0]}
32+
Integer response status 200
33+
Integer response body id ${Section_id}
34+
35+
ADD CASE
36+
POST index.php?/api/v2/add_case/${Section_id} body=${CaseJson} headers=${headers}
37+
Output response body ${CURDIR}/temp.json
38+
${json_object}= Load JSON From File ${CURDIR}/temp.json
39+
Remove File ${CURDIR}/temp.json
40+
${values}= Get Value From Json ${json_object} $.id
41+
Set Suite Variable ${Case_id} ${values[0]}
42+
Integer response status 200
43+
Integer response body id ${Case_id}
44+
45+
UPDATE CASE
46+
POST index.php?/api/v2/update_case/${Case_id} body=${UpdateCaseJson} headers=${headers}
47+
Integer response status 200
48+
49+
DELETE CASE
50+
POST index.php?/api/v2/delete_case/${Case_id} body=${UpdateCaseJson} headers=${headers}
51+
Integer response status 200
52+
53+
DELETE SECTION
54+
POST index.php?/api/v2/delete_section/${Section_id} headers=${headers}
55+
Integer response status 200

0 commit comments

Comments
 (0)