@grafana/create-plugin 4.8.0-canary.892.e66359c.0 → 4.8.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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v4.8.0 (Wed Apr 24 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Create Plugins: Use non dev docker image on e2e [#883](https://github.com/grafana/plugin-tools/pull/883) ([@oshirohugo](https://github.com/oshirohugo))
6
+
7
+ #### Authors: 1
8
+
9
+ - Hugo Kiyodi Oshiro ([@oshirohugo](https://github.com/oshirohugo))
10
+
11
+ ---
12
+
1
13
  # v4.7.0 (Thu Apr 18 2024)
2
14
 
3
15
  #### 🚀 Enhancement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/create-plugin",
3
- "version": "4.8.0-canary.892.e66359c.0",
3
+ "version": "4.8.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": "e66359c3d14c4cac3ec0db8486a43bc78a84a45a"
90
+ "gitHead": "96389ff99fec497ed6b2ab509709d578ecaf13f0"
91
91
  }
@@ -1,7 +1,7 @@
1
1
  import { test, expect } from './fixtures';
2
2
 
3
3
  test('should be possible to save app configuration', async ({ appConfigPage, page }) => {
4
- const saveButton = page.getByRole('button', { name: /Save API settings/i });
4
+ const saveForm = page.getByRole('button', { name: /Save API settings/i });
5
5
 
6
6
  // reset the configured secret
7
7
  await page.getByRole('button', { name: /reset/i }).click();
@@ -14,6 +14,6 @@ test('should be possible to save app configuration', async ({ appConfigPage, pag
14
14
  // listen for the server response on the saved form
15
15
  const saveResponse = appConfigPage.waitForSettingsResponse();
16
16
 
17
- await saveButton.click();
17
+ await saveForm.click();
18
18
  await expect(saveResponse).toBeOK();
19
19
  });
@@ -1,25 +1,26 @@
1
- import { test, expect } from './fixtures';
1
+ import pluginJson from '../src/plugin.json';
2
+ import { test, expect } from '@grafana/plugin-e2e';
2
3
  import { ROUTES } from '../src/constants';
3
4
 
4
5
  test.describe('navigating app', () => {
5
- test('page one should render successfully', async ({ gotoPage, page }) => {
6
- await gotoPage(`/${ROUTES.One}`);
6
+ test('page one should render successfully', async ({ page }) => {
7
+ await page.goto(`/a/${pluginJson.id}/${ROUTES.One}`);
7
8
  await expect(page.getByText('This is page one.')).toBeVisible();
8
9
  });
9
10
 
10
- test('page two should render successfully', async ({ gotoPage, page }) => {
11
- await gotoPage(`/${ROUTES.Two}`);
11
+ test('page two should render successfully', async ({ page }) => {
12
+ await page.goto(`/a/${pluginJson.id}/${ROUTES.Two}`);
12
13
  await expect(page.getByText('This is page two.')).toBeVisible();
13
14
  });
14
15
 
15
- test('page three should support an id parameter', async ({ gotoPage, page }) => {
16
- await gotoPage(`/${ROUTES.Three}/123456`);
16
+ test('page three should support an id parameter', async ({ page }) => {
17
+ await page.goto(`/a/${pluginJson.id}/${ROUTES.Three}/123456`);
17
18
  await expect(page.getByText('ID: 123456')).toBeVisible();
18
19
  });
19
20
 
20
- test('page three should render sucessfully', async ({ gotoPage, page }) => {
21
+ test('page three should render sucessfully', async ({ page }) => {
21
22
  // wait for page to successfully render
22
- await gotoPage(`/${ROUTES.One}`);
23
+ await page.goto(`/a/${pluginJson.id}/${ROUTES.One}`);
23
24
  await expect(page.getByText('This is page one.')).toBeVisible();
24
25
 
25
26
  // navigating to page four with full width layout without sidebar menu
@@ -1,26 +1,19 @@
1
- import { AppConfigPage, AppPage, test as base } from '@grafana/plugin-e2e';
1
+ import { AppConfigPage, test as base } from '@grafana/plugin-e2e';
2
2
  import pluginJson from '../src/plugin.json';
3
3
 
4
- type AppTestFixture = {
5
- appConfigPage: AppConfigPage;
6
- gotoPage: (path?: string) => Promise<AppPage>;
7
- };
4
+ type AppTestFixture = { appConfigPage: AppConfigPage };
8
5
 
9
6
  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,
7
+ appConfigPage: async ({ page, selectors, grafanaVersion, request }, use, testInfo) => {
8
+ const configPage = new AppConfigPage(
9
+ { page, selectors, grafanaVersion, request, testInfo },
10
+ {
20
11
  pluginId: pluginJson.id,
21
- })
12
+ }
22
13
  );
14
+ await configPage.goto();
15
+ await use(configPage);
23
16
  },
24
17
  });
25
18
 
26
- export { expect } from '@grafana/plugin-e2e';
19
+ export { expect } from '@grafana/plugin-e2e';
@@ -11,6 +11,7 @@ services:
11
11
  args:
12
12
  grafana_image: ${GRAFANA_IMAGE:-{{~grafanaImage~}} }
13
13
  grafana_version: ${GRAFANA_VERSION:-{{~grafanaVersion~}} }
14
+ development: ${DEVELOPMENT:-true}
14
15
  ports:
15
16
  - 3000:3000/tcp
16
17
  {{#if hasBackend}}
@@ -176,7 +176,7 @@ jobs:
176
176
  - name: Start Grafana
177
177
  run: |
178
178
  docker-compose pull
179
- GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
179
+ DEVELOPMENT=false GRAFANA_VERSION=$\{{ matrix.GRAFANA_IMAGE.VERSION }} GRAFANA_IMAGE=$\{{ matrix.GRAFANA_IMAGE.NAME }} docker-compose up -d
180
180
 
181
181
  - name: Wait for Grafana to start
182
182
  uses: nev7n/wait_for_response@v1