diff --git a/test_scripts/Defects/8_2/2468/2468_1_AddCommand_Both_UI_Timeout.lua b/test_scripts/Defects/8_2/2468/2468_1_AddCommand_Both_UI_Timeout.lua new file mode 100644 index 0000000000..d62deff5ca --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_1_AddCommand_Both_UI_Timeout.lua @@ -0,0 +1,50 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Timeout from UI portion of request +-- +-- Requirement summary: +-- [AddCommand] GENERIC_ERROR: getting GENERIC_ERROR on UI.AddCommand timeout +-- +-- Description: +-- Mobile application sends valid AddCommand request with both "vrCommands" and "menuParams" +-- data and gets "SUCCESS" for VR.AddCommand and no response for UI.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with both vrCommands and menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL transfers the VR part of request with allowed parameters to HMI +-- 4. SDL receives VR part of response from HMI with "SUCCESS" result code +-- 5. SDL does not receive UI part of response + +-- Expected: +-- SDL responds with (resultCode: GENERIC_ERROR, success: false) to mobile application +-- SDL sends UI.DeleteCommand and VR.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandTimeout, { false, true }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_2_AddCommand_Both_VR_Timeout.lua b/test_scripts/Defects/8_2/2468/2468_2_AddCommand_Both_VR_Timeout.lua new file mode 100644 index 0000000000..3320a16adb --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_2_AddCommand_Both_VR_Timeout.lua @@ -0,0 +1,50 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Timeout from VR portion of request +-- +-- Requirement summary: +-- [AddCommand] GENERIC_ERROR: getting GENERIC_ERROR on VR.AddCommand timeout +-- +-- Description: +-- Mobile application sends valid AddCommand request with both "vrCommands" and "menuParams" +-- data and gets "SUCCESS" for UI.AddCommand and no response for VR.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. appID is registered and activated on SDL + +-- Steps: +-- 1. appID requests AddCommand with both vrCommands and menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL transfers the VR part of request with allowed parameters to HMI +-- 4. SDL receives UI part of response from HMI with "SUCCESS" result code +-- 5. SDL does not receive VR part of response + +-- Expected: +-- SDL responds with (resultCode: GENERIC_ERROR, success: false) to mobile application +-- SDL sends UI.DeleteCommand and VR.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandTimeout, { true, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_3_AddCommand_Both_Timeout.lua b/test_scripts/Defects/8_2/2468/2468_3_AddCommand_Both_Timeout.lua new file mode 100644 index 0000000000..28272a8173 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_3_AddCommand_Both_Timeout.lua @@ -0,0 +1,49 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Timeout from UI and VR portion of request +-- +-- Requirement summary: +-- [AddCommand] GENERIC_ERROR: getting GENERIC_ERROR on VR and UI.AddCommand timeout +-- +-- Description: +-- Mobile application sends valid AddCommand request with both "vrCommands" and "menuParams" +-- data and gets no response for UI.AddCommand and VR.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with both vrCommands and menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL transfers the VR part of request with allowed parameters to HMI +-- 4. SDL does not receive UI or VR part of response + +-- Expected: +-- SDL responds with (resultCode: GENERIC_ERROR, success: false) to mobile application +-- SDL sends UI.DeleteCommand and VR.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandTimeout, { false, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_4_AddCommand_Both_UI_Failure.lua b/test_scripts/Defects/8_2/2468/2468_4_AddCommand_Both_UI_Failure.lua new file mode 100644 index 0000000000..abd79437cd --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_4_AddCommand_Both_UI_Failure.lua @@ -0,0 +1,53 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Failure from UI portion of request +-- +-- Requirement summary: +-- [AddCommand] REJECTED: Getting REJECTED on UI.AddCommand +-- +-- Description: +-- Mobile application sends valid AddCommand request with both "vrCommands" and "menuParams" +-- data and gets "SUCCESS" for VR.AddCommand and "REJECTED" for UI.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with both vrCommands and menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL transfers the VR part of request with allowed parameters to HMI +-- 4. SDL receives VR part of response from HMI with "SUCCESS" result code +-- 5. SDL receives UI part of response from HMI with "REJECTED" result code + +-- Expected: +-- SDL responds with (resultCode: REJECTED, success: false) to mobile application +-- SDL sends UI.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local uiResponseCode = "REJECTED" + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandFailure, { uiResponseCode, "SUCCESS" }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_5_AddCommand_Both_VR_Failure.lua b/test_scripts/Defects/8_2/2468/2468_5_AddCommand_Both_VR_Failure.lua new file mode 100644 index 0000000000..b5d7e0f363 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_5_AddCommand_Both_VR_Failure.lua @@ -0,0 +1,53 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Failure from VR portion of request +-- +-- Requirement summary: +-- [AddCommand] REJECTED: Getting REJECTED on VR.AddCommand +-- +-- Description: +-- Mobile application sends valid AddCommand request with both "vrCommands" and "menuParams" +-- data and gets "SUCCESS" for UI.AddCommand and "REJECTED" for VR.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with both vrCommands and menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL transfers the VR part of request with allowed parameters to HMI +-- 4. SDL receives UI part of response from HMI with "SUCCESS" result code +-- 5. SDL receives VR part of response from HMI with "REJECTED" result code + +-- Expected: +-- SDL responds with (resultCode: REJECTED, success: false) to mobile application +-- SDL sends UI.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local vrResponseCode = "REJECTED" + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandFailure, { "SUCCESS", vrResponseCode }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_6_AddCommand_UI_Only_Timeout.lua b/test_scripts/Defects/8_2/2468/2468_6_AddCommand_UI_Only_Timeout.lua new file mode 100644 index 0000000000..9f4cb75516 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_6_AddCommand_UI_Only_Timeout.lua @@ -0,0 +1,48 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Timeout from UI portion of request +-- +-- Requirement summary: +-- [AddCommand] GENERIC_ERROR: getting GENERIC_ERROR on UI.AddCommand timeout +-- +-- Description: +-- Mobile application sends valid AddCommand request with "menuParams" +-- data and gets no response for UI.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL does not receive UI part of response + +-- Expected: +-- SDL responds with (resultCode: GENERIC_ERROR, success: false) to mobile application +-- SDL sends UI.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandTimeout, { false, nil }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_7_AddCommand_UI_Only_Failure.lua b/test_scripts/Defects/8_2/2468/2468_7_AddCommand_UI_Only_Failure.lua new file mode 100644 index 0000000000..17c54a6180 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_7_AddCommand_UI_Only_Failure.lua @@ -0,0 +1,50 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Failure from UI portion of request +-- +-- Requirement summary: +-- [AddCommand] REJECTED: Getting REJECTED on UI.AddCommand +-- +-- Description: +-- Mobile application sends valid AddCommand request with "menuParams" +-- data and gets "REJECTED" for UI.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with menuParams +-- 2. SDL transfers the UI part of request with allowed parameters to HMI +-- 3. SDL receives UI part of response from HMI with "REJECTED" result code + +-- Expected: +-- SDL responds with (resultCode: REJECTED, success: false) to mobile application +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local uiResponseCode = "REJECTED" + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandFailure, { uiResponseCode, nil }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_8_AddCommand_VR_Only_Timeout.lua b/test_scripts/Defects/8_2/2468/2468_8_AddCommand_VR_Only_Timeout.lua new file mode 100644 index 0000000000..b238c1ce68 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_8_AddCommand_VR_Only_Timeout.lua @@ -0,0 +1,48 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Timeout from VR portion of request +-- +-- Requirement summary: +-- [AddCommand] GENERIC_ERROR: getting GENERIC_ERROR on VR.AddCommand timeout +-- +-- Description: +-- Mobile application sends valid AddCommand request with "vrCommands" +-- data and gets no response for VR.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with vrCommands +-- 2. SDL transfers the VR part of request with allowed parameters to HMI +-- 3. SDL does not receive VR part of response + +-- Expected: +-- SDL responds with (resultCode: GENERIC_ERROR, success: false) to mobile application +-- SDL sends VR.DeleteCommand based on the original request +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandTimeout, { nil, false }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/2468_9_AddCommand_VR_Only_Failure.lua b/test_scripts/Defects/8_2/2468/2468_9_AddCommand_VR_Only_Failure.lua new file mode 100644 index 0000000000..973c69103e --- /dev/null +++ b/test_scripts/Defects/8_2/2468/2468_9_AddCommand_VR_Only_Failure.lua @@ -0,0 +1,50 @@ +--------------------------------------------------------------------------------------------------- +-- Issue: https://github.com/smartdevicelink/sdl_core/issues/2468 +--------------------------------------------------------------------------------------------------- +-- Use case: AddCommand +-- Item: Failure from VR portion of request +-- +-- Requirement summary: +-- [AddCommand] REJECTED: Getting REJECTED on VR.AddCommand +-- +-- Description: +-- Mobile application sends valid AddCommand request with "vrCommands" +-- data and gets "REJECTED" for VR.AddCommand from HMI + +-- Pre-conditions: +-- a. HMI and SDL are started +-- b. App is registered and activated on SDL + +-- Steps: +-- 1. App requests AddCommand with vrCommands +-- 2. SDL transfers the VR part of request with allowed parameters to HMI +-- 3. SDL receives VR part of response from HMI with "REJECTED" result code + +-- Expected: +-- SDL responds with (resultCode: REJECTED, success: false) to mobile application +--------------------------------------------------------------------------------------------------- + +--[[ Required Shared libraries ]] +local runner = require('user_modules/script_runner') +local common = require('test_scripts/Defects/8_2/2468/common') + +--[[ Test Configuration ]] +runner.testSettings.isSelfIncluded = false + +--[[ Local Variables ]] +local vrResponseCode = "REJECTED" + +--[[ Scenario ]] +runner.Title("Preconditions") +runner.Step("Clean environment", common.preconditions) +runner.Step("Update Preloaded PT", common.updatePreloadedPT) +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) +runner.Step("Register App", common.registerApp) +runner.Step("Activate App", common.activateApp) +runner.Step("Upload icon file", common.putFile, { common.putFileParams }) + +runner.Title("Test") +runner.Step("AddCommand", common.addCommandFailure, { nil, vrResponseCode }) + +runner.Title("Postconditions") +runner.Step("Stop SDL", common.postconditions) diff --git a/test_scripts/Defects/8_2/2468/common.lua b/test_scripts/Defects/8_2/2468/common.lua new file mode 100644 index 0000000000..79e2d8f301 --- /dev/null +++ b/test_scripts/Defects/8_2/2468/common.lua @@ -0,0 +1,213 @@ +--------------------------------------------------------------------------------------------------- +-- Common module +--------------------------------------------------------------------------------------------------- +--[[ Required Shared libraries ]] +local common = require('test_scripts/Smoke/commonSmoke') + +common.putFileParams = { + requestParams = { + syncFileName = 'icon.png', + fileType = "GRAPHIC_PNG", + persistentFile = false, + systemFile = false + }, + filePath = "files/icon.png" +} + +local requestParams = { + cmdID = 11, + menuParams = { + position = 0, + menuName = "Commandpositive", + secondaryText = "Secondary", + tertiaryText = "Tertiary" + }, + vrCommands = { + "VRCommandonepositive", + "VRCommandonepositivedouble" + }, + cmdIcon = { + value = "icon.png", + imageType = "DYNAMIC" + }, + secondaryImage = { + value = "icon.png", + imageType = "DYNAMIC" + } +} + +local requestParamsUIOnly = { + cmdID = 11, + menuParams = { + position = 0, + menuName = "Commandpositive", + secondaryText = "Secondary", + tertiaryText = "Tertiary" + }, + cmdIcon = { + value = "icon.png", + imageType = "DYNAMIC" + }, + secondaryImage = { + value = "icon.png", + imageType = "DYNAMIC" + } +} + +local requestParamsVROnly = { + cmdID = 11, + vrCommands = { + "VRCommandonepositive", + "VRCommandonepositivedouble" + }, + cmdIcon = { + value = "icon.png", + imageType = "DYNAMIC" + }, + secondaryImage = { + value = "icon.png", + imageType = "DYNAMIC" + } +} + +local requestUiParams = { + cmdID = requestParams.cmdID, + cmdIcon = requestParams.cmdIcon, + menuParams = requestParams.menuParams, + secondaryImage = requestParams.secondaryImage +} + +local requestVrParams = { + cmdID = requestParams.cmdID, + type = "Command", + vrCommands = requestParams.vrCommands +} + +local allParams = { + requestParams = requestParams, + requestParamsUIOnly = requestParamsUIOnly, + requestParamsVROnly = requestParamsVROnly, + requestUiParams = requestUiParams, + requestVrParams = requestVrParams +} + +local function getRequestParams(includeUI, includeVR) + if not includeUI then + return allParams.requestParamsVROnly + elseif not includeVR then + return allParams.requestParamsUIOnly + else + return allParams.requestParams + end +end + +common.addCommandTimeout = function(sendUIResponse, sendVRResponse) + local requestParams = getRequestParams(sendUIResponse ~= nil, sendVRResponse ~= nil) + local cid = common.getMobileSession():SendRPC("AddCommand", requestParams) + + if sendUIResponse ~= nil then + allParams.requestUiParams.appID = common.getHMIAppId() + allParams.requestUiParams.cmdIcon.value = common.getPathToFileInAppStorage("icon.png") + allParams.requestUiParams.secondaryImage.value = common.getPathToFileInAppStorage("icon.png") + common.getHMIConnection():ExpectRequest("UI.AddCommand", allParams.requestUiParams) + :Do(function(_, data) + if sendUIResponse then + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) + end + common.getHMIConnection():ExpectRequest("UI.DeleteCommand", { + cmdID = allParams.requestParams.cmdID + }):Timeout(20000) + end) + else + common.getHMIConnection():ExpectRequest("UI.AddCommand"):Times(0) + end + + if sendVRResponse ~= nil then + allParams.requestVrParams.appID = common.getHMIAppId() + common.getHMIConnection():ExpectRequest("VR.AddCommand", allParams.requestVrParams) + :Do(function(_, data) + if sendVRResponse then + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) + end + common.getHMIConnection():ExpectRequest("VR.DeleteCommand", { + cmdID = allParams.requestParams.cmdID, + type = "Command", + grammarID = data.params.grammarID + }):Timeout(20000) + end) + :ValidIf(function(_, data) + if data.params.grammarID ~= nil then + return true + else + return false, "grammarID should not be empty" + end + end) + else + common.getHMIConnection():ExpectRequest("VR.AddCommand"):Times(0) + end + + common.getMobileSession():ExpectResponse(cid, { + success = false, + resultCode = "GENERIC_ERROR" + }):Timeout(20000) + common.getMobileSession():ExpectNotification("OnHashChange"):Times(0) +end + +common.addCommandFailure = function(uiResult, vrResult) + local requestParams = getRequestParams(uiResult ~= nil, vrResult ~= nil) + local cid = common.getMobileSession():SendRPC("AddCommand", requestParams) + + if uiResult ~= nil then + allParams.requestUiParams.appID = common.getHMIAppId() + allParams.requestUiParams.cmdIcon.value = common.getPathToFileInAppStorage("icon.png") + allParams.requestUiParams.secondaryImage.value = common.getPathToFileInAppStorage("icon.png") + common.getHMIConnection():ExpectRequest("UI.AddCommand", allParams.requestUiParams) + :Do(function(_, data) + common.getHMIConnection():SendResponse(data.id, data.method, uiResult, {}) + if uiResult == "SUCCESS" then + common.getHMIConnection():ExpectRequest("UI.DeleteCommand", { + cmdID = allParams.requestParams.cmdID + }) + else + common.getHMIConnection():ExpectRequest("UI.DeleteCommand"):Times(0) + end + end) + else + common.getHMIConnection():ExpectRequest("UI.AddCommand"):Times(0) + end + + if vrResult ~= nil then + allParams.requestVrParams.appID = common.getHMIAppId() + common.getHMIConnection():ExpectRequest("VR.AddCommand", allParams.requestVrParams) + :Do(function(_, data) + common.getHMIConnection():SendResponse(data.id, data.method, vrResult, {}) + if vrResult == "SUCCESS" then + common.getHMIConnection():ExpectRequest("VR.DeleteCommand", { + cmdID = allParams.requestParams.cmdID, + type = "Command", + grammarID = data.params.grammarID + }) + else + common.getHMIConnection():ExpectRequest("VR.DeleteCommand"):Times(0) + end + end) + :ValidIf(function(_, data) + if data.params.grammarID ~= nil then + return true + else + return false, "grammarID should not be empty" + end + end) + else + common.getHMIConnection():ExpectRequest("VR.AddCommand"):Times(0) + end + + local mobileResult = uiResult == "SUCCESS" and vrResult or uiResult + common.getMobileSession():ExpectResponse(cid, { + success = false, + resultCode = mobileResult + }) + common.getMobileSession():ExpectNotification("OnHashChange"):Times(0) +end + +return common \ No newline at end of file diff --git a/test_scripts/Smoke/API/003_AddCommand_PositiveCase_SUCCESS.lua b/test_scripts/Smoke/API/003_AddCommand_PositiveCase_SUCCESS.lua index 43a2e42b27..05661241fc 100644 --- a/test_scripts/Smoke/API/003_AddCommand_PositiveCase_SUCCESS.lua +++ b/test_scripts/Smoke/API/003_AddCommand_PositiveCase_SUCCESS.lua @@ -1,6 +1,6 @@ --------------------------------------------------------------------------------------------------- -- User story: Smoke --- Use case: AddComand +-- Use case: AddCommand -- Item: Happy path -- -- Requirement summary: @@ -61,7 +61,6 @@ local requestParams = { "VRCommandonepositive", "VRCommandonepositivedouble" }, - grammarID = 1, cmdIcon = { value = "icon.png", imageType = "DYNAMIC" diff --git a/test_sets/Defects/Defects_release_8_2.txt b/test_sets/Defects/Defects_release_8_2.txt index b2992fa647..d35b167457 100644 --- a/test_sets/Defects/Defects_release_8_2.txt +++ b/test_sets/Defects/Defects_release_8_2.txt @@ -1,3 +1,12 @@ +./test_scripts/Defects/8_2/2468_1_AddCommand_Both_UI_Timeout.lua +./test_scripts/Defects/8_2/2468_2_AddCommand_Both_VR_Timeout.lua +./test_scripts/Defects/8_2/2468_3_AddCommand_Both_Timeout.lua +./test_scripts/Defects/8_2/2468_4_AddCommand_Both_UI_Failure.lua +./test_scripts/Defects/8_2/2468_5_AddCommand_Both_VR_Failure.lua +./test_scripts/Defects/8_2/2468_6_AddCommand_UI_Only_Timeout.lua +./test_scripts/Defects/8_2/2468_7_AddCommand_UI_Only_Failure.lua +./test_scripts/Defects/8_2/2468_8_AddCommand_VR_Only_Timeout.lua +./test_scripts/Defects/8_2/2468_9_AddCommand_VR_Only_Failure.lua ./test_scripts/Defects/8_2/3895_SDL_sends_redundant_BC_PolicyUpdate.lua ./test_scripts/Defects/8_2/3912_PTS_With_WSS_App_Content_Length.lua ./test_scripts/Defects/8_2/3909_vrHelp_resumption_after_ResetGlobalProperties.lua