I want to use the REST helper (for CodeceptJS) to write automated tests for API
The difficulty lies in the fact that access to the API is protected by OAuth2.
If someone had experience passing OAuth2 authorization to write autotests using REST + CodeceptJS, I would be very grateful if you could tell me about your case
You can add a default header in your helper as below with OAuth2 :
REST: {
endpoint: 'https://baseurl/endpoint',
defaultHeaders:{
Authorization: 'Bearer xxxtoken'
},
},