Basic Commands 1)docker version 2)docker -v 3)docker info 4)docker --help docker --help Example: Get information about images..... docker images --help --> Gives you details about how to use images command docker run --help --> Gives you details about how to use run commands 5)docker login Images Commands 6)docker images --> lists the images present in the machine 7)docker pull ---> pull the image from docker hub docker pull ubuntu docker images --> list the image 8)docker rmi docker images -q --> Gives you image ID docker rmi <> ----> Deletes image docker images ---> No Images Containers Commands 9)docker ps & : docker run docker ps ---> List the containers, Bo containers as of now. docker run ubuntu---> Locally not available ,Pulling image from Dockerhub. docker ps --> Still not listed contaner, becoz we didi not created container so far.... docker run -it ubuntu ---> inside ubuntu docker ps ---> lists the container 10) docker start docker start <> 11)docker stop docker stop <> System Commands 12) docker stats --> gives details abount running containers, memory usage etc.. 13)docker system df 14)docker system prune docker system prune -f --> Rermoves all stopped contaniers
TestNG : Framework implemented on top of Java used for organizing test cases, test suites. Free videos: https://www.youtube.com/playlist?list=PLUDwpEzHYYLsWENabqeETzgPLbmwqhM45
Maven
Setup
1) Creating Maven project in Eclipse
2) We need to update pom.xml with required dependencies
public class TC002_POST_Request { @Test void RegistrationSuccessful() { //Specify base URI RestAssured.baseURI="http://restapi.demoqa.com/customer"; //Request object RequestSpecification httpRequest=RestAssured.given(); //Request paylaod sending along with post request JSONObject requestParams=new JSONObject(); requestParams.put("FirstName","JohnXYZ"); requestParams.put("LastName","XYZJohn"); requestParams.put("UserName","JohnXYZ"); requestParams.put("Password","JohnXYZxyx"); requestParams.put("Email","JohnXYZ@gmail.com"); httpRequest.header("Content-Type","application/json"); httpRequest.body(requestParams.toJSONString()); // attach above data to the request //Response object Response response=httpRequest.request(Method.POST,"/register"); //print response in console window String responseBody=response.getBody().asString(); System.out.println("Response Body is:" +responseBody); //status code validation int statusCode=response.getStatusCode(); System.out.println("Status code is: "+statusCode); Assert.assertEquals(statusCode, 201); //success code validation String successCode=response.jsonPath().get("SuccessCode"); Assert.assertEquals(successCode, "OPERATION_SUCCESS"); }
}
Test Case 3) Google Map API - Validating Headers
https://maps.googleapis.com/maps/api/place/nearbysearch/xml?location=-33.8670522,151.1957362&radius=1500&type=supermarket&key=AIzaSyBjGCE3VpLU4lgTqSTDmHmJ2HoELb4Jy1s SUCCESS RESPONSE : Returns list of super markets "Headers: Content-Encoding →gzip Content-Type →application/xml; charset=UTF-8 Server →scaffolding on HTTPServer2
"