Skip to content

Commit

Permalink
Update tests for main menu ui updates (#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Byrne authored Feb 11, 2021
1 parent d92a98f commit 8379025
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
16 changes: 12 additions & 4 deletions test_scripts/Smoke/API/003_AddCommand_PositiveCase_SUCCESS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,30 @@ local requestParams = {
cmdID = 11,
menuParams = {
position = 0,
menuName ="Commandpositive"
menuName = "Commandpositive",
secondaryText = "Secondary",
tertiaryText = "Tertiary"
},
vrCommands = {
"VRCommandonepositive",
"VRCommandonepositivedouble"
},
grammarID = 1,
cmdIcon = {
value ="icon.png",
imageType ="DYNAMIC"
value = "icon.png",
imageType = "DYNAMIC"
},
secondaryImage = {
value = "icon.png",
imageType = "DYNAMIC"
}
}

local responseUiParams = {
cmdID = requestParams.cmdID,
cmdIcon = requestParams.cmdIcon,
menuParams = requestParams.menuParams
menuParams = requestParams.menuParams,
secondaryImage = requestParams.secondaryImage
}

local responseVrParams = {
Expand All @@ -90,6 +97,7 @@ local function addCommand(pParams)

pParams.responseUiParams.appID = common.getHMIAppId()
pParams.responseUiParams.cmdIcon.value = common.getPathToFileInAppStorage("icon.png")
pParams.responseUiParams.secondaryImage.value = common.getPathToFileInAppStorage("icon.png")
common.getHMIConnection():ExpectRequest("UI.AddCommand", pParams.responseUiParams)
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
Expand Down
28 changes: 26 additions & 2 deletions test_scripts/Smoke/API/005_AddSubMenu_PositiveCase_SUCCESS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,39 @@ local common = require('test_scripts/Smoke/commonSmoke')
runner.testSettings.isSelfIncluded = false

--[[ Local Variables ]]
local putFileParams = {
requestParams = {
syncFileName = 'icon.png',
fileType = "GRAPHIC_PNG",
persistentFile = false,
systemFile = false
},
filePath = "files/icon.png"
}

local requestParams = {
menuID = 1000,
position = 500,
menuName ="SubMenupositive"
menuName ="SubMenupositive",
secondaryText = "Secondary",
tertiaryText = "Tertiary",
secondaryImage = {
value = "icon.png",
imageType = "DYNAMIC"
}
}

local responseUiParams = {
menuID = requestParams.menuID,
menuParams = {
position = requestParams.position,
menuName = requestParams.menuName
menuName = requestParams.menuName,
secondaryText = requestParams.secondaryText,
tertiaryText = requestParams.tertiaryText
},
secondaryImage = {
value = "icon.png",
imageType = "DYNAMIC"
}
}

Expand All @@ -59,6 +81,7 @@ local function addSubMenu(pParams)
local cid = common.getMobileSession():SendRPC("AddSubMenu", pParams.requestParams)

pParams.responseUiParams.appID = common.getHMIAppId()
pParams.responseUiParams.secondaryImage.value = common.getPathToFileInAppStorage("icon.png")
common.getHMIConnection():ExpectRequest("UI.AddSubMenu", pParams.responseUiParams)
:Do(function(_, data)
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {})
Expand All @@ -75,6 +98,7 @@ 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, { putFileParams })

runner.Title("Test")
runner.Step("AddSubMenu Positive Case", addSubMenu, { allParams })
Expand Down

0 comments on commit 8379025

Please sign in to comment.