kibana/packages/kbn-journeys
Dzmitry Lemechko 4dadcbb911
[performance] enable journeys on serverless - part 1 (#162902)
## Summary

This PR is the Step 1 to enable performance journeys run for serverless
projects.
The focus is to re-design journeys to be compatible both for stateful &
serverless Kibana.

I created `KibanaPage` class to have some shared UI actions across
different journeys.
`ProjectPage` extends `KibanaPage` and allows us to override actions,
that are different (or have different locators) in Kibana Project UI
(generic project at the moment)

`kibanaPage` is available in Step context and based on TEST_SERVERLESS
env var appropriate class instance is used.


```typescript
  .step('Go to Discover Page', async ({ page, kbnUrl, kibanaPage }) => {
    await page.goto(kbnUrl.get(`/app/discover`));
    await kibanaPage.waitForHeader();
    await page.waitForSelector('[data-test-subj="discoverDocTable"][data-render-complete="true"]');
    await page.waitForSelector(subj('globalLoadingIndicator-hidden'));
  })
```

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-08-02 12:59:23 +02:00
..
journey [performance] enable journeys on serverless - part 1 (#162902) 2023-08-02 12:59:23 +02:00
services [performance] enable journeys on serverless - part 1 (#162902) 2023-08-02 12:59:23 +02:00
index.ts Enable APM for ES when running performance journeys (#155195) 2023-04-20 16:26:48 +02:00
jest.config.js [ftr] add first-class support for playwrite journeys (#140680) 2022-09-22 01:06:46 -07:00
kibana.jsonc [codeowners] add appex-qa for ftr-related packages (#155230) 2023-05-24 08:53:09 +02:00
package.json Transpile packages on demand, validate all TS projects (#146212) 2022-12-22 19:00:29 -06:00
README.mdx [ftr] add first-class support for playwrite journeys (#140680) 2022-09-22 01:06:46 -07:00
tsconfig.json [performance] enable journeys on serverless - part 1 (#162902) 2023-08-02 12:59:23 +02:00

---
id: kibDevDocsOpsJourneys
slug: /kibana-dev-docs/ops/journeys
title: Journeys
description: A new style of functional test, focused on performance testing for now
tags: ['kibana', 'dev', 'contributor', 'operations', 'performance', 'functional', 'testing']
---

Journeys are a slightly newer take on Functional Tests, currently powered by [playwright](https://playwright.dev/docs).

A Journey is a single pathway through Kibana and looks something like this:

```ts
import { Journey } from '@kbn/journeys';
import { subj } from '@kbn/test-subj-selector';

export const journey = new Journey({
  esArchives: [ ... ],
  kbnArchives: [ ... ],
  scalabilitySetup: { ... },
})
  .step('Go to Discover Page', async ({ page, kbnUrl }) => {
    await page.goto(kbnUrl.get(`/app/discover`));
    await page.waitForSelector(subj('discoverDocTable'));
  })

  .step('Expand the first document', async ({ page }) => {
    const expandButtons = page.locator(subj('docTableExpandToggleColumn'));
    await expandButtons.first().click();
    await page.locator('text="Expanded document"');
  });
```