How to use @grafana/toolkit - 10 common examples

To help you get started, we’ve selected a few @grafana/toolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github grafana / grafana / packages / grafana-toolkit / src / plugins / e2e / commonPluginTests.ts View on Github external
scenario: async (browser: Browser, page: Page) => {
    const settings = getEndToEndSettings();
    const pluginPage = pages.getPluginPage(settings.plugin.id);
    await pluginPage.init(page);
    await pluginPage.navigateTo();
    // TODO: find a better way to avoid the 'loading' page
    await sleep(500);

    const fileName = 'plugin-page';
    await takeScreenShot(page, fileName);
  },
});
github grafana / grafana / packages / grafana-toolkit / src / plugins / e2e / commonPluginTests.ts View on Github external
scenario: async (browser: Browser, page: Page) => {
    const settings = getEndToEndSettings();
    const pluginPage = pages.getPluginPage(settings.plugin.id);
    await pluginPage.init(page);
    await pluginPage.navigateTo();
    // TODO: find a better way to avoid the 'loading' page
    await sleep(500);

    const fileName = 'plugin-page';
    await takeScreenShot(page, fileName);
  },
});
github grafana / grafana / packages / grafana-toolkit / src / plugins / e2e / commonPluginTests.ts View on Github external
scenario: async (browser: Browser, page: Page) => {
    const settings = getEndToEndSettings();
    const pluginPage = pages.getPluginPage(settings.plugin.id);
    await pluginPage.init(page);
    await pluginPage.navigateTo();
    // TODO: find a better way to avoid the 'loading' page
    await sleep(500);

    const fileName = 'plugin-page';
    await takeScreenShot(page, fileName);
  },
});
github RedisGrafana / grafana-redis-datasource / jest.config.js View on Github external
// This file is needed because it is used by vscode and other tools that
// call `jest` directly.  However, unless you are doing anything special
// do not edit this file

const standard = require('@grafana/toolkit/src/config/jest.plugin.config');

// This process will use the same config that `yarn test` is using
const grafanaJestConfig = standard.jestConfig('');
module.exports = {
  ...grafanaJestConfig,
  coveragePathIgnorePatterns: ['node_modules', 'src/tests'].concat(
    grafanaJestConfig.coveragePathIgnorePatterns ? grafanaJestConfig.coveragePathIgnorePatterns : []
  ),
};
github sbueringer / grafana-consul-datasource / jest.config.js View on Github external
// This file is needed because it is used by vscode and other tools that
// call `jest` directly.  However, unless you are doing anything special
// do not edit this file

const standard = require('@grafana/toolkit/src/config/jest.plugin.config');

// This process will use the same config that `yarn test` is using
module.exports = standard.jestConfig();
github grafana / grafana / public / e2e-test / pages / panels / editPanel.ts View on Github external
queriesTab: ClickablePageObjectType;
  saveDashboard: ClickablePageObjectType;
  scenarioSelect: SelectPageObjectType;
  showXAxis: ClickablePageObjectType;
  visualizationTab: ClickablePageObjectType;
}

export const editPanelPage = new TestPage({
  pageObjects: {
    queriesTab: new ClickablePageObject(Selector.fromAriaLabel('Queries tab button')),
    saveDashboard: new ClickablePageObject(Selector.fromAriaLabel('Save dashboard navbar button')),
    scenarioSelect: new SelectPageObject(Selector.fromAriaLabel('Scenario Select')),
    showXAxis: new ClickablePageObject(
      Selector.fromSelector('[aria-label="X-Axis section"] [label=Show] .gf-form-switch')
    ),
    visualizationTab: new ClickablePageObject(Selector.fromAriaLabel('Visualization tab button')),
  },
});
github grafana / grafana / public / e2e-test / pages / panels / editPanel.ts View on Github external
ClickablePageObjectType,
  ClickablePageObject,
} from '@grafana/toolkit/src/e2e';

export interface EditPanelPage {
  queriesTab: ClickablePageObjectType;
  saveDashboard: ClickablePageObjectType;
  scenarioSelect: SelectPageObjectType;
  showXAxis: ClickablePageObjectType;
  visualizationTab: ClickablePageObjectType;
}

export const editPanelPage = new TestPage({
  pageObjects: {
    queriesTab: new ClickablePageObject(Selector.fromAriaLabel('Queries tab button')),
    saveDashboard: new ClickablePageObject(Selector.fromAriaLabel('Save dashboard navbar button')),
    scenarioSelect: new SelectPageObject(Selector.fromAriaLabel('Scenario Select')),
    showXAxis: new ClickablePageObject(
      Selector.fromSelector('[aria-label="X-Axis section"] [label=Show] .gf-form-switch')
    ),
    visualizationTab: new ClickablePageObject(Selector.fromAriaLabel('Visualization tab button')),
  },
});
github grafana / grafana / public / e2e-test / pages / datasources / editDataSourcePage.ts View on Github external
ClickablePageObject,
  PageObject,
  Selector,
} from '@grafana/toolkit/src/e2e';

export interface EditDataSourcePage {
  saveAndTest: ClickablePageObjectType;
  alert: PageObjectType;
  alertMessage: PageObjectType;
}

export const editDataSourcePage = new TestPage({
  pageObjects: {
    saveAndTest: new ClickablePageObject(Selector.fromAriaLabel('Save and Test button')),
    alert: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert')),
    alertMessage: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert message')),
  },
});
github grafana / grafana / public / e2e-test / pages / datasources / editDataSourcePage.ts View on Github external
PageObjectType,
  ClickablePageObject,
  PageObject,
  Selector,
} from '@grafana/toolkit/src/e2e';

export interface EditDataSourcePage {
  saveAndTest: ClickablePageObjectType;
  alert: PageObjectType;
  alertMessage: PageObjectType;
}

export const editDataSourcePage = new TestPage({
  pageObjects: {
    saveAndTest: new ClickablePageObject(Selector.fromAriaLabel('Save and Test button')),
    alert: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert')),
    alertMessage: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert message')),
  },
});
github grafana / grafana / public / e2e-test / pages / datasources / editDataSourcePage.ts View on Github external
ClickablePageObjectType,
  PageObjectType,
  ClickablePageObject,
  PageObject,
  Selector,
} from '@grafana/toolkit/src/e2e';

export interface EditDataSourcePage {
  saveAndTest: ClickablePageObjectType;
  alert: PageObjectType;
  alertMessage: PageObjectType;
}

export const editDataSourcePage = new TestPage({
  pageObjects: {
    saveAndTest: new ClickablePageObject(Selector.fromAriaLabel('Save and Test button')),
    alert: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert')),
    alertMessage: new PageObject(Selector.fromAriaLabel('Datasource settings page Alert message')),
  },
});