|
| 1 | +--------------------------------------------------------------------------------------------------- |
| 2 | +-- User story: https://github.com/SmartDeviceLink/sdl_core/issues/1846 |
| 3 | +-- |
| 4 | +-- Description: |
| 5 | +-- Mismatch for mandatory parameter between MOBILE_API and HMI_API |
| 6 | +-- |
| 7 | +-- Preconditions: |
| 8 | +-- 1) Clear environment |
| 9 | +-- 2) SDL started, HMI and mobile session connected |
| 10 | +-- 3) Registered and activated app |
| 11 | +-- 5) PTU |
| 12 | +-- |
| 13 | +-- Steps: |
| 14 | +-- 1) send mobile RPC "ShowConstantTBT" without "distanceToManeuver" param |
| 15 | +-- and recieve resultCode = "INVALID_DATA" |
| 16 | +-- 2) send mobile RPC "ShowConstantTBT" without "distanceToManeuverScale" param |
| 17 | +-- and recieve resultCode = "INVALID_DATA" |
| 18 | +-- 3) send mobile RPC "ShowConstantTBT" with "distanceToManeuver" and |
| 19 | +-- "distanceToManeuverScale" params and recieve resultCode = "SUCCESS" |
| 20 | +-- |
| 21 | +-- Expected: |
| 22 | +-- Params "distanceToManeuver" and "distanceToManeuverScale" of the mobile RPC "ShowConstantTBT" |
| 23 | +-- should be mandatory |
| 24 | +--------------------------------------------------------------------------------------------------- |
| 25 | + |
| 26 | +--[[ Required Shared libraries ]] |
| 27 | +local runner = require('user_modules/script_runner') |
| 28 | +local common = require('user_modules/sequences/actions') |
| 29 | + |
| 30 | +--[[ Test Configuration ]] |
| 31 | +runner.testSettings.isSelfIncluded = false |
| 32 | + |
| 33 | +--[[ Local Variables ]] |
| 34 | +local params = { |
| 35 | + distanceToManeuver = 50.1, |
| 36 | + distanceToManeuverScale = 100.2 |
| 37 | +} |
| 38 | + |
| 39 | +--[[ Local Functions ]] |
| 40 | +local function ptuFunc(tbl) |
| 41 | + tbl.policy_table.app_policies["0000001"].groups = {"Base-4", "Navigation-1"} |
| 42 | +end |
| 43 | + |
| 44 | +local function checkShowConstantTBTPositive(pParams) |
| 45 | + local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) |
| 46 | + |
| 47 | + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) |
| 48 | + :Do(function(_, data) |
| 49 | + common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) |
| 50 | + end) |
| 51 | + |
| 52 | + common.getMobileSession():ExpectResponse(cid, { |
| 53 | + success = true, |
| 54 | + resultCode = "SUCCESS" |
| 55 | + }) |
| 56 | +end |
| 57 | + |
| 58 | +local function checkShowConstantTBTNegative(pParams) |
| 59 | + local cid = common.getMobileSession():SendRPC("ShowConstantTBT", pParams) |
| 60 | + |
| 61 | + common.getHMIConnection():ExpectRequest("Navigation.ShowConstantTBT", pParams) |
| 62 | + :Times(0) |
| 63 | + |
| 64 | + common.getMobileSession():ExpectResponse(cid, { |
| 65 | + success = false, |
| 66 | + resultCode = "INVALID_DATA" |
| 67 | + }) |
| 68 | +end |
| 69 | + |
| 70 | +--[[ Scenario ]] |
| 71 | +runner.Title("Preconditions") |
| 72 | +runner.Step("Clean environment", common.preconditions) |
| 73 | +runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) |
| 74 | +runner.Step("RAI", common.registerApp) |
| 75 | +runner.Step("Activate App", common.activateApp) |
| 76 | +runner.Step("PTU", common.policyTableUpdate, { ptuFunc }) |
| 77 | + |
| 78 | +runner.Title("Test") |
| 79 | +runner.Step("Negative check mandatory parameter distanceToManeuver", checkShowConstantTBTNegative, {{ |
| 80 | + distanceToManeuverScale = params.distanceToManeuver |
| 81 | + }}) |
| 82 | +runner.Step("Negative check mandatory parameter distanceToManeuverScale", checkShowConstantTBTNegative, {{ |
| 83 | + distanceToManeuver = params.distanceToManeuver |
| 84 | + }}) |
| 85 | +runner.Step("Positive case for ShowConstantTBT", checkShowConstantTBTPositive, {params}) |
| 86 | + |
| 87 | +runner.Title("Postconditions") |
| 88 | +runner.Step("Stop SDL", common.postconditions) |
0 commit comments