From 14357555b70608b9c6ebf60d29afd2f10b6448fb Mon Sep 17 00:00:00 2001 From: Oleg Krupenich Date: Tue, 30 Oct 2018 13:06:24 +0200 Subject: [PATCH] Split method checkShowConstantTBT to 2 variants --- ...rameter_between_MOBILE_API_and_HMI_API.lua | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/test_scripts/Defects/5_0/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua b/test_scripts/Defects/5_0/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua index d1a87289f9..8ab24a0957 100644 --- a/test_scripts/Defects/5_0/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua +++ b/test_scripts/Defects/5_0/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua @@ -30,9 +30,8 @@ local common = require('user_modules/sequences/actions') --[[ Test Configuration ]] runner.testSettings.isSelfIncluded = false - --[[ Local Variables ]] -local responseUiParams = { +local params = { distanceToManeuver = 50.1, distanceToManeuverScale = 100.2 } @@ -42,13 +41,30 @@ local function ptuFunc(tbl) tbl.policy_table.app_policies["0000001"].groups = {"Base-4", "Navigation-1"} end -local function checkShowConstantTBT(pParams, pResultTable) +local function checkShowConstantTBTPositive(pParams) local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) :Do(function(_, data) - common.getHMIConnection():SendResponse(data.id, data.method, pResultTable.resultCode, {}) + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) end) - common.getMobileSession():ExpectResponse(cid, pResultTable) + + common.getMobileSession():ExpectResponse(cid, { + success = true, + resultCode = "SUCCESS" + }) +end + +local function checkShowConstantTBTNegative(pParams) + local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) + + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) + :Times(0) + + common.getMobileSession():ExpectResponse(cid, { + success = false, + resultCode = "INVALID_DATA" + }) end --[[ Scenario ]] @@ -60,14 +76,13 @@ runner.Step("Activate App", common.activateApp) runner.Step("PTU", common.policyTableUpdate, { ptuFunc }) runner.Title("Test") -runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBT, {{ - distanceToManeuverScale = responseUiParams.distanceToManeuver - }, {success = false, resultCode = "INVALID_DATA"}}) -runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBT, {{ - distanceToManeuver = responseUiParams.distanceToManeuver - }, {success = false, resultCode = "INVALID_DATA"}}) -runner.Step("Positive case for ShowConstantTBT", checkShowConstantTBT, {responseUiParams - , {success = true, resultCode = "SUCCESS"}}) +runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{ + distanceToManeuverScale = params.distanceToManeuver + }}) +runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBTNegative, {{ + distanceToManeuver = params.distanceToManeuver + }}) +runner.Step("Positive case for ShowConstantTBT", checkShowConstantTBTPositive, {params}) runner.Title("Postconditions") runner.Step("Stop SDL", common.postconditions)