这是indexloc提供的服务,不要输入任何密码
Skip to content

VimalaMoger/RestAssured

Repository files navigation

Testing of ThrillioWeb APIs:

Dependencies added:

    spring-boot-starter-web, spring-boot-devtools, Rest Assured, Hamcrest Matchers, TestNG, Gson library, io.cucumber and apache.poi libraries, jackson library, Lombok, maven-cucumber-reporting, maven-surefire-plugin, surefire-junit47

Tasks

  • Parameterize the API Tests with multiple data sets
  • Read static Json from an external file
  • Pojo classes implementation
  • Spec builder creation and logging
  • Integrate Excel with Rest Assured - Data driven
  • Integrate Cucumber with Rest Assured
  • Maven mojo for the cucumber-reporting

  • Jira REST APIs test

    Issue creation, update, read and delete request, send File Attachment

Run tests:

restassured.PNG

Cucumber tests from Maven cmd commands:

    mvn clean test
    mvn test -Dcucumber.options="--tags @addBook"
    mvn clean test -Dcucumber.filter.tags="@getBook"
    mvn test -Dcucumber.features="src/test/resources/features"

cucumberTest

Generated cucumber HTML reporting with plugin configuration

  • Updated RunnerTest class with plugin configuration
  • Added maven-cucumber-reporting plugin to pom.xml
  • Ran mvn clean verify to generate the Cucumber report file

cucumberTestReporting

cucumber-html-reports

Tips:

  • Diff between mvn clean install and mvn clean test

    mvn clean install executes both clean and install phase clean phase\install phase includes validate\compile\test\package\verify\install mvn test includes only phases up to test validate\compile\test

  • Dependency conflicts (JUnit vs. TestNG)

    Maven Surefire plugin confused about which framework to use - Required both dependencies in this project - Solution: Force the Surefire provider to explicitly configure the maven-surefire-plugin to use JUnit - included org.apache.maven.surefire dependency in pom.xml plugin section

About

REST API Automation, validation of responses

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published