@grafana/create-plugin 5.1.1 → 5.1.2-canary.1039.3371803.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "5.1.1",
3
+ "version": "5.1.2-canary.1039.3371803.0",
4
4
  "repository": {
5
5
  "directory": "packages/create-plugin",
6
6
  "url": "https://github.com/grafana/plugin-tools"
@@ -87,5 +87,5 @@
87
87
  "engines": {
88
88
  "node": ">=20"
89
89
  },
90
- "gitHead": "5daa5b95194f69c657bdd84cac664cc305903165"
90
+ "gitHead": "3371803b33035b65348509013d80aed6bd480ebc"
91
91
  }
@@ -0,0 +1,19 @@
1
+ import { test, expect } from './fixtures';
2
+
3
+ test('should be possible to save app configuration', async ({ appConfigPage, page }) => {
4
+ const saveButton = page.getByRole('button', { name: /Save API settings/i });
5
+
6
+ // reset the configured secret
7
+ await page.getByRole('button', { name: /reset/i }).click();
8
+
9
+ // enter some valid values
10
+ await page.getByRole('textbox', { name: 'API Key' }).fill('secret-api-key');
11
+ await page.getByRole('textbox', { name: 'API Url' }).clear();
12
+ await page.getByRole('textbox', { name: 'API Url' }).fill('http://www.my-awsome-grafana-app.com/api');
13
+
14
+ // listen for the server response on the saved form
15
+ const saveResponse = appConfigPage.waitForSettingsResponse();
16
+
17
+ await saveButton.click();
18
+ await expect(saveResponse).toBeOK();
19
+ });
@@ -0,0 +1,33 @@
1
+ import { test, expect } from './fixtures';
2
+ import { ROUTES } from '../src/constants';
3
+
4
+ test.describe('navigating app', () => {
5
+ test('page Hello World should render successfully', async ({ gotoPage, page }) => {
6
+ await gotoPage(`/${ROUTES.HelloWorld}`);
7
+ await expect(page.getByText('Hello world panel')).toBeVisible();
8
+ });
9
+
10
+ test('page With Tabs should render successfully', async ({ gotoPage, page }) => {
11
+ await gotoPage(`/${ROUTES.WithTabs}`);
12
+ await expect(page.getByText('This scene showcases a basic tabs functionality.')).toBeVisible();
13
+ });
14
+
15
+ test('page Home should support an id parameter', async ({ gotoPage, page }) => {
16
+ await gotoPage(`/${ROUTES.Home}`);
17
+ await expect(
18
+ page.getByText(
19
+ 'This scene showcases a basic scene functionality, including query runner, variable and a custom scene object.'
20
+ )
21
+ ).toBeVisible();
22
+ });
23
+
24
+ test('page With Drilldown should render sucessfully', async ({ gotoPage, page }) => {
25
+ // wait for page to successfully render
26
+ await gotoPage(`/${ROUTES.WithDrilldown}`);
27
+ await expect(
28
+ page.getByText(
29
+ 'This scene showcases a basic drilldown functionality. Interact with room to see room details scene.'
30
+ )
31
+ ).toBeVisible();
32
+ });
33
+ });
@@ -0,0 +1,26 @@
1
+ import { AppConfigPage, AppPage, test as base } from '@grafana/plugin-e2e';
2
+ import pluginJson from '../src/plugin.json';
3
+
4
+ type AppTestFixture = {
5
+ appConfigPage: AppConfigPage;
6
+ gotoPage: (path?: string) => Promise<AppPage>;
7
+ };
8
+
9
+ export const test = base.extend<AppTestFixture>({
10
+ appConfigPage: async ({ gotoAppConfigPage }, use) => {
11
+ const configPage = await gotoAppConfigPage({
12
+ pluginId: pluginJson.id,
13
+ });
14
+ await use(configPage);
15
+ },
16
+ gotoPage: async ({ gotoAppPage }, use) => {
17
+ await use((path) =>
18
+ gotoAppPage({
19
+ path,
20
+ pluginId: pluginJson.id,
21
+ })
22
+ );
23
+ },
24
+ });
25
+
26
+ export { expect } from '@grafana/plugin-e2e';