@@ -50,6 +50,8 @@ def create_book_before_test(self, init_api_client, get_books):
5050 validator .validate_status_code (response , 201 )
5151 validator .validate_response_book (response , book )
5252
53+ @pytest .mark .smoke
54+ @pytest .mark .regression
5355 @allure .title ("Should return books for default page 1" )
5456 def test_should_return_books_for_default_page1 (self ):
5557 """Test Should return Book For Default page 1"""
@@ -59,6 +61,7 @@ def test_should_return_books_for_default_page1(self):
5961 len (response .json ()) >= 10 , "Number Of Books should greater or equal to 10"
6062 )
6163
64+ @pytest .mark .regression
6265 @allure .title ("Should return books by page number" )
6366 def test_should_return_books_by_page_number (self ):
6467 """Test Should return book by page number"""
@@ -69,6 +72,7 @@ def test_should_return_books_by_page_number(self):
6972 "Page 2 Book ids should greater than 10" ,
7073 )
7174
75+ @pytest .mark .regression
7276 @pytest .mark .parametrize (
7377 "params,expected_count,message" ,
7478 [
@@ -85,6 +89,8 @@ def test_pagination_cases(self, params, expected_count, message):
8589 validator .validate_status_code (response , 200 )
8690 validator .assert_true (len (response .json ()) == expected_count , message )
8791
92+ @pytest .mark .regression
93+ @pytest .mark .negative
8894 @allure .title ("Should return books excluding last limit on negative limit" )
8995 def test_should_return_books_excluding_last_limit_on_negative_limit (self ):
9096 """Test Should return book exlcuding last limit on negative limit"""
@@ -94,27 +100,34 @@ def test_should_return_books_excluding_last_limit_on_negative_limit(self):
94100 len (response .json ()) != 0 , "Books size with negative limt should be 0"
95101 )
96102
103+ @pytest .mark .smoke
104+ @pytest .mark .regression
97105 @allure .title ("Should return single book by ID" )
98106 def test_should_return_single_book_by_id (self ):
99107 """Test Should return Single Book by ID"""
100108 response = self .client .get (self .client .build_url ("/10" ))
101109 validator .validate_status_code (response , 200 )
102110 validator .assert_equals (response .json ()["id" ], 10 , "Retrieve Book by book ID" )
103111
112+ @pytest .mark .negative
113+ @pytest .mark .regression
104114 @allure .title ("Should not return book when book ID is invalid string" )
105115 def test_should_not_return_book_when_book_id_is_invalid_string (self ):
106116 """Test should not return book when Book Id is invalid String"""
107117 response = self .client .get (self .client .build_url ("/invalid-string" ))
108118 validator .validate_status_code (response , 404 )
109119 validator .validate_error_message (response , "Book not found" )
110120
121+ @pytest .mark .negative
122+ @pytest .mark .regression
111123 @allure .title ("Should not return book when book ID does not exist" )
112124 def test_should_not_return_book_when_book_id_not_exists (self ):
113125 """Test Should not return book when book id not exists"""
114126 response = self .client .get (self .client .build_url ("/999999" ))
115127 validator .validate_status_code (response , 404 )
116128 validator .validate_error_message (response , "Book not found" )
117129
130+ @pytest .mark .regression
118131 @allure .title ("Should return all books when book ID is empty" )
119132 def test_should_return_all_books_when_book_id_is_empty (self ):
120133 """Test should return all books when book id is empty"""
@@ -124,6 +137,7 @@ def test_should_return_all_books_when_book_id_is_empty(self):
124137 len (response .json ()) >= 10 , "Number Of Books should greater or equal to 10"
125138 )
126139
140+ @pytest .mark .regression
127141 @allure .title ("Should return books containing author" )
128142 def test_should_return_books_contains_author (self ):
129143 """Test should return book contains author"""
@@ -133,6 +147,7 @@ def test_should_return_books_contains_author(self):
133147 )
134148 self .assert_search_results (response , author = "Book Author" )
135149
150+ @pytest .mark .regression
136151 @allure .title ("Should return books containing title" )
137152 def test_should_return_books_contains_title (self ):
138153 """Test should return book contains title"""
@@ -141,6 +156,7 @@ def test_should_return_books_contains_title(self):
141156 )
142157 self .assert_search_results (response , title = "Book Title" )
143158
159+ @pytest .mark .regression
144160 @allure .title ("Should return books containing title and author" )
145161 def test_should_return_books_contains_title_and_author (self ):
146162 """Test should return book contains title and author"""
@@ -150,6 +166,7 @@ def test_should_return_books_contains_title_and_author(self):
150166 )
151167 self .assert_search_results (response , title = "Book Title" , author = "book author" )
152168
169+ @pytest .mark .regression
153170 @allure .title ("Should return single book with title and author" )
154171 def test_should_return_single_book_with_title_and_author (self ):
155172 """Test should return single book for author and title"""
@@ -161,6 +178,8 @@ def test_should_return_single_book_with_title_and_author(self):
161178 response , title = "Book Title 7" , author = "book author 7"
162179 )
163180
181+ @pytest .mark .negative
182+ @pytest .mark .regression
164183 @pytest .mark .parametrize (
165184 "params,status_code,expected_message" ,
166185 [
0 commit comments