Skip to content

Commit

Permalink
Chore: Remove compareScreenshot + blink-diff dependency from core (
Browse files Browse the repository at this point in the history
…grafana#77920)

* remove compareScreenshot + blink-diff dependency from core

* missed one...
  • Loading branch information
ashharrison90 authored Nov 9, 2023
1 parent dff9716 commit 6a5de14
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 84 deletions.
2 changes: 0 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const fs = require('fs');
const path = require('path');

const benchmarkPlugin = require('./e2e/cypress/plugins/benchmark/index');
const compareScreenshots = require('./e2e/cypress/plugins/compareScreenshots');
const readProvisions = require('./e2e/cypress/plugins/readProvisions');
const typescriptPreprocessor = require('./e2e/cypress/plugins/typescriptPreprocessor');

Expand All @@ -29,7 +28,6 @@ module.exports = defineConfig({
}

on('task', {
compareScreenshots,
readProvisions: (filePaths) => readProvisions({ CWD: process.cwd(), filePaths }),
});

Expand Down
49 changes: 0 additions & 49 deletions e2e/cypress/plugins/compareScreenshots.js

This file was deleted.

2 changes: 0 additions & 2 deletions e2e/cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ const fs = require('fs');
const path = require('path');

const benchmarkPlugin = require('./benchmark');
const compareScreenshots = require('./compareScreenshots');
const extendConfig = require('./extendConfig');
const readProvisions = require('./readProvisions');
const typescriptPreprocessor = require('./typescriptPreprocessor');
Expand All @@ -13,7 +12,6 @@ module.exports = (on, config) => {
}

on('file:preprocessor', typescriptPreprocessor);
on('task', { compareScreenshots, readProvisions });
on('task', {
log({ message, optional }) {
optional ? console.log(message, optional) : console.log(message);
Expand Down
8 changes: 0 additions & 8 deletions e2e/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
import 'cypress-file-upload';

Cypress.Commands.add('compareScreenshots', (config) => {
cy.task('compareScreenshots', {
config,
screenshotsFolder: Cypress.config('screenshotsFolder'),
specName: Cypress.spec.name,
});
});

Cypress.Commands.add('logToConsole', (message, optional) => {
cy.task('log', { message: '(' + new Date().toISOString() + ') ' + message, optional });
});
Expand Down
6 changes: 0 additions & 6 deletions e2e/cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
/// <reference types="cypress" />

interface CompareScreenshotsConfig {
name: string;
threshold?: number;
}

declare namespace Cypress {
interface Chainable {
compareScreenshots(config: CompareScreenshotsConfig | string): Chainable;
logToConsole(message: string, optional?: unknown): void;
readProvisions(filePaths: string[]): Chainable;
getJSONFilesFromDir(dirPath: string): Chainable;
Expand Down
15 changes: 0 additions & 15 deletions e2e/utils/flows/configurePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ interface ConfigurePanelDefault {
route: string | RegExp;
};
dashboardUid: string;
matchScreenshot: boolean;
saveDashboard: boolean;
screenshotName: string;
visitDashboardAtStart: boolean; // @todo remove when possible
}

Expand Down Expand Up @@ -60,9 +58,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
route: '/api/ds/query',
},
dashboardUid: lastAddedDashboardUid,
matchScreenshot: false,
saveDashboard: true,
screenshotName: 'panel-visualization',
visitDashboardAtStart: true,
...config,
};
Expand All @@ -72,10 +68,8 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
dashboardUid,
dataSourceName,
isEdit,
matchScreenshot,
panelTitle,
queriesForm,
screenshotName,
timeRange,
visitDashboardAtStart,
visualizationName,
Expand Down Expand Up @@ -157,15 +151,6 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
// Wait for RxJS
cy.wait(timeout ?? Cypress.config().defaultCommandTimeout);

if (matchScreenshot) {
let visualization;

visualization = e2e.components.Panels.Panel.containerByTitle(panelTitle).find('.panel-content');

visualization.scrollIntoView().screenshot(screenshotName);
cy.compareScreenshots(screenshotName);
}

// @todo remove `wrap` when possible
return cy.wrap({ config: fullConfig }, { log: false });
});
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
"babel-loader": "9.1.3",
"babel-plugin-angularjs-annotate": "0.10.0",
"babel-plugin-macros": "3.1.0",
"blink-diff": "1.0.13",
"blob-polyfill": "7.0.20220408",
"browserslist": "^4.21.4",
"chance": "^1.0.10",
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17484,7 +17484,6 @@ __metadata:
babel-plugin-angularjs-annotate: "npm:0.10.0"
babel-plugin-macros: "npm:3.1.0"
baron: "npm:3.0.3"
blink-diff: "npm:1.0.13"
blob-polyfill: "npm:7.0.20220408"
brace: "npm:0.11.1"
browserslist: "npm:^4.21.4"
Expand Down

0 comments on commit 6a5de14

Please sign in to comment.