Skip to content

Commit 1109432

Browse files
Docs: Missing Landings - e2e tests (#2025)
1 parent 21c5504 commit 1109432

File tree

13 files changed

+47
-43
lines changed

13 files changed

+47
-43
lines changed

docusaurus/docs/e2e-test-a-plugin/get-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: get-started
3-
title: Get started
4-
description: Get started
3+
title: Get started
4+
description: Get started with plugin end-to-end testing.
55
keywords:
66
- grafana
77
- plugins
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
id: e2e-test-a-plugin
3+
title: Test your plugins end-to-end
4+
description: How to perform end-to-end tests for Grafana plugins.
5+
keywords:
6+
- grafana
7+
- plugins
8+
- plugin
9+
- test
10+
- e2e
11+
- end-to-end
12+
---
13+
14+
You can test your plugins using [`@grafana/plugin-e2e`](https://www.npmjs.com/package/@grafana/plugin-e2e?activeTab=readme), a tool designed specifically for Grafana plugin developers. It extends [`@playwright/test`](https://playwright.dev/) capabilities with relevant fixtures, models, and expect matchers; enabling comprehensive end-to-end testing of Grafana plugins across multiple versions of Grafana. This package simplifies the testing process, ensuring your plugin is robust and compatible with various Grafana environments.
15+
16+
## Why use `@grafana/plugin-e2e`?
17+
18+
As a plugin author you want your plugins to be compatible with a range of Grafana versions. This can be challenging because things such as environment, APIs and UI components may differ from one Grafana version to another. Therefore, manually testing a plugin across multiple versions of Grafana is a tedious process, so in most cases end-to-end testing offers a better solution.
19+
20+
The `@grafana/plugin-e2e` tool offers a consistent way to interact with the Grafana UI without having to handle UI deviations in the plugin test code. The APIs of `@grafana/plugin-e2e` are guaranteed to work with all the latest minor versions of Grafana since 8.5.0. In addition to cross-version compatibility, the tool provides a set of features that simplify the end-to-end testing experience:
21+
22+
- **Predefined fixtures:** Offers a set of predefined fixtures that are tailored for Grafana plugin testing.
23+
- **Custom models:** Provides custom models that represent pages and components in Grafana, simplifying maintenance and creating reusable code to avoid repetition.
24+
- **Expect matchers:** Includes a range of expect matchers that are specialized for Grafana plugin assertions, helping you validate plugin behavior more effectively.
25+
- **Integration with Playwright:** Seamlessly integrates with the Playwright testing framework, leveraging its powerful browser automation capabilities.
26+
27+
## End-to-end testing guides
28+
29+
See the following guides to learn more about end-to-end testing:
30+
31+
<DocLinkList />

docusaurus/docs/e2e-test-a-plugin/introduction.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docusaurus/docs/e2e-test-a-plugin/migrate-from-grafana-e2e.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: migrate-from-grafana-e2e
33
title: Migrate from @grafana/e2e
4-
description: How to migrate from @grafana/e2e to @grafana/plugin-e2e
4+
description: Migrate from @grafana/e2e to @grafana/plugin-e2e.
55
keywords:
66
- grafana
77
- plugins

docusaurus/docs/e2e-test-a-plugin/test-a-data-source-plugin/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: introduction
33
title: How to test a data dource plugin
4-
description: How to test a data source plugin
4+
description: How to test a data source plugin.
55
keywords:
66
- grafana
77
- plugins

docusaurus/docs/e2e-test-a-plugin/test-a-panel-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: test-a-panel-plugin
33
title: Test a panel plugin
4-
description: How to test a panel plugin with @grafana/plugin-e2e
4+
description: How to test a panel plugin with @grafana/plugin-e2e.
55
keywords:
66
- grafana
77
- plugins

docusaurus/docs/e2e-test-a-plugin/test-an-app-plugin/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: introduction
33
title: How to test an app plugin
4-
description: How to test an app plugin
4+
description: How to test an app plugin.
55
keywords:
66
- grafana
77
- plugins

docusaurus/docs/e2e-test-a-plugin/use-the-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: api
33
title: Use the API
4-
description: How to use the grafana/plugin-e2e API
4+
description: How to use the grafana/plugin-e2e API.
55
keywords:
66
- grafana
77
- plugins

docusaurus/docs/how-to-guides/runtime-checks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,5 @@ test('should render profile', async ({ page, grafanaVersion }) => {
122122

123123
### Further reading
124124

125-
- **end-to-end testing for plugins**: For comprehensive guidance on writing and running E2E tests for Grafana plugins, refer to the [documentation](../e2e-test-a-plugin/introduction.md).
125+
- **end-to-end testing for plugins**: For comprehensive guidance on writing and running E2E tests for Grafana plugins, refer to the [documentation](../e2e-test-a-plugin/index.md).
126126
- **Running end-to-end tests across multiple Grafana versions**: To learn how to configure your workflows to test plugins against different Grafana versions, see the [example workflows](../e2e-test-a-plugin/ci.md).

docusaurus/docs/key-concepts/anatomy-of-a-plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ The following files are crucial for your plugin's development and functionality:
170170
- `plugin.json`: Stores [metadata about your plugin](/reference/plugin-json), including information like its description, supported Grafana versions, and dependencies.
171171
- `module.ts`: The entry point for your plugin's frontend logic.
172172
- **Backend code** (`pkg/`): Required if your plugin has a backend component. If your plugin includes backend functionality, the code will reside in this directory, typically within `pkg/plugin/`. Backend plugins are written in Go, and `main.go` serves as the entry point for your backend logic.
173-
- **Test files** (`tests/`): Optional, but strongly recommended to ensure plugin quality. This folder contains your plugin’s test files, typically suffixed with `.spec.ts` for frontend tests. You can [learn more about testing your plugin](/e2e-test-a-plugin/introduction) in our E2E testing guide.
173+
- **Test files** (`tests/`): Optional, but strongly recommended to ensure plugin quality. This folder contains your plugin’s test files, typically suffixed with `.spec.ts` for frontend tests. You can [learn more about testing your plugin](/e2e-test-a-plugin/index.md) in our E2E testing guide.
174174
- **Other files**:
175175
- `docker-compose.yaml`: Required for Docker environment only. Contains the Docker configuration for running a local development instance of Grafana.
176176
- `CHANGELOG.md`: Required. Documents the history of changes and updates made to the plugin.

0 commit comments

Comments
 (0)