Skip to content

Commit

Permalink
Complete first API Testing in BDD Cucumber format
Browse files Browse the repository at this point in the history
  • Loading branch information
Trong Bui committed Sep 7, 2018
1 parent c05d683 commit 1da838c
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 154 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Expand Up @@ -25,5 +25,4 @@ Libs/TempTestCase*.groovy
Libs/TempTestSuite*.groovy
Reports
settings/internal/com.kms.katalon.integration.analytics.properties
settings/internal/com.kms.katalon.integration.jira.properties
/bin/
settings/internal/com.kms.katalon.integration.jira.properties
44 changes: 22 additions & 22 deletions .project
Expand Up @@ -17,59 +17,59 @@
</natures>
<linkedResources>
<link>
<name>kat-1669811482336409966.groovy</name>
<name>kat-1295273861446822252.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1669811482336409966.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1295273861446822252.groovy</location>
</link>
<link>
<name>kat-1704307189303610782.groovy</name>
<name>kat-1638290714660208829.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1704307189303610782.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1638290714660208829.groovy</location>
</link>
<link>
<name>kat-1984890298650841051.groovy</name>
<name>kat-1704307189303610782.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1984890298650841051.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-1704307189303610782.groovy</location>
</link>
<link>
<name>kat-2082499429580856975.groovy</name>
<name>kat-177247591030885814.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2082499429580856975.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-177247591030885814.groovy</location>
</link>
<link>
<name>kat-2094502213246885900.groovy</name>
<name>kat-3928486917085249804.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2094502213246885900.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-3928486917085249804.groovy</location>
</link>
<link>
<name>kat-2461450185273565221.groovy</name>
<name>kat-4681599118344847506.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2461450185273565221.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-4681599118344847506.groovy</location>
</link>
<link>
<name>kat-2695452944721539206.groovy</name>
<name>kat-5224990786095436527.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2695452944721539206.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-5224990786095436527.groovy</location>
</link>
<link>
<name>kat-2778759859144219577.groovy</name>
<name>kat-5718400979144253748.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2778759859144219577.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-5718400979144253748.groovy</location>
</link>
<link>
<name>kat-2950320051807872903.groovy</name>
<name>kat-6144188766038775723.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-2950320051807872903.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-6144188766038775723.groovy</location>
</link>
<link>
<name>kat-7690014536484327978.groovy</name>
<name>kat-6424984017109698085.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-7690014536484327978.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-6424984017109698085.groovy</location>
</link>
<link>
<name>kat-924510469902903171.groovy</name>
<name>kat-9033194318508749475.groovy</name>
<type>1</type>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-924510469902903171.groovy</location>
<location>/var/folders/42/25_dz67d0s90tq1kph29hdy00000gp/T/Katalon/Web Services/kat-9033194318508749475.groovy</location>
</link>
</linkedResources>
<filteredResources>
Expand Down
@@ -1,4 +1,4 @@
@IssueTests
@Issue_Tests
Feature: Verify issue information

@Get_By_Id
Expand All @@ -7,5 +7,5 @@ Feature: Verify issue information
When I get information of an issue with Id "KD-1"
Then I get response code "200"
And The issue information as below:
|project_key |issue_type |priority |summary |
|KD |Bug |Low |The issue type is not correct|
|project_key |issue_type |priority |summary |
|KD |Bug |Low |REST - Create new issue using API|
13 changes: 13 additions & 0 deletions Include/scripts/groovy/CommonAPISteps.groovy
Expand Up @@ -8,6 +8,8 @@ import cucumber.api.java.en.Then
import cucumber.api.java.en.When
import io.cucumber.datatable.DataTable

import static org.assertj.core.api.Assertions.*


class CommonAPISteps {
static response
Expand All @@ -31,5 +33,16 @@ class CommonAPISteps {

@Then('^The issue information as below:$')
def the_issue_information_as_below(DataTable data) {
List<Map<String, String>> issue_info = data.asMaps(String.class, String.class);
println issue_info[0]

// Verify project information
WS.verifyElementPropertyValue(response, 'fields.project.key', issue_info[0].project_key)

// Verify issue information
WS.verifyElementPropertyValue(response, 'fields.summary', issue_info[0].summary)
WS.verifyElementPropertyValue(response, 'fields.priority.name', issue_info[0].priority)
WS.verifyElementPropertyValue(response, 'fields.issuetype.name', issue_info[0].issue_type)

}
}
21 changes: 0 additions & 21 deletions Libs/TempTempCase1536259706871.groovy

This file was deleted.

21 changes: 0 additions & 21 deletions Libs/TempTempCase1536263551291.groovy

This file was deleted.

21 changes: 0 additions & 21 deletions Libs/TempTempCase1536263577184.groovy

This file was deleted.

21 changes: 0 additions & 21 deletions Libs/TempTempCase1536265042113.groovy

This file was deleted.

21 changes: 0 additions & 21 deletions Libs/TempTempCase1536265378342.groovy

This file was deleted.

21 changes: 0 additions & 21 deletions Libs/TempTempCase1536265573383.groovy

This file was deleted.

Expand Up @@ -70,7 +70,6 @@ WS.verifyElementPropertyValue(response, 'fields.project.name', 'Katalon-Demo')
WS.verifyElementPropertyValue(response, 'fields.summary', 'REST - Create new issue using API')
WS.verifyElementPropertyValue(response, 'fields.description', 'As a User, I want to be able to create a new tickets, so that I can keep track all tasks')
WS.verifyElementPropertyValue(response, 'fields.issuetype.name', 'Bug')

</verificationScript>
<wsdlAddress></wsdlAddress>
</WebServiceRequestEntity>

0 comments on commit 1da838c

Please sign in to comment.