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

[SDL 0180] Broaden Choice Uniqueness #2501

Merged
merged 6 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
61 changes: 61 additions & 0 deletions test_scripts/API/SameMenuName/001_AddCommand.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---------------------------------------------------------------------------------------------------
-- Proposal: SDL 0180 Broaden Choice Uniqueness
--
-- Description:
-- Mobile shall be able to send two AddCommand RPCs with identical menuName values.
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('test_scripts/Smoke/commonSmoke')

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

--[[ Local Variables ]]
local menuParams = {
position = 0,
menuName = "menuName"
iCollin marked this conversation as resolved.
Show resolved Hide resolved
}

local requestParams1 = {
cmdID = 499,
menuParams = menuParams
}

local requestParams2 = {
cmdID = 500,
menuParams = menuParams
iCollin marked this conversation as resolved.
Show resolved Hide resolved
}

--[[ Local Functions ]]
local function addCommand(pParams)
local cid = common.getMobileSession():SendRPC("AddCommand", pParams)

local hmiRequestParams = {
cmdID = pParams.cmdID,
jacobkeeler marked this conversation as resolved.
Show resolved Hide resolved
appID = common.getHMIAppId()
}
common.getHMIConnection():ExpectRequest("UI.AddCommand", hmiRequestParams)
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
end)

common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
common.getMobileSession():ExpectNotification("OnHashChange")
end

--[[ 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.Title("Test")
runner.Step("AddCommand Positive Case", addCommand, { requestParams1 })
runner.Step("AddCommand With Same Menu Name", addCommand, { requestParams2 })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
51 changes: 51 additions & 0 deletions test_scripts/API/SameMenuName/002_CreateInteractionChoiceSet.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---------------------------------------------------------------------------------------------------
-- Proposal: SDL 0180 Broaden Choice Uniqueness
--
-- Description:
-- Mobile shall be able to send a CreateInteractionChoiceSet RPC where two choices within the
-- choice set have identical menuName values.
---------------------------------------------------------------------------------------------------

--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('test_scripts/Smoke/commonSmoke')

--[[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.syncMsgVersion.majorVersion = 5
config.application1.registerAppInterfaceParams.syncMsgVersion.minorVersion = 0
jacobkeeler marked this conversation as resolved.
Show resolved Hide resolved

--[[ Local Variables ]]
local requestParams = {
interactionChoiceSetID = 499,
choiceSet = {
{
choiceID = 42,
menuName = "menuName"
},
{
choiceID = 43,
menuName = "menuName"
}
}
}

--[[ Local Functions ]]
local function createInteractionChoiceSet(pParams)
local cid = common.getMobileSession():SendRPC("CreateInteractionChoiceSet", pParams)
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
end

--[[ 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.Title("Test")
runner.Step("CreateInteractionChoiceSet Positive Case", createInteractionChoiceSet, { requestParams })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
2 changes: 2 additions & 0 deletions test_sets/smoke_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,5 @@
./test_scripts/Smoke/Resumption/011_Resumption_unexpected_disconnect.lua
./test_scripts/Smoke/ShutDown/001_ShutDown_IGNITION_OFF.lua
./test_scripts/Smoke/ShutDown/002_ShutDown_MASTER_RESET.lua
./test_scripts/API/SameMenuName/001_AddCommand.lua
iCollin marked this conversation as resolved.
Show resolved Hide resolved
./test_scripts/API/SameMenuName/002_CreateInteractionChoiceSet.lua