Package tests
Class TS02_GetBook
java.lang.Object
tests.BaseTest
tests.TS02_GetBook
@Epic("Book Management")
@Feature("Retrieve Book")
@Severity(CRITICAL)
public class TS02_GetBook
extends BaseTest
Test cases for retrieving books via the API.
-
Field Summary
Fields inherited from class tests.BaseTest
logger, MAX_RETRY_COUNT, USER_ADMIN_TOKEN, USER_AUTH_TOKEN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Creates books before running get book tests.Object[]
void
testShouldNotReturnBookWhenBookIdIsInvalidString
(Object inValidBookId) Should not return a book when book ID is an invalid string.void
Should not return a book when book ID does not exist.void
Should return 404 when book search is without author and title.void
Should return all books when book ID is empty.void
Should return books by limit.void
Should return books by limit and page.void
Should return books by page number.void
Should return books containing the author.void
Should return books containing the title.void
Should return books containing both title and author.void
Should return books excluding last limit on negative limit.void
Should return books for default page 1.void
Should return no books if page number is not in range.void
Should return no books on negative page.void
Should return no books when book with author does not exist.void
Should return no books when book with title and author does not exist.void
Should return no books when book with title does not exist.void
Should return a single book by ID.void
Should return a single book with title and author.Methods inherited from class tests.BaseTest
beforeTest, resetBooksAfterSuite, retryRequest, setup, setUpSuite, teardown
-
Constructor Details
-
TS02_GetBook
public TS02_GetBook()
-
-
Method Details
-
createBooksBeforeGetBookTest
@BeforeTest(alwaysRun=true) public void createBooksBeforeGetBookTest()Creates books before running get book tests. -
testShouldReturnBooksForDefaultPage1
public void testShouldReturnBooksForDefaultPage1()Should return books for default page 1. -
testShouldReturnBooksByPageNumber
public void testShouldReturnBooksByPageNumber()Should return books by page number. -
testShouldReturnBooksByLimit
public void testShouldReturnBooksByLimit()Should return books by limit. -
testShouldReturnBooksByLimitAndPage
public void testShouldReturnBooksByLimitAndPage()Should return books by limit and page. -
testShouldReturnNoBooksIfPageNumberIsNotInRange
public void testShouldReturnNoBooksIfPageNumberIsNotInRange()Should return no books if page number is not in range. -
testShouldReturnNoBooksOnNegativePage
public void testShouldReturnNoBooksOnNegativePage()Should return no books on negative page. -
testShouldReturnBooksExcludingLastLimitOnNegativeLimit
public void testShouldReturnBooksExcludingLastLimitOnNegativeLimit()Should return books excluding last limit on negative limit. -
testShouldReturnSingleBookByID
public void testShouldReturnSingleBookByID()Should return a single book by ID. -
testShouldNotReturnBookWhenBookIdIsInvalidString
Should not return a book when book ID is an invalid string. -
getInvalidBookID
-
testShouldNotReturnBookWhenBookIdNotExists
public void testShouldNotReturnBookWhenBookIdNotExists()Should not return a book when book ID does not exist. -
testShouldReturnAllBooksWhenBookIdIsEmpty
public void testShouldReturnAllBooksWhenBookIdIsEmpty()Should return all books when book ID is empty. -
testShouldReturnBooksContainsAuthor
public void testShouldReturnBooksContainsAuthor()Should return books containing the author. -
testShouldReturnBooksContainsTitle
public void testShouldReturnBooksContainsTitle()Should return books containing the title. -
testShouldReturnBooksContainsTitleAndAuthor
public void testShouldReturnBooksContainsTitleAndAuthor()Should return books containing both title and author. -
testShouldReturnSingleBookWithTitleAndAuthor
public void testShouldReturnSingleBookWithTitleAndAuthor()Should return a single book with title and author. -
testShouldReturn404WhenBookSearchWithoutAuthorAndTitle
public void testShouldReturn404WhenBookSearchWithoutAuthorAndTitle()Should return 404 when book search is without author and title. -
testShouldReturnNoBooksWhenBookWithTitleAndAuthorNotExists
public void testShouldReturnNoBooksWhenBookWithTitleAndAuthorNotExists()Should return no books when book with title and author does not exist. -
testShouldReturnNoBooksWhenBookWithAuthorNotExists
public void testShouldReturnNoBooksWhenBookWithAuthorNotExists()Should return no books when book with author does not exist. -
testShouldReturnNoBooksWhenBookWithTitleNotExists
public void testShouldReturnNoBooksWhenBookWithTitleNotExists()Should return no books when book with title does not exist.
-