mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
# Backport This will backport the following commits from `main` to `8.17`: - [[APM] Fix inventory plugin link (#201122)](https://github.com/elastic/kibana/pull/201122) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cauê Marcondes","email":"55978943+cauemarcondes@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-11-26T21:53:48Z","message":"[APM] Fix inventory plugin link (#201122)\n\ncloses https://github.com/elastic/kibana/issues/201116\r\n\r\n- Fix Inventory locator removing `observability` from the url.\r\n- ~~Unify service inventory E2E tests to run it faster avoiding Kibana\r\nloading page on every test.~~\r\n- Add test to navigate to the inventory plugin.","sha":"4bc9a59fcccbe0f58bcb58bbe42fa294dd3f041a","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.17.0"],"title":"[APM] Fix inventory plugin link","number":201122,"url":"https://github.com/elastic/kibana/pull/201122","mergeCommit":{"message":"[APM] Fix inventory plugin link (#201122)\n\ncloses https://github.com/elastic/kibana/issues/201116\r\n\r\n- Fix Inventory locator removing `observability` from the url.\r\n- ~~Unify service inventory E2E tests to run it faster avoiding Kibana\r\nloading page on every test.~~\r\n- Add test to navigate to the inventory plugin.","sha":"4bc9a59fcccbe0f58bcb58bbe42fa294dd3f041a"}},"sourceBranch":"main","suggestedTargetBranches":["8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/201122","number":201122,"mergeCommit":{"message":"[APM] Fix inventory plugin link (#201122)\n\ncloses https://github.com/elastic/kibana/issues/201116\r\n\r\n- Fix Inventory locator removing `observability` from the url.\r\n- ~~Unify service inventory E2E tests to run it faster avoiding Kibana\r\nloading page on every test.~~\r\n- Add test to navigate to the inventory plugin.","sha":"4bc9a59fcccbe0f58bcb58bbe42fa294dd3f041a"}},{"branch":"8.17","label":"v8.17.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
This commit is contained in:
parent
e3cdc2e901
commit
a692b88a32
5 changed files with 47 additions and 29 deletions
|
@ -23,10 +23,12 @@ const serviceInventoryHref = url.format({
|
|||
|
||||
const mainApiRequestsToIntercept = [
|
||||
{
|
||||
method: 'GET',
|
||||
endpoint: '/internal/apm/services?*',
|
||||
aliasName: 'servicesRequest',
|
||||
},
|
||||
{
|
||||
method: 'POST',
|
||||
endpoint: '/internal/apm/services/detailed_statistics?*',
|
||||
aliasName: 'detailedStatisticsRequest',
|
||||
},
|
||||
|
@ -51,8 +53,13 @@ describe.skip('Service inventory', () => {
|
|||
|
||||
describe('When navigating to the service inventory', () => {
|
||||
beforeEach(() => {
|
||||
mainApiRequestsToIntercept.forEach(({ aliasName, endpoint, method }) =>
|
||||
cy.intercept(method, endpoint).as(aliasName)
|
||||
);
|
||||
cy.loginAsViewerUser();
|
||||
cy.visitKibana(serviceInventoryHref);
|
||||
cy.visitKibana(serviceInventoryHref, {
|
||||
localStorageOptions: [['apm.dismissedEntitiesInventoryCallout', 'false']],
|
||||
});
|
||||
});
|
||||
|
||||
it('has no detectable a11y violations on load', () => {
|
||||
|
@ -80,9 +87,8 @@ describe.skip('Service inventory', () => {
|
|||
|
||||
describe('Calls APIs', () => {
|
||||
beforeEach(() => {
|
||||
cy.intercept('GET', '/internal/apm/services?*').as('servicesRequest');
|
||||
cy.intercept('POST', '/internal/apm/services/detailed_statistics?*').as(
|
||||
'detailedStatisticsRequest'
|
||||
mainApiRequestsToIntercept.forEach(({ aliasName, endpoint, method }) =>
|
||||
cy.intercept(method, endpoint).as(aliasName)
|
||||
);
|
||||
|
||||
cy.loginAsViewerUser();
|
||||
|
|
|
@ -55,26 +55,32 @@ Cypress.Commands.add('loginAsApmReadPrivilegesWithWriteSettingsUser', () => {
|
|||
Cypress.Commands.add(
|
||||
'loginAs',
|
||||
({ username, password }: { username: string; password: string }) => {
|
||||
// cy.session(username, () => {
|
||||
const kibanaUrl = Cypress.env('KIBANA_URL');
|
||||
cy.log(`Logging in as ${username} on ${kibanaUrl}`);
|
||||
cy.visit('/');
|
||||
cy.request({
|
||||
log: true,
|
||||
method: 'POST',
|
||||
url: `${kibanaUrl}/internal/security/login`,
|
||||
body: {
|
||||
providerType: 'basic',
|
||||
providerName: 'basic',
|
||||
currentURL: `${kibanaUrl}/login`,
|
||||
params: { username, password },
|
||||
cy.session(
|
||||
username,
|
||||
() => {
|
||||
const kibanaUrl = Cypress.env('KIBANA_URL');
|
||||
cy.log(`Logging in as ${username} on ${kibanaUrl}`);
|
||||
cy.visit('/');
|
||||
cy.request({
|
||||
log: true,
|
||||
method: 'POST',
|
||||
url: `${kibanaUrl}/internal/security/login`,
|
||||
body: {
|
||||
providerType: 'basic',
|
||||
providerName: 'basic',
|
||||
currentURL: `${kibanaUrl}/login`,
|
||||
params: { username, password },
|
||||
},
|
||||
headers: {
|
||||
'kbn-xsrf': 'e2e_test',
|
||||
},
|
||||
});
|
||||
cy.visit('/');
|
||||
},
|
||||
headers: {
|
||||
'kbn-xsrf': 'e2e_test',
|
||||
},
|
||||
// });
|
||||
});
|
||||
cy.visit('/');
|
||||
{
|
||||
cacheAcrossSpecs: true,
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -87,8 +93,14 @@ Cypress.Commands.add('changeTimeRange', (value: string) => {
|
|||
cy.contains(value).click();
|
||||
});
|
||||
|
||||
Cypress.Commands.add('visitKibana', (url: string) => {
|
||||
cy.visit(url);
|
||||
Cypress.Commands.add('visitKibana', (url, options) => {
|
||||
cy.visit(url, {
|
||||
onBeforeLoad(win) {
|
||||
if (options?.localStorageOptions && options.localStorageOptions.length > 0) {
|
||||
options.localStorageOptions.forEach(([key, value]) => win.localStorage.setItem(key, value));
|
||||
}
|
||||
},
|
||||
});
|
||||
cy.getByTestSubj('kbnLoadingMessage').should('exist');
|
||||
cy.getByTestSubj('kbnLoadingMessage').should('not.exist', {
|
||||
timeout: 50000,
|
||||
|
|
|
@ -19,7 +19,7 @@ declare namespace Cypress {
|
|||
password: string;
|
||||
}): Cypress.Chainable<Cypress.Response<any>>;
|
||||
changeTimeRange(value: string): void;
|
||||
visitKibana(url: string): void;
|
||||
visitKibana(url: string, options?: { localStorageOptions?: Array<[string, string]> }): void;
|
||||
selectAbsoluteTimeRange(start: string, end: string): void;
|
||||
expectAPIsToHaveBeenCalledWith(params: { apisIntercepted: string[]; value: string }): void;
|
||||
updateAdvancedSettings(settings: Record<string, unknown>): void;
|
||||
|
|
|
@ -47,7 +47,7 @@ export function useInventoryRouter(): StatefulInventoryRouter {
|
|||
navigateToApp('inventory', { path: next, replace: true });
|
||||
},
|
||||
link: (path, ...args) => {
|
||||
return http.basePath.prepend('/app/observability/inventory' + link(path, ...args));
|
||||
return http.basePath.prepend('/app/inventory' + link(path, ...args));
|
||||
},
|
||||
}),
|
||||
[navigateToApp, http.basePath]
|
||||
|
|
|
@ -16,8 +16,8 @@ export class EntitiesInventoryLocatorDefinition implements LocatorDefinition<Ser
|
|||
|
||||
public readonly getLocation = async () => {
|
||||
return {
|
||||
app: 'observability',
|
||||
path: `/inventory`,
|
||||
app: 'inventory',
|
||||
path: `/`,
|
||||
state: {},
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue