diff --git a/packages/core/src/config.js b/packages/core/src/config.js index b95a4bcd7..59e31af58 100644 --- a/packages/core/src/config.js +++ b/packages/core/src/config.js @@ -445,7 +445,9 @@ export const comparisonSchema = { windowHeight: { type: 'integer', minimum: 0 - } + }, + cliScreenshotStartTime: { type: 'integer', default: 0 }, + cliScreenshotEndTime: { type: 'integer', default: 0 } } }, tag: { diff --git a/packages/webdriver-utils/src/index.js b/packages/webdriver-utils/src/index.js index 577eb703b..e5cabca74 100644 --- a/packages/webdriver-utils/src/index.js +++ b/packages/webdriver-utils/src/index.js @@ -34,12 +34,16 @@ export default class WebdriverUtils { async automateScreenshot() { try { + const startTime = Date.now(); this.log.info(`[${this.snapshotName}] : Starting automate screenshot ...`); const automate = ProviderResolver.resolve(this.sessionId, this.commandExecutorUrl, this.capabilities, this.sessionCapabilites, this.clientInfo, this.environmentInfo, this.options, this.buildInfo); this.log.debug(`[${this.snapshotName}] : Resolved provider ...`); await automate.createDriver(); this.log.debug(`[${this.snapshotName}] : Created driver ...`); - return await automate.screenshot(this.snapshotName, this.options); + const comparisonData = await automate.screenshot(this.snapshotName, this.options); + comparisonData.metadata.cliScreenshotStartTime = startTime; + comparisonData.metadata.cliScreenshotEndTime = Date.now(); + return comparisonData; } catch (e) { this.log.error(`[${this.snapshotName}] : Error - ${e.message}`); this.log.error(`[${this.snapshotName}] : Error Log - ${e.toString()}`);