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

move MenuLayoutsAvailable to WindowCapability #2268

Merged
merged 2 commits into from
Sep 24, 2019
Merged
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
84 changes: 76 additions & 8 deletions test_scripts/Smoke/API/049_SetMenuLayout_SUCCESS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSmoke = require('test_scripts/Smoke/commonSmoke')
local hmi_values = require('user_modules/hmi_values')

--[[ Local Variables ]]
local addSubMenuParams = {
Expand All @@ -44,8 +43,83 @@ local successResponse = {
resultCode = "SUCCESS"
}

local onSystemCapabilityUpdatedParams = {
systemCapability = {
systemCapabilityType = "DISPLAYS",
displayCapabilities = {
{
displayName = "displayName",
windowTypeSupported = {
{
type = "MAIN",
maximumNumberOfWindows = 1
},
{
type = "WIDGET",
maximumNumberOfWindows = 2
}
},
windowCapabilities = {
{
menuLayoutsAvailable = { "LIST", "TILES" },
textFields = {
{
name = "mainField1",
characterSet = "TYPE2SET",
width = 1,
rows = 1
}
},
imageFields = {
{
name = "choiceImage",
imageTypeSupported = { "GRAPHIC_PNG"
},
imageResolution = {
resolutionWidth = 35,
resolutionHeight = 35
}
}
},
imageTypeSupported = {
"STATIC"
},
templatesAvailable = {
"Template1", "Template2", "Template3", "Template4", "Template5"
},
numCustomPresetsAvailable = 100,
buttonCapabilities = {
{
longPressAvailable = true,
name = "VOLUME_UP",
shortPressAvailable = true,
upDownAvailable = false
}
},
softButtonCapabilities = {
{
shortPressAvailable = true,
longPressAvailable = true,
upDownAvailable = true,
imageSupported = true,
textSupported = true
}
}
}
}
}
}
}
}

--[[ Local Functions ]]
local function setMenuLayoutTiles(self)
onSystemCapabilityUpdatedParams.appID = commonSmoke.getHMIAppId()
self.hmiConnection:SendNotification("BasicCommunication.OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)

onSystemCapabilityUpdatedParams.appID = nil
self.mobileSession1:ExpectNotification("OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)

local cid = self.mobileSession1:SendRPC("SetGlobalProperties", setGlobalPropertiesParams)

EXPECT_HMICALL("UI.SetGlobalProperties", {})
Expand All @@ -63,16 +137,10 @@ local function setMenuLayoutTiles(self)
end)
end

local function getHMIParams()
local params = hmi_values.getDefaultHMITable()
params.UI.GetCapabilities.params.displayCapabilities.menuLayoutsAvailable = { "LIST", "TILES" }
return params
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSmoke.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSmoke.start, { getHMIParams() })
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSmoke.start)
runner.Step("RAI", commonSmoke.registerApp)
runner.Step("Activate App", commonSmoke.activateApp)

Expand Down
84 changes: 76 additions & 8 deletions test_scripts/Smoke/API/050_SetMenuLayout_unsupported_WARNINGS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSmoke = require('test_scripts/Smoke/commonSmoke')
local hmi_values = require('user_modules/hmi_values')

--[[ Local Variables ]]
local addSubMenuParams = {
Expand All @@ -45,8 +44,83 @@ local warningsResponse = {
resultCode = "WARNINGS"
}

local onSystemCapabilityUpdatedParams = {
systemCapability = {
systemCapabilityType = "DISPLAYS",
displayCapabilities = {
{
displayName = "displayName",
windowTypeSupported = {
{
type = "MAIN",
maximumNumberOfWindows = 1
},
{
type = "WIDGET",
maximumNumberOfWindows = 2
}
},
windowCapabilities = {
{
menuLayoutsAvailable = { "LIST" },
textFields = {
{
name = "mainField1",
characterSet = "TYPE2SET",
width = 1,
rows = 1
}
},
imageFields = {
{
name = "choiceImage",
imageTypeSupported = { "GRAPHIC_PNG"
},
imageResolution = {
resolutionWidth = 35,
resolutionHeight = 35
}
}
},
imageTypeSupported = {
"STATIC"
},
templatesAvailable = {
"Template1", "Template2", "Template3", "Template4", "Template5"
},
numCustomPresetsAvailable = 100,
buttonCapabilities = {
{
longPressAvailable = true,
name = "VOLUME_UP",
shortPressAvailable = true,
upDownAvailable = false
}
},
softButtonCapabilities = {
{
shortPressAvailable = true,
longPressAvailable = true,
upDownAvailable = true,
imageSupported = true,
textSupported = true
}
}
}
}
}
}
}
}

--[[ Local Functions ]]
local function setMenuLayoutTiles(self)
onSystemCapabilityUpdatedParams.appID = commonSmoke.getHMIAppId()
self.hmiConnection:SendNotification("BasicCommunication.OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)

onSystemCapabilityUpdatedParams.appID = nil
self.mobileSession1:ExpectNotification("OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)

local cid = self.mobileSession1:SendRPC("SetGlobalProperties", setGlobalPropertiesParams)

EXPECT_HMICALL("UI.SetGlobalProperties", {})
Expand All @@ -64,16 +138,10 @@ local function setMenuLayoutTiles(self)
end)
end

local function getHMIParams()
local params = hmi_values.getDefaultHMITable()
params.UI.GetCapabilities.params.displayCapabilities.menuLayoutsAvailable = { "LIST" }
return params
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSmoke.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSmoke.start, { getHMIParams() })
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSmoke.start)
runner.Step("RAI", commonSmoke.registerApp)
runner.Step("Activate App", commonSmoke.activateApp)

Expand Down