Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .buildkite/scout_ci_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ plugins:
- console
- discover_enhanced
- index_management
- infra
- maps
- observability
- observability_onboarding
- painless_lab
- profiling
- security_solution
- streams_app
- slo
- streams_app
- workflows_extensions
disabled:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# How to run tests

First start the servers:

```bash
// ESS
node scripts/scout.js start-server --stateful

// Serverless
node scripts/scout.js start-server --serverless=[es|oblt|security]
```

Then you can run the parallel tests in another terminal:

```bash
// ESS
npx playwright test --config x-pack/solutions/observability/plugins/infra/test/scout/ui/parallel.playwright.config.ts --project=local --grep @ess

// Serverless
npx playwright test --project local --config x-pack/solutions/observability/plugins/infra/test/scout/ui/parallel.playwright.config.ts --grep @svlOblt
```

Test results are available in `x-pack/solutions/observability/plugins/infra/test/scout/ui/output`
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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 type {
ObltPageObjects,
ObltTestFixtures,
ObltWorkerFixtures,
KibanaUrl,
} from '@kbn/scout-oblt';
import { test as base, createLazyPageObject } from '@kbn/scout-oblt';
import { InventoryPage } from './page_objects/inventory';

export interface ExtendedScoutTestFixtures extends ObltTestFixtures {
pageObjects: ObltPageObjects & {
inventoryPage: InventoryPage;
};
}

export const test = base.extend<ExtendedScoutTestFixtures, ObltWorkerFixtures>({
pageObjects: async (
{
pageObjects,
page,
kbnUrl,
}: {
pageObjects: ExtendedScoutTestFixtures['pageObjects'];
page: ExtendedScoutTestFixtures['page'];
kbnUrl: KibanaUrl;
},
use: (pageObjects: ExtendedScoutTestFixtures['pageObjects']) => Promise<void>
) => {
const extendedPageObjects = {
...pageObjects,
inventoryPage: createLazyPageObject(InventoryPage, page, kbnUrl),
};

await use(extendedPageObjects);
},
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* 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 type { KibanaUrl, ScoutPage } from '@kbn/scout-oblt';

export class InventoryPage {
constructor(private readonly page: ScoutPage, private readonly kbnUrl: KibanaUrl) {}

async goto() {
await this.page.goto(`${this.kbnUrl.app('metrics')}/inventory`);
await this.page.testSubj.waitForSelector('infraMetricsPage');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* 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-oblt';

export default createPlaywrightConfig({
testDir: './parallel_tests',
workers: 2,
runGlobalSetup: true,
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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 { globalSetupHook } from '@kbn/scout-oblt';

globalSetupHook('Ingest data to Elasticsearch', { tag: ['@ess', '@svlOblt'] }, async ({}) => {
return;
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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 { expect } from '@kbn/scout-oblt';
import { test } from '../../fixtures';

test.describe('Infrastructure Inventory', { tag: ['@ess', '@svlOblt'] }, () => {
test('Page should load', async ({ pageObjects: { inventoryPage }, browserAuth, page }) => {
await browserAuth.loginAsViewer();
await inventoryPage.goto();

await expect(page.getByTestId('breadcrumb last')).toHaveText('Infrastructure inventory');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "@kbn/tsconfig-base/tsconfig.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": ["**/*"],
"kbn_references": ["@kbn/scout-oblt"],
"exclude": ["target/**/*"]
}