Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATF Script for defect 1846 #2120

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/SmartDeviceLink/sdl_core/issues/1846
--
-- Description:
-- Mismatch for mandatory parameter between MOBILE_API and HMI_API
--
-- Preconditions:
-- 1) Clear environment
-- 2) SDL started, HMI and mobile session connected
-- 3) Registered and activated app
-- 4) PTU
--
-- Steps:
-- 1) send mobile RPC "ShowConstantTBT" without "distanceToManeuver" param
-- and recieve resultCode = "INVALID_DATA"
-- 2) send mobile RPC "ShowConstantTBT" without "distanceToManeuverScale" param
-- and recieve resultCode = "INVALID_DATA"
-- 3) send mobile RPC "ShowConstantTBT" with "distanceToManeuver" and
-- "distanceToManeuverScale" params and recieve resultCode = "SUCCESS"
--
-- Expected:
-- Params "distanceToManeuver" and "distanceToManeuverScale" of the mobile RPC "ShowConstantTBT"
-- should be mandatory
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('user_modules/sequences/actions')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false

--[[ Local Variables ]]
local params = {
distanceToManeuver = 50.1,
distanceToManeuverScale = 100.2
}

--[[ Local Functions ]]
local function ptuFunc(tbl)
tbl.policy_table.app_policies["0000001"].groups = {"Base-4", "Navigation-1"}
end

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, "SUCCESS", {})
end)

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 ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)
runner.Step("PTU", common.policyTableUpdate, { ptuFunc })

runner.Title("Test")
runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{
distanceToManeuverScale = params.distanceToManeuverScale
}})
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)
1 change: 1 addition & 0 deletions test_sets/Defects/Defects_release_7_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@
./test_scripts/Defects/7_1/3620/3620_3_RPC_Service_NACK_non_existed_session_id.lua
./test_scripts/Defects/7_1/3620/3620_4_RPC_Service_NACK_protected_non_existed_session_id.lua
./test_scripts/Defects/7_1/3620/3620_5_RPC_Service_NACK_before_OnSystemTimeReady.lua
./test_scripts/Defects/7_1/1846_Mismatch_for_mandatory_parameter_between_MOBILE_API_and_HMI_API.lua