From 1992c47c2412b076f3ac6b32c8b27e69b4331597 Mon Sep 17 00:00:00 2001 From: rev-doshi Date: Thu, 3 Oct 2024 17:12:16 +0530 Subject: [PATCH] code review comment --- nightwatch/globals.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/nightwatch/globals.js b/nightwatch/globals.js index 2b47553..1d18cf3 100644 --- a/nightwatch/globals.js +++ b/nightwatch/globals.js @@ -295,15 +295,11 @@ module.exports = { try { testObservability.configure(settings); if (helper.isTestObservabilitySession()) { - if (settings.reporter_options) { - if (settings.reporter_options['save_command_result_value'] != true){ - settings.reporter_options['save_command_result_value'] = true - } - } else { - settings.reporter_options = { - save_command_result_value: true - } - } + // adding settings.reporter_options.save_command_result_value = true to ensure screenshot reporting to Observability + settings.reporter_options = { + save_command_result_value: true, + ...(settings.reporter_options || {}) + }; if (helper.isCucumberTestSuite(settings)) { cucumberPatcher(); process.env.CUCUMBER_SUITE = 'true';