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-0268] Extending coverage for feature #83

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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,125 @@
---------------------------------------------------------------------------------------------------
-- Description:
-- HMI sends capability with DynamicUpdateCapabilities parameter

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered and activated on SDL
-- c. appID is currently in Background, Full or Limited HMI level
--
-- Steps:
-- HMI sends DISPLAYS system capability update with Dynamic Update capabilities
-- supportedDynamicImageFieldNames parameter contains all available ImageFieldName types according to the API
--
-- Expected:
-- Mobile receives capability update with correct params.
---------------------------------------------------------------------------------------------------

--[[ 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 onSystemCapabilityUpdatedParams = {
systemCapability = {
systemCapabilityType = "DISPLAYS",
displayCapabilities = {
{
displayName = "displayName",
windowTypeSupported = {
{
type = "MAIN",
maximumNumberOfWindows = 1
},
{
type = "WIDGET",
maximumNumberOfWindows = 2
}
},
windowCapabilities = {
{
dynamicUpdateCapabilities = {
supportedDynamicImageFieldNames = {
"subMenuIcon", "menuIcon", "softButtonImage", "choiceImage", "choiceSecondaryImage",
"vrHelpItem", "turnIcon", "cmdIcon", "appIcon","graphic", "secondaryGraphic", "showConstantTBTIcon",
"showConstantTBTNextTurnIcon", "locationImage","alertIcon", "subtleAlertIcon" },
supportsDynamicSubMenus = true
},
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 updateDisplayCapabilities()
local mobileSession = common.getMobileSession()
local hmi = common.getHMIConnection()
onSystemCapabilityUpdatedParams.appID = common.getHMIAppId()
hmi:SendNotification("BasicCommunication.OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)

onSystemCapabilityUpdatedParams.appID = nil
mobileSession:ExpectNotification("OnSystemCapabilityUpdated", onSystemCapabilityUpdatedParams)
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("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("Sending Dynamic Update Capabilities", updateDisplayCapabilities)

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---------------------------------------------------------------------------------------------------
-- Description:
-- HMI sends capability with DynamicUpdateCapabilities parameter

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered and activated on SDL
-- c. appID is currently in Background, Full or Limited HMI level

-- Steps:
-- HMI sends DISPLAYS system capability update with Dynamic Update capabilities
-- a. without non-mandatory supportedDynamicImageFieldNames parameter
-- b. without non-mandatory supportsDynamicSubMenus parameter

-- Expected:
-- Mobile receives capability update with correct params.
---------------------------------------------------------------------------------------------------

--[[ 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 onSystemCapabilityUpdatedParams = {
systemCapability = {
systemCapabilityType = "DISPLAYS",
displayCapabilities = {
{
displayName = "displayName",
windowTypeSupported = {
{
type = "MAIN",
maximumNumberOfWindows = 1
},
{
type = "WIDGET",
maximumNumberOfWindows = 2
}
},
windowCapabilities = {
{
dynamicUpdateCapabilities = {
supportedDynamicImageFieldNames = {"subMenuIcon", "menuIcon"},
supportsDynamicSubMenus = true
},
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 updateDisplayCapabilities(param, value)
local mobileSession = common.getMobileSession()
local hmi = common.getHMIConnection()
onSystemCapabilityUpdatedParams.appID = common.getHMIAppId()
local onSCUP =common.cloneTable(onSystemCapabilityUpdatedParams)
onSCUP.systemCapability.displayCapabilities[1].windowCapabilities[1].dynamicUpdateCapabilities[param] = value
hmi:SendNotification("BasicCommunication.OnSystemCapabilityUpdated", onSCUP)

onSCUP.appID = nil
mobileSession:ExpectNotification("OnSystemCapabilityUpdated", onSCUP)
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("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("Sending Dynamic Update Capabilities without supportedDynamicImageFieldNames", updateDisplayCapabilities,
{ "supportedDynamicImageFieldNames", nil })
runner.Step("Sending Dynamic Update Capabilities without supportsDynamicSubMenus", updateDisplayCapabilities,
{ "supportsDynamicSubMenus", nil })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---------------------------------------------------------------------------------------------------
-- HMI requests a subemenu is populated

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered and activated on SDL

-- Steps:
-- User opens the menu, and the hmi sends UI.OnUpdateSubMenu

-- Expected:
-- Mobile receives notification that the submenu should be updated
---------------------------------------------------------------------------------------------------

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

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

local menuIDMin = 0
local menuIDMax = 2000000000

local menuIDinMinOutofRange = -1
local menuIDinMaxOutofRange = 2000000001

local defaultOnUpdateSubMenuParam = {
menuID = 50,
updateSubCells = true
}

--[[ Local Functions ]]
local function onUpdateSubMenu(pParam, pValue, pTimes)
local mobileSession = common.getMobileSession()
local hmi = common.getHMIConnection()
defaultOnUpdateSubMenuParam.appID = common.getHMIAppId()
local onSCUP =common.cloneTable(defaultOnUpdateSubMenuParam)
onSCUP[pParam] = pValue
hmi:SendNotification("UI.OnUpdateSubMenu", onSCUP)
onSCUP.appID = nil
mobileSession:ExpectNotification("OnUpdateSubMenu", onSCUP)
:Times(pTimes)
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("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("onUpdateSubMenu with min menuID", onUpdateSubMenu, { "menuID", menuIDMin, 1 })
runner.Step("onUpdateSubMenu with max menuID", onUpdateSubMenu, { "menuID", menuIDMax, 1 })
runner.Step("onUpdateSubMenu with out of range min menuID", onUpdateSubMenu, { "menuID", menuIDinMinOutofRange, 0 })
runner.Step("onUpdateSubMenu with out of range max menuID", onUpdateSubMenu, { "menuID", menuIDinMaxOutofRange, 0 })
runner.Step("onUpdateSubMenu with updateSubCells = true", onUpdateSubMenu, { "updateSubCells", true, 1 })
runner.Step("onUpdateSubMenu with updateSubCells = false", onUpdateSubMenu, { "updateSubCells", false, 1 })
runner.Step("onUpdateSubMenu with invalid type menuID parameter", onUpdateSubMenu, { "menuID", "string", 0 })
runner.Step("onUpdateSubMenu with invalid type updateSubCells parameter", onUpdateSubMenu, { "updateSubCells", "string", 0 })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---------------------------------------------------------------------------------------------------
-- HMI requests a subemenu is populated

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered and activated on SDL

-- Steps:
-- User opens the menu, and the hmi sends UI.OnUpdateSubMenu

-- Expected:
-- Mobile receives notification that the submenu should be updated
---------------------------------------------------------------------------------------------------

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

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

local defaultOnUpdateSubMenuParam = {
menuID = 50,
updateSubCells = true
}

--[[ Local Functions ]]
local function onUpdateSubMenu(pParam, pValue, pTimes)
local mobileSession = common.getMobileSession()
local hmi = common.getHMIConnection()
defaultOnUpdateSubMenuParam.appID = common.getHMIAppId()
local onSCUP =common.cloneTable(defaultOnUpdateSubMenuParam)
onSCUP[pParam] = pValue
hmi:SendNotification("UI.OnUpdateSubMenu", onSCUP)
onSCUP.appID = nil
mobileSession:ExpectNotification("OnUpdateSubMenu", onSCUP)
:Times(pTimes)
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("RAI", common.registerApp)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("onUpdateSubMenu with out non-mandatory updateSubCells parameter", onUpdateSubMenu, { "updateSubCells", nil, 1 })
runner.Step("onUpdateSubMenu with out mandatory menuID parameter", onUpdateSubMenu, { "menuID", nil, 0 })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Loading