11import { expect , test } from '@playwright/test'
22import { PetStoreApi } from '@api-entities'
3- import MockDataGenerator , { IPet , StatusCode } from '@api-helpers' ;
3+ import MockDataGenerator , { IPet , StatusCode , TestTags } from '@api-helpers' ;
44
55test . describe . serial ( 'CRUD API tests for the Pet Store API' , async ( ) => {
66 let petStoreCrudActions : PetStoreApi ;
@@ -12,16 +12,16 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
1212 petStoreCrudActions = new PetStoreApi ( request )
1313 } )
1414
15- test ( 'get a specific pet for sanity checkup' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
15+ test ( 'get a specific pet for sanity checkup' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
1616 await test . step ( 'make an api request to a specific pet ID' , async ( ) => {
1717 let response = await petStoreCrudActions . getPet ( id )
1818 let responseJson : IPet = await response ?. json ( )
1919 expect ( response ?. status ( ) ) . toBe ( StatusCode . OK )
20- expect ( responseJson . name ) . toBe ( 'Charli ' )
20+ expect ( responseJson . name ) . toBe ( 'doggie ' )
2121 } )
2222 } )
2323
24- test ( 'create a new pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
24+ test ( 'create a new pet' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
2525 await test . step ( 'create a new pet via post request' , async ( ) => {
2626 let petData = {
2727 id : petId ,
@@ -47,7 +47,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
4747 } )
4848 } )
4949
50- test ( 'validate the pet existance' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
50+ test ( 'validate the pet existance' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
5151 await test . step ( 'validate the pet that was created from previous test now exists' , async ( ) => {
5252 let response = await petStoreCrudActions . getPet ( petId )
5353 let responseBody : IPet = await response ?. json ( ) ;
@@ -58,15 +58,15 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
5858 } )
5959 } )
6060
61- test . skip ( 'create pet image' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
61+ test . skip ( 'create pet image' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
6262 await test . step ( 'upload another image to the pet that was created in the previous test' , async ( ) => {
6363 let imageFileName : string = 'pug.png'
6464 let response = await petStoreCrudActions . uploadPetImage ( petId , imageFileName ) ;
6565 expect ( response ?. status ( ) ) . toBe ( StatusCode . OK ) ;
6666 } )
6767 } )
6868
69- test ( 'update pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
69+ test ( 'update pet' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
7070 await test . step ( 'update the newly created pet that was created in previous test' , async ( ) => {
7171 let petData = {
7272 id : petId ,
@@ -91,7 +91,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
9191 } )
9292 } )
9393
94- test ( 'delete pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
94+ test ( 'delete pet' , { tag : [ TestTags . PET_STORE ] } , async ( ) => {
9595 await test . step ( 'delete the pet that was created and updated in previous tests' , async ( ) => {
9696 let response = await petStoreCrudActions . deletePet ( petId )
9797 expect ( response ?. status ( ) ) . toBe ( StatusCode . OK )
0 commit comments