Skip to content

Commit e3588a0

Browse files
committed
Update logs
Signed-off-by: Lin Wang <[email protected]>
1 parent 187e48f commit e3588a0

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

cypress/utils/commands.js

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { BASE_PATH, IM_API, BACKEND_BASE_PATH } from './constants';
6+
import { BACKEND_BASE_PATH, BASE_PATH, IM_API } from './constants';
77
import { devToolsRequest } from './helpers';
88

99
export const DisableLocalCluster = !!Cypress.env('DISABLE_LOCAL_CLUSTER'); // = hideLocalCluster
@@ -108,6 +108,12 @@ Cypress.Commands.overwrite('visit', (orig, url, options) => {
108108
}
109109
});
110110

111+
112+
Cypress.log({
113+
name: 'Override request',
114+
displayName: 'OR',
115+
message: BACKEND_BASE_PATH,
116+
});
111117
/**
112118
* Overwrite request command to support authentication similar to visit.
113119
* The request function parameters can be url, or (method, url), or (method, url, body).
@@ -128,10 +134,24 @@ Cypress.Commands.overwrite('request', (originalFn, ...args) => {
128134
} else if (args.length === 3) {
129135
[options.method, options.url, options.body] = args;
130136
}
137+
// These logs will appear in the left Command Log panel
138+
Cypress.log({
139+
name: 'REQUEST INFO',
140+
displayName: 'INFO',
141+
message: `Backend: ${currentBackendEndpoint.get()}`,
142+
});
131143

132-
cy.log('currentBackendEndpoint.get():' + currentBackendEndpoint.get());
133-
cy.log('options.url:[' + options.url+']');
134-
cy.log('BACKEND_BASE_PATH:' + BACKEND_BASE_PATH);
144+
Cypress.log({
145+
name: 'URL',
146+
displayName: 'URL',
147+
message: options.url || 'undefined',
148+
});
149+
150+
Cypress.log({
151+
name: 'BASE PATH',
152+
displayName: 'BASE',
153+
message: BACKEND_BASE_PATH,
154+
});
135155
/**
136156
*
137157
* Overwrite opensearch backend endpoint to customized endpoint if data source management enabled and

0 commit comments

Comments
 (0)