Skip to content

Commit 6a5de14

Browse files
Chore: Remove compareScreenshot + blink-diff dependency from core (#77920)
* remove compareScreenshot + blink-diff dependency from core * missed one...
1 parent dff9716 commit 6a5de14

File tree

8 files changed

+0
-84
lines changed

8 files changed

+0
-84
lines changed

cypress.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const fs = require('fs');
33
const path = require('path');
44

55
const benchmarkPlugin = require('./e2e/cypress/plugins/benchmark/index');
6-
const compareScreenshots = require('./e2e/cypress/plugins/compareScreenshots');
76
const readProvisions = require('./e2e/cypress/plugins/readProvisions');
87
const typescriptPreprocessor = require('./e2e/cypress/plugins/typescriptPreprocessor');
98

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

3130
on('task', {
32-
compareScreenshots,
3331
readProvisions: (filePaths) => readProvisions({ CWD: process.cwd(), filePaths }),
3432
});
3533

e2e/cypress/plugins/compareScreenshots.js

-49
This file was deleted.

e2e/cypress/plugins/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require('fs');
22
const path = require('path');
33

44
const benchmarkPlugin = require('./benchmark');
5-
const compareScreenshots = require('./compareScreenshots');
65
const extendConfig = require('./extendConfig');
76
const readProvisions = require('./readProvisions');
87
const typescriptPreprocessor = require('./typescriptPreprocessor');
@@ -13,7 +12,6 @@ module.exports = (on, config) => {
1312
}
1413

1514
on('file:preprocessor', typescriptPreprocessor);
16-
on('task', { compareScreenshots, readProvisions });
1715
on('task', {
1816
log({ message, optional }) {
1917
optional ? console.log(message, optional) : console.log(message);

e2e/cypress/support/commands.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
import 'cypress-file-upload';
22

3-
Cypress.Commands.add('compareScreenshots', (config) => {
4-
cy.task('compareScreenshots', {
5-
config,
6-
screenshotsFolder: Cypress.config('screenshotsFolder'),
7-
specName: Cypress.spec.name,
8-
});
9-
});
10-
113
Cypress.Commands.add('logToConsole', (message, optional) => {
124
cy.task('log', { message: '(' + new Date().toISOString() + ') ' + message, optional });
135
});

e2e/cypress/support/index.d.ts

-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
/// <reference types="cypress" />
22

3-
interface CompareScreenshotsConfig {
4-
name: string;
5-
threshold?: number;
6-
}
7-
83
declare namespace Cypress {
94
interface Chainable {
10-
compareScreenshots(config: CompareScreenshotsConfig | string): Chainable;
115
logToConsole(message: string, optional?: unknown): void;
126
readProvisions(filePaths: string[]): Chainable;
137
getJSONFilesFromDir(dirPath: string): Chainable;

e2e/utils/flows/configurePanel.ts

-15
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ interface ConfigurePanelDefault {
2121
route: string | RegExp;
2222
};
2323
dashboardUid: string;
24-
matchScreenshot: boolean;
2524
saveDashboard: boolean;
26-
screenshotName: string;
2725
visitDashboardAtStart: boolean; // @todo remove when possible
2826
}
2927

@@ -60,9 +58,7 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
6058
route: '/api/ds/query',
6159
},
6260
dashboardUid: lastAddedDashboardUid,
63-
matchScreenshot: false,
6461
saveDashboard: true,
65-
screenshotName: 'panel-visualization',
6662
visitDashboardAtStart: true,
6763
...config,
6864
};
@@ -72,10 +68,8 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
7268
dashboardUid,
7369
dataSourceName,
7470
isEdit,
75-
matchScreenshot,
7671
panelTitle,
7772
queriesForm,
78-
screenshotName,
7973
timeRange,
8074
visitDashboardAtStart,
8175
visualizationName,
@@ -157,15 +151,6 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
157151
// Wait for RxJS
158152
cy.wait(timeout ?? Cypress.config().defaultCommandTimeout);
159153

160-
if (matchScreenshot) {
161-
let visualization;
162-
163-
visualization = e2e.components.Panels.Panel.containerByTitle(panelTitle).find('.panel-content');
164-
165-
visualization.scrollIntoView().screenshot(screenshotName);
166-
cy.compareScreenshots(screenshotName);
167-
}
168-
169154
// @todo remove `wrap` when possible
170155
return cy.wrap({ config: fullConfig }, { log: false });
171156
});

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@
159159
"babel-loader": "9.1.3",
160160
"babel-plugin-angularjs-annotate": "0.10.0",
161161
"babel-plugin-macros": "3.1.0",
162-
"blink-diff": "1.0.13",
163162
"blob-polyfill": "7.0.20220408",
164163
"browserslist": "^4.21.4",
165164
"chance": "^1.0.10",

yarn.lock

-1
Original file line numberDiff line numberDiff line change
@@ -17484,7 +17484,6 @@ __metadata:
1748417484
babel-plugin-angularjs-annotate: "npm:0.10.0"
1748517485
babel-plugin-macros: "npm:3.1.0"
1748617486
baron: "npm:3.0.3"
17487-
blink-diff: "npm:1.0.13"
1748817487
blob-polyfill: "npm:7.0.20220408"
1748917488
brace: "npm:0.11.1"
1749017489
browserslist: "npm:^4.21.4"

0 commit comments

Comments
 (0)