Skip to content

Commit

Permalink
automation api testing
Browse files Browse the repository at this point in the history
  • Loading branch information
angelinevlnc committed Dec 1, 2023
1 parent f99a119 commit 31af126
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/CreateCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public String setPostApiEndpoint(){
@Step("Admin request with the HTTP method POST and input valid category name in the request body")
public void sendPostHttpRequestForCreateCategory(){;
JSONObject requestBody = new JSONObject();
requestBody.put("category_name", "Taman Bermain Anak-Anak");
requestBody.put("category_name", "Gunung Berapi");

SerenityRest
.given()
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/starter/pages/CreatePromo.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ public void sendPostHttpRequestForCreatePromoWithValidCredentials(){

SerenityRest.given()
.contentType("multipart/form-data")
.multiPart("title", "NEWYEAREVE")
.multiPart("nama_promo", "NEWYEAREVE")
.multiPart("kode_voucher", "NEWYEAREVE")
.multiPart("title", "CHRISTMASHOLIDAY")
.multiPart("nama_promo", "CHRISTMASHOLIDAY")
.multiPart("kode_voucher", "CHRISTMASHOLIDAY")
.multiPart("jumlah_potongan_persen", 15)
.multiPart("status_aktif", true)
.multiPart("tanggal_kadaluarsa", "2023-12-12")
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/starter/pages/CreateTNC.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public String setPostApiEndpoint(){
@Step("Admin request with the HTTP method POST and input valid TNC credentials on the request body")
public void sendPostHttpRequestForCreateTNC(){;
JSONObject requestBody = new JSONObject();
requestBody.put("tnc_name", "Pembelian Tiket Untuk Anak-Anak");
requestBody.put("description", "Untuk Pembelian tiket museum, user diharuskan login dan mengisi identitas diri");
requestBody.put("tnc_name", "Pembelian Tiket Taman Bermain");
requestBody.put("description", "Untuk Pembelian tiket taman, user diharuskan login dan mengisi identitas diri");

SerenityRest
.given()
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/starter/pages/CreateWisata.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public String setPostApiEndpoint(){

SerenityRest.given()
.contentType("multipart/form-data")
.multiPart("title", "Pantai Dummy")
.multiPart("kode", "DMY")
.multiPart("title", "Kidzania Surabaya")
.multiPart("kode", "KZS")
.multiPart("location", "Jawa Timur")
.multiPart("kota", "malang")
.multiPart("description", "Pantai Dummy")
.multiPart("kota", "Surabaya")
.multiPart("description", "Taman Bermain Anak Anak dan Dewasa")
.multiPart("price", 25000)
.multiPart("available_tickets", 1)
.multiPart("lat", 1.31183923)
.multiPart("long", 53.3231)
.multiPart("category_name", "pantai")
.multiPart("category_name", "Taman Bermain")
.multiPart("maps_link", "https://pantai.com")
.multiPart("is_open", true)
.multiPart("description_is_open", "Buka Jam 08.00-20.00")
Expand Down Expand Up @@ -297,8 +297,8 @@ public void receiveMessageForCreateWisataWithEmptyKode(String message){

SerenityRest.given()
.contentType("multipart/form-data")
.multiPart("title", "Museum Kupu Kupu")
.multiPart("kode", "MKK")
.multiPart("title", "Museum Kidzania")
.multiPart("kode", "KZS")
.multiPart("location", "Jawa Timur")
.multiPart("kota", "malang")
.multiPart("description", "Museum yang terletak di kota Malang")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeleteCategory.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeleteCategory {

@Step("Admin input valid endpoint to delete category")
public String setPostApiEndpointForValidDeleteCategory(){
return url + "admin/categories/138";
return url + "admin/categories/139";
}

@Step("Admin request with the HTTP method DELETE and input valid category ID in the request body")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeletePromo.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeletePromo {

@Step("Admin input valid endpoint to delete promo")
public String setPostApiEndpointForValidDeletePromo(){
return url + "admin/promo/79";
return url + "admin/promo/81";
}

@Step("Admin request with the HTTP method DELETE and input valid promo ID in the request body")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeleteTNC.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeleteTNC {

@Step("Admin input valid endpoint to delete TNC")
public String setPostApiEndpointForValidDeleteTNC(){
return url + "admin/tnc/18";
return url + "admin/tnc/19";
}

@Step("Admin request with the HTTP method DELETE and input valid TNC ID in the request body")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeleteTicket.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeleteTicket {

@Step("Admin input valid endpoint to delete ticket")
public String setPostApiEndpointForValidDeleteTicket(){
return url + "admin/ticket/1701396099-789";
return url + "admin/ticket/1701396095-744";
}

@Step("Admin request with the HTTP method DELETE and input valid ticket ID in the request body")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeleteUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class DeleteUser {

@Step("Admin input valid endpoint to delete user")
public String setPostApiEndpointForValidDeleteUser(){
return url + "admin/user/107";
return url + "admin/user/109";
}

@Step("Admin request with the HTTP method DELETE and input valid user ID in the request body")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/starter/pages/DeleteWisata.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class DeleteWisata {

@Step("Admin input valid endpoint to delete wisata")
public String setPostApiEndpointForValidDeleteWisata(){
return url + "admin/wisata/82";
return url + "admin/wisata/84";
}

@Step("Admin request with the HTTP method DELETE and input valid wisata ID in the request body")
Expand Down

0 comments on commit 31af126

Please sign in to comment.