Skip to content

Commit a6bf8c4

Browse files
committed
Added logging & fixed chapter-1 tests
1 parent 852ad75 commit a6bf8c4

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

build.gradle

+3
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@ task runTests(type: Test) {
2020
useTestNG {
2121
useDefaultListeners = true
2222
}
23+
testLogging {
24+
events 'passed', 'skipped', 'failed'
25+
}
2326
}
2427

src/test/java/Chapters/Chapter01/FirstChapterTests.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
public class FirstChapterTests {
1212

13-
private static final String BASE_URL = "http://petstore.swagger.io/v2";
13+
private static final String BASE_URL = "https://petstore.swagger.io/v2";
1414

1515
// In this test, we are going to test a GET API and validate the Response
1616
@Test
@@ -22,7 +22,7 @@ public void sendAGETRequestAndValidateResponse() {
2222
.then()
2323
.statusCode(200) // It verify the actual response code with the given code
2424
.body("[0].id", notNullValue()) // Checking whether value is Not_Null or not
25-
.body("[0].category.name", notNullValue())
25+
.body("[0].name", notNullValue())
2626
.body("[0].status", equalTo("sold")); // Checking status is equal to "sold"
2727
}
2828

@@ -35,7 +35,7 @@ public void sendAGETRequestByPassingQueryParameterInURL() {
3535
.then()
3636
.statusCode(200)
3737
.body("[0].id", notNullValue())
38-
.body("[0].category.name", notNullValue())
38+
.body("[0].name", notNullValue())
3939
.body("[0].status", equalTo("sold"));
4040
}
4141

0 commit comments

Comments
 (0)