File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 2525 npm run test
2626 ```
2727
28+ - Run a set of tests marked with a tag:
29+
30+ ```
31+ npx playwright test --grep @performance
32+ ```
33+
2834- For other methods and operating systems, see [ Developing tests] ( DEVELOPING.md )
2935
3036## Environment Variables
Original file line number Diff line number Diff line change 1+ import { test } from "../fixtures" ;
2+
3+ // test.beforeEach()
4+
5+ test ( "@performance Delete / Large SBOMs" , async ( { axios } ) => {
6+
7+
8+ } ) ;
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ const initAxiosInstance = async (
9595 access_token = tokenResponse . access_token ;
9696
9797 // Intercept Requests
98+ // Add access token
9899 axiosInstance . interceptors . request . use (
99100 ( config ) => {
100101 config . headers . Authorization = `Bearer ${ access_token } ` ;
@@ -106,7 +107,16 @@ const initAxiosInstance = async (
106107 } ,
107108 ) ;
108109
110+ // Measure request start time
111+ axiosInstance . interceptors . request . use (
112+ ( config ) => {
113+ config . headers [ 'request-startTime' ] = new Date ( ) . getTime ( ) ;
114+ return config
115+ }
116+ ) ;
117+
109118 // Intercept Responses
119+ // Retry
110120 axiosInstance . interceptors . response . use (
111121 ( response ) => {
112122 return response ;
@@ -137,6 +147,17 @@ const initAxiosInstance = async (
137147 return Promise . reject ( error ) ;
138148 } ,
139149 ) ;
150+
151+ // Measure response reception time
152+ axiosInstance . interceptors . response . use (
153+ ( response ) => {
154+ const currentTime = new Date ( ) . getTime ( )
155+ const startTime = response . config . headers [ 'request-startTime' ]
156+
157+ response . headers [ 'request-duration' ] = currentTime - startTime
158+
159+ return response
160+ } )
140161} ;
141162
142163// Declare the types of your fixtures.
You can’t perform that action at this time.
0 commit comments