How to use the @grafana/e2e.e2e function in @grafana/e2e

To help you get started, we’ve selected a few @grafana/e2e 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 / public / e2e-tests / integration / smoketests.spec.ts View on Github external
return;
      }

      const theOutputImage = `${e2e.config().screenshotsFolder}/theOutput/smoke-test-scenario.png`;
      const theTruthImage = `${e2e.config().screenshotsFolder}/theTruth/smoke-test-scenario.png`;

      e2e().wrap(
        e2e.imgSrcToBlob(url).then((blob: any) => {
          e2e.blobToBase64String(blob).then((base64String: string) => {
            const data = base64String.replace(/^data:image\/\w+;base64,/, '');
            e2e().writeFile(theOutputImage, data, 'base64');
          });
        })
      );
      e2e().wait(1000); // give the io a chance to flush image to disk
      e2e().compareSnapshot({ pathToFileA: theOutputImage, pathToFileB: theTruthImage });
    });
  },
github grafana / grafana / public / e2e-tests / integration / smoketests.spec.ts View on Github external
if (!e2e.env('CIRCLE_SHA1')) {
        return;
      }

      const theOutputImage = `${e2e.config().screenshotsFolder}/theOutput/smoke-test-scenario.png`;
      const theTruthImage = `${e2e.config().screenshotsFolder}/theTruth/smoke-test-scenario.png`;

      e2e().wrap(
        e2e.imgSrcToBlob(url).then((blob: any) => {
          e2e.blobToBase64String(blob).then((base64String: string) => {
            const data = base64String.replace(/^data:image\/\w+;base64,/, '');
            e2e().writeFile(theOutputImage, data, 'base64');
          });
        })
      );
      e2e().wait(1000); // give the io a chance to flush image to disk
      e2e().compareSnapshot({ pathToFileA: theOutputImage, pathToFileB: theTruthImage });
    });
  },
github grafana / grafana / public / e2e-tests / integration / smoketests.spec.ts View on Github external
e2e.pages.SharePanelModal.linkToRenderedImage().then(($a: any) => {
      // extract the fully qualified href property
      const url = $a.prop('href');

      // Test that the image renderer returns 200 OK
      e2e().request({ method: 'GET', url, timeout: 120000 });

      // Download image
      if (!e2e.env('CIRCLE_SHA1')) {
        return;
      }

      const theOutputImage = `${e2e.config().screenshotsFolder}/theOutput/smoke-test-scenario.png`;
      const theTruthImage = `${e2e.config().screenshotsFolder}/theTruth/smoke-test-scenario.png`;

      e2e().wrap(
        e2e.imgSrcToBlob(url).then((blob: any) => {
          e2e.blobToBase64String(blob).then((base64String: string) => {
            const data = base64String.replace(/^data:image\/\w+;base64,/, '');
            e2e().writeFile(theOutputImage, data, 'base64');
          });
        })
      );
      e2e().wait(1000); // give the io a chance to flush image to disk
      e2e().compareSnapshot({ pathToFileA: theOutputImage, pathToFileB: theTruthImage });
    });
  },
github grafana / grafana / public / e2e-tests / integration / smoketests.spec.ts View on Github external
e2e.pages.SharePanelModal.linkToRenderedImage().then(($a: any) => {
      // extract the fully qualified href property
      const url = $a.prop('href');

      // Test that the image renderer returns 200 OK
      e2e().request({ method: 'GET', url, timeout: 120000 });

      // Download image
      if (!e2e.env('CIRCLE_SHA1')) {
        return;
      }

      const theOutputImage = `${e2e.config().screenshotsFolder}/theOutput/smoke-test-scenario.png`;
      const theTruthImage = `${e2e.config().screenshotsFolder}/theTruth/smoke-test-scenario.png`;

      e2e().wrap(
        e2e.imgSrcToBlob(url).then((blob: any) => {
          e2e.blobToBase64String(blob).then((base64String: string) => {
            const data = base64String.replace(/^data:image\/\w+;base64,/, '');
            e2e().writeFile(theOutputImage, data, 'base64');
          });
        })
github grafana / github-datasource / cypress / integration / smoke.spec.ts View on Github external
scenario: () => {
    e2e()
      .readProvisions([
        // Paths are relative to /provisioning
        'datasources/github.yaml',
      ])
      .then(([provision]) => addGithubDataSource(provision.datasources[0].secureJsonData.accessToken))
      .then(({ config: { name: dataSourceName } }) => {
        const variableName = 'owner';

        e2e.flows.addDashboard({
          annotations: [
            {
              dataSource: dataSourceName,
              dataSourceForm: () => e2eSelectors.AnnotationEditor.container().should('be.visible'),
              name: 'Annotations',
            },
          ],
github grafana / google-sheets-datasource / cypress / integration / something.ts View on Github external
scenario: () => {
    e2e().readProvisions([
      // Paths are relative to /provisioning
      'datasources/google-sheets-datasource-API-key.yaml',
      'datasources/google-sheets-datasource-jwt.yaml',
    ]).then(([apiKeyProvision, jwtProvision]) => {
      const { apiKey } = apiKeyProvision.datasources[0].secureJsonData;
      //const { jwt } = jwtProvision.datasources[0].secureJsonData;
      const sheetId = '1Kn_9WKsuT-H0aJL3fvqukt27HlizMLd-KQfkNgeWj4U';
      const sheetIdVariable = 'sheetId';

      //const jwtPath = 'jwt.json';
      //e2e().writeFile(`${Cypress.config('fixturesFolder')}/${jwtPath}`, jwt);

      // This gets auto-removed within `afterEach` of @grafana/e2e
      addGoogleSheetsDataSource({ apiKey });

      // This gets auto-removed within `afterEach` of @grafana/e2e
github grafana / grafana / public / e2e-tests / integration / smoketests.spec.ts View on Github external
e2e.blobToBase64String(blob).then((base64String: string) => {
            const data = base64String.replace(/^data:image\/\w+;base64,/, '');
            e2e().writeFile(theOutputImage, data, 'base64');
          });
        })
github grafana / google-sheets-datasource / cypress / integration / something.ts View on Github external
const fillJwt = (newValue: string) =>
    e2e()
      .contains('.gf-form-group', 'Auth')
      .within(() => {
        e2e.flows.selectOption({
          container: e2e.components.Select.option(),
          optionText: 'Google JWT File',
        });

        e2e()
          .get('input[type=file]')
          .attachFile(newValue);
      });
github grafana / google-sheets-datasource / cypress / integration / something.ts View on Github external
const fillApiKey = (newValue: string) =>
    e2e()
      .get('[placeholder="Enter API Key"]')
      .scrollIntoView()
      .type(newValue);