Commit graph

6 commits

Author SHA1 Message Date
Dzmitry Lemechko
87b2a12480
[scout] add ci pipeline (#202707)
## Summary

Adding basic pipeline to run scout UI tests for stateful and 3
serverless projects. Few tests were skipped for Security project because
esArchives used in tests ingest index that are restricted for default
project roles.

It is an opt-in pipeline to verify kbn/scout changes does not break the
existing tests. It is only for start and we plan to re-work into a
mature pipeline later.

New opt-in
[pipeline](https://buildkite.com/elastic/kibana-pull-request/builds/258589#0193afc4-bbd6-4200-8c5f-a7e4a8073e1d)
was added
<img width="1659" alt="Screenshot 2024-12-10 at 11 31 35"
src="https://github.com/user-attachments/assets/1c19fa46-4e66-4796-ac6d-c2c96c74fa8e">
2024-12-11 12:15:50 +01:00
David Olaru
ad4e8efd0f
[kbn-scout] Custom event-oriented test reporter & persistence (#202906) 2024-12-09 14:34:25 +00:00
Dzmitry Lemechko
cdb5a2dca2
[kbn-test] extract ES logs only for svl (#202927)
## Summary

PR fixes the issue reported by @dolaru when running stateful FTR
environment without docker setup locally:

```
 info [es] killing node
 info [es] stopping node scout
 info [es] no debug files found, assuming es did not write any
 info [es] cleanup complete
ERROR UNHANDLED ERROR
ERROR Error: Command failed with exit code 1: docker ps -a --format {{.Names}}
      error during connect: Get "http://docker.example.com/v1.47/containers/json?all=1": command [ssh -o ConnectTimeout=30 -T -l dolaru -- debian-12-vm docker system dial-stdio] has exited with exit status 255, make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=ssh: Could not resolve hostname dolaru-m2-mbp-debian.local: nodename nor servname provided, or not known
          at makeError (/Users/dolaru/workspace/kibana/node_modules/execa/lib/error.js:60:11)
          at handlePromise (/Users/dolaru/workspace/kibana/node_modules/execa/index.js:118:26)
          at processTicksAndRejections (node:internal/process/task_queues:95:5)
          at extractAndArchiveLogs (extract_and_archive_logs.ts:34:41)
          at run_elasticsearch.ts:86:5
```

Since we don't need it for stateful ES instance, I added condition.
kbn-scout had the same issue, so I exported `cleanupElasticsearch` from
`kbn-test` to avoid code duplication
2024-12-05 00:19:41 +01:00
Dzmitry Lemechko
27f650bf99
[chore] update playwright version + ownership (#202535)
## Summary

Since the new Kibana test framework has a strong dependency on
`@playwright/test`, moving it under appex-qa ownership

I had to update and explicitly specify types when extending the
pre-existing fixtures as there was a bug fix enforcing it
https://github.com/microsoft/playwright/pull/32066
2024-12-03 15:47:30 +01:00
Dzmitry Lemechko
d4094c17be
[scout] migrate more Discover tests (#201842)
## Summary

This PR migrates the following FTR tests to `@kbn/scout`:

`x-pack/test/functional/apps/discover/error_handling.ts` =>
`x-pack/plugins/discover_enhanced/ui_tests/tests/error_handling.spec.ts`

`x-pack/test/functional/apps/discover/saved_search_embeddable.ts` =>

`x-pack/plugins/discover_enhanced/ui_tests/tests/saved_search_embeddable.spec.ts`

`x-pack/test/functional/apps/discover/saved_searches.ts` =>
`x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts`

`x-pack/test/functional/apps/discover/value_suggestions.ts` 2nd describe
block =>

`x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_use_time_range_disabled.spec.ts`

Some other changes to mention:

**packages/kbn-test-subj-selector**:
- support of `^foo` syntax similar to `CSS [attribute^=value] Selector`

**packages/kbn-scout**:
- new worker fixture `uiSettings` to wrap Advanced Settings set/unset
capability
- extend `ScoutPage` fixture with `typeWithDelay` method required for
many Kibana input fields
- extend `PageObjects` fixture with `DashboardApp` & `FilterBar`, also
extending existing ones.

How to test:

```bash
// ESS
node scripts/scout_start_servers.js --stateful
npx playwright test --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts --grep @ess

// Serverless
node scripts/scout_start_servers.js --serverless=es
npx playwright test --config x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts --grep @svlSearch
```

---------

Co-authored-by: Robert Oskamp <traeluki@gmail.com>
2024-12-02 20:57:29 +01:00
Dzmitry Lemechko
310d922f13
[kbn-scout] initial package implementation (playwright-test POC) (#194006)
## Summary

This PR introduces a new package, **kbn-scout**, designed to streamline
the setup and execution of Playwright tests for Kibana. The `kbn-scout`
package consolidates server management and testing capabilities by
wrapping both the Kibana/Elasticsearch server launcher and the
Playwright test runner. It includes:

- Test and worker-scoped fixtures for reliable setup across test suites
- Page objects combined into the fixture for Kibana UI interactions
- Configurations for seamless test execution in both local and CI
environments (`Cloud` execution is out of scope)
- This package aims to simplify test setup and enhance modularity,
making it easier to create, run, and maintain deployment-agnostic tests,
that are located in the plugin they actually test.

Tests example is available in `x-pack/plugins/discover_enhanced` plugin
under `ui_tests` folder

How to run:
1) As a single script (servers + tests): 
```
node scripts/scout_test.js --config=x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts --serverless=es
```

2) Start servers first
```
node scripts/scout_start_servers.js --serverless=es
```
then run tests:
```
npx playwright test --config=x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts
```
if you have Playwright plugin in IDEA, just use it to run tests files

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2024-11-26 17:33:49 +01:00