-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! [Kibana Overview] Shift SCSS import and lazy-load main compone…
…nt (#204661)
- Loading branch information
1 parent
5930917
commit 12b2204
Showing
6 changed files
with
473 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
x-pack/plugins/observability_solution/observability_onboarding/ui_tests/fixtures/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { | ||
test as base, | ||
PageObjects, | ||
createLazyPageObject, | ||
ScoutTestFixtures, | ||
ScoutWorkerFixtures, | ||
KibanaUrl, | ||
KbnClient, | ||
} from '@kbn/scout'; | ||
import { OnboardingHomePage } from './page_objects'; | ||
import { CustomLogsPage } from './page_objects/custom_logs'; | ||
|
||
export interface ExtendedScoutTestFixtures extends ScoutTestFixtures { | ||
pageObjects: PageObjects & { | ||
onboardingHomePage: OnboardingHomePage; | ||
customLogsPage: CustomLogsPage; | ||
}; | ||
} | ||
|
||
export const test = base.extend<ExtendedScoutTestFixtures, ScoutWorkerFixtures>({ | ||
pageObjects: async ( | ||
{ | ||
pageObjects, | ||
page, | ||
kbnUrl, | ||
kbnClient, | ||
}: { | ||
pageObjects: ExtendedScoutTestFixtures['pageObjects']; | ||
page: ExtendedScoutTestFixtures['page']; | ||
kbnUrl: KibanaUrl; | ||
kbnClient: KbnClient; | ||
}, | ||
use: (pageObjects: ExtendedScoutTestFixtures['pageObjects']) => Promise<void> | ||
) => { | ||
const extendedPageObjects = { | ||
...pageObjects, | ||
onboardingHomePage: createLazyPageObject(OnboardingHomePage, page), | ||
customLogsPage: createLazyPageObject(CustomLogsPage, page, kbnUrl, kbnClient), | ||
}; | ||
|
||
await use(extendedPageObjects); | ||
}, | ||
}); |
107 changes: 107 additions & 0 deletions
107
...rvability_solution/observability_onboarding/ui_tests/fixtures/page_objects/custom_logs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ScoutPage, KibanaUrl, KbnClient } from '@kbn/scout'; | ||
|
||
export class CustomLogsPage { | ||
constructor( | ||
private readonly page: ScoutPage, | ||
private readonly kbnUrl: KibanaUrl, | ||
private readonly kbnClient: KbnClient | ||
) {} | ||
|
||
async goto() { | ||
this.page.goto(`${this.kbnUrl.app('observabilityOnboarding')}/customLogs`); | ||
} | ||
|
||
async clickBackButton() { | ||
await this.page.testSubj.click('observabilityOnboardingFlowBackToSelectionButton'); | ||
} | ||
|
||
logFilePathList() { | ||
return this.page.locator(`[data-test-subj^=obltOnboardingLogFilePath-]`); | ||
} | ||
|
||
logFilePathInput(index: number) { | ||
return this.page.testSubj.locator(`obltOnboardingLogFilePath-${index}`).getByRole('textbox'); | ||
} | ||
|
||
continueButton() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsContinue'); | ||
} | ||
|
||
addLogFilePathButton() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsAddFilePath'); | ||
} | ||
|
||
logFilePathDeleteButton(index: number) { | ||
return this.page.testSubj.locator(`obltOnboardingLogFilePathDelete-${index}`); | ||
} | ||
|
||
integrationNameInput() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsIntegrationsName'); | ||
} | ||
|
||
datasetNameInput() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsDatasetName'); | ||
} | ||
|
||
serviceNameInput() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsServiceName'); | ||
} | ||
|
||
async clickAdvancedSettingsButton() { | ||
return this.page.testSubj | ||
.locator('obltOnboardingCustomLogsAdvancedSettings') | ||
.getByRole('button') | ||
.first() | ||
.click(); | ||
} | ||
|
||
namespaceInput() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsNamespace'); | ||
} | ||
|
||
customConfigInput() { | ||
return this.page.testSubj.locator('obltOnboardingCustomLogsCustomConfig'); | ||
} | ||
|
||
async installCustomIntegration(name: string) { | ||
await this.kbnClient.request({ | ||
method: 'POST', | ||
path: `/api/fleet/epm/custom_integrations`, | ||
body: { | ||
force: true, | ||
integrationName: name, | ||
datasets: [ | ||
{ name: `${name}.access`, type: 'logs' }, | ||
{ name: `${name}.error`, type: 'metrics' }, | ||
{ name: `${name}.warning`, type: 'logs' }, | ||
], | ||
}, | ||
}); | ||
} | ||
|
||
async deleteIntegration(name: string) { | ||
const packageInfo = await this.kbnClient.request<{ item: { status: string } }>({ | ||
method: 'GET', | ||
path: `/api/fleet/epm/packages/${name}`, | ||
ignoreErrors: [404], | ||
}); | ||
|
||
if (packageInfo.data.item?.status === 'installed') { | ||
await this.kbnClient.request({ | ||
method: 'DELETE', | ||
path: `/api/fleet/epm/packages/${name}`, | ||
}); | ||
} | ||
} | ||
|
||
customIntegrationErrorCallout() { | ||
return this.page.testSubj.locator('obltOnboardingCustomIntegrationErrorCallout'); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...s/observability_solution/observability_onboarding/ui_tests/fixtures/page_objects/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { OnboardingHomePage } from './onboarding_home'; |
16 changes: 16 additions & 0 deletions
16
...ility_solution/observability_onboarding/ui_tests/fixtures/page_objects/onboarding_home.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ScoutPage } from '@kbn/scout'; | ||
|
||
export class OnboardingHomePage { | ||
constructor(private readonly page: ScoutPage) {} | ||
|
||
async goto() { | ||
this.page.gotoApp('observabilityOnboarding'); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
x-pack/plugins/observability_solution/observability_onboarding/ui_tests/playwright.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { createPlaywrightConfig } from '@kbn/scout'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default createPlaywrightConfig({ | ||
testDir: './tests', | ||
}); |
Oops, something went wrong.