1
1
import { expect , test } from '@playwright/test'
2
2
import { PetStoreCrudActions } from '../../../infra/api/entities/petStore/PetStoreCrudActions'
3
3
import { STATUS_CODES } from 'http' ;
4
- import { StatusCode } from '../../../infra/api/apiRequests/ApiRequests ' ;
4
+ import { StatusCode } from '../../../infra/api/apiClient/ApiClient ' ;
5
5
import { Ipet } from '../../../infra/api/helpers/interfaces/ApiObjectsInterfaces' ;
6
6
import Randomizer from '../../../infra/api/helpers/faker/Randomizer' ;
7
7
@@ -15,7 +15,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
15
15
petStoreCrudActions = new PetStoreCrudActions ( request )
16
16
} )
17
17
18
- test ( 'get a specific pet for sanity checkup @PET_STORE' , async ( ) => {
18
+ test ( 'get a specific pet for sanity checkup' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
19
19
await test . step ( 'make an api request to a specific pet ID' , async ( ) => {
20
20
let response = await petStoreCrudActions . getPet ( id )
21
21
let responseJson : Ipet = await response ?. json ( )
@@ -24,7 +24,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
24
24
} )
25
25
} )
26
26
27
- test ( 'create a new pet @PET_STORE' , async ( ) => {
27
+ test ( 'create a new pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
28
28
await test . step ( 'create a new pet via post request' , async ( ) => {
29
29
let petData = {
30
30
id : petId ,
@@ -50,7 +50,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
50
50
} )
51
51
} )
52
52
53
- test ( 'validate the pet existance @PET_STORE' , async ( ) => {
53
+ test ( 'validate the pet existance' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
54
54
await test . step ( 'validate the pet that was created from previous test now exists' , async ( ) => {
55
55
let response = await petStoreCrudActions . getPet ( petId )
56
56
let responseBody : Ipet = await response ?. json ( ) ;
@@ -61,15 +61,15 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
61
61
} )
62
62
} )
63
63
64
- test . skip ( 'create pet image @PET_STORE' , async ( ) => {
64
+ test . skip ( 'create pet image' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
65
65
await test . step ( 'upload another image to the pet that was created in the previous test' , async ( ) => {
66
66
let imageFileName : string = 'pug.png'
67
67
let response = await petStoreCrudActions . uploadPetImage ( petId , imageFileName ) ;
68
68
expect ( response ?. status ( ) ) . toBe ( StatusCode . OK ) ;
69
69
} )
70
70
} )
71
71
72
- test ( 'update pet @PET_STORE' , async ( ) => {
72
+ test ( 'update pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
73
73
await test . step ( 'update the newly created pet that was created in previous test' , async ( ) => {
74
74
let petData = {
75
75
id : petId ,
@@ -94,7 +94,7 @@ test.describe.serial('CRUD API tests for the Pet Store API', async () => {
94
94
} )
95
95
} )
96
96
97
- test ( 'delete pet @PET_STORE' , async ( ) => {
97
+ test ( 'delete pet' , { tag : [ '@PET_STORE_API' ] } , async ( ) => {
98
98
await test . step ( 'delete the pet that was created and updated in previous tests' , async ( ) => {
99
99
let response = await petStoreCrudActions . deletePet ( petId )
100
100
expect ( response ?. status ( ) ) . toBe ( StatusCode . OK )
0 commit comments