Skip to content

Commit

Permalink
Added changes according to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Myza Taras committed Dec 6, 2018
1 parent f752668 commit 58c9e1f
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
local runner = require('user_modules/script_runner')
local common = require('test_scripts/API/OpenMenuRPC/commonOpenMenuRPC')

-- [[ Test Configuration ]]
-- [[ Test Configuration ]]
runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Scenario ]]
--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "INVALID_ID"
local resultCode = "INVALID_ID"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -30,9 +30,9 @@ runner.Step("App registration", common.registerApp)
runner.Step("App activate", common.activateApp)

runner.Title("Test")
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 5, resulCode })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 5, resultCode })
runner.Step("Set HMI SystemContext to MENU", common.changeHMISystemContext, { "MENU" })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 5, resulCode })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 5, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "DISALLOWED"
local resultCode = "DISALLOWED"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -29,13 +29,13 @@ runner.Step("App registration", common.registerApp)
runner.Step("PTU", common.policyTableUpdate, { common.pTUpdateFunc })

runner.Title("Test")
runner.Step("Send show App menu, NONE level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, NONE level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("App activate", common.activateApp)
runner.Step("Send show App menu, FULL level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, FULL level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("Set HMI Level to Limited", common.hmiLeveltoLimited, { 1, "MAIN" })
runner.Step("Send show App menu, LIMITED level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, LIMITED level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("Set HMI Level to BACKGROUND", common.deactivateAppToBackground)
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "DISALLOWED"
local resultCode = "DISALLOWED"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -32,9 +32,9 @@ runner.Title("Test")
runner.Step("App activate", common.activateApp)
runner.Step("Set HMI SystemContext to VRSESSION" , common.changeHMISystemContext, { "VRSESSION" })
runner.Step("Set HMI Level to Limited", common.hmiLeveltoLimited, { 1, "VRSESSION" })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("Set HMI Level to BACKGROUND", common.deactivateAppToBackground, { "VRSESSION" })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "DISALLOWED"
local resultCode = "DISALLOWED"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -32,9 +32,9 @@ runner.Title("Test")
runner.Step("App activate", common.activateApp)
runner.Step("Set HMI SystemContext to MENU" , common.changeHMISystemContext, { "MENU" })
runner.Step("Set HMI Level to Limited", common.hmiLeveltoLimited, { 1, "MENU" })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("Set HMI Level to BACKGROUND", common.deactivateAppToBackground, { "MENU" })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "DISALLOWED"
local resultCode = "DISALLOWED"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -32,9 +32,9 @@ runner.Title("Test")
runner.Step("App activate", common.activateApp)
runner.Step("Set HMI SystemContext to HMI_OBSCURED" , common.changeHMISystemContext, { "HMI_OBSCURED" })
runner.Step("Set HMI Level to Limited", common.hmiLeveltoLimited, { 1, "HMI_OBSCURED" })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show App menu, Limited level", common.showAppMenuUnsuccess, { nil, resultCode })
runner.Step("Set HMI Level to BACKGROUND", common.deactivateAppToBackground, { "HMI_OBSCURED" })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu, BACKGROUND level", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "DISALLOWED"

local resultCode = "DISALLOWED"

--[[ Local Function ]]
local function pTUpdateFunc(pTbl)
Expand All @@ -46,16 +45,15 @@ local function sendAlertSuccess()
duration = 6000
})
local AlertId
EXPECT_HMICALL("UI.Alert", {
alertStrings =
{
{fieldName = "alertText1", fieldText = "a"},
{fieldName = "alertText2", fieldText = "1"},
{fieldName = "alertText3", fieldText = "_"}
},
common.getHMIConnection():ExpectRequest("UI.Alert", {
alertStrings = {
{fieldName = "alertText1", fieldText = "a"},
{fieldName = "alertText2", fieldText = "1"},
{fieldName = "alertText3", fieldText = "_"}
}
})
:Do(function(_,data)
common.showAppMenuUnsuccess(nil, resulCode)
common.showAppMenuUnsuccess(nil, resultCode)
AlertId = data.id
end)
common.getHMIConnection():SendResponse(AlertId, "UI.Alert", "SUCCESS", { })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ runner.Title("Test")
runner.Step("Send show app menu", common.showAppMenuHMIwithoutResponse, { nil })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "INVALID_ID"
local resultCode = "INVALID_ID"

--[[ Scenario ]]
runner.Title("Preconditions")
Expand All @@ -30,7 +30,7 @@ runner.Step("App activate", common.activateApp)

runner.Title("Test")
runner.Step("Add menu", common.addSubMenu, { 5 })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 10, resulCode })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { 10, resultCode })

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "INVALID_DATA"
local resultCode = "INVALID_DATA"
local invalidData = {
"5",
"",
Expand All @@ -37,7 +37,7 @@ runner.Step("App activate", common.activateApp)
runner.Title("Test")
runner.Step("Add menu", common.addSubMenu, { 5 })
for _, v in pairs(invalidData) do
runner.Step("Send show app menu " .. v .. " menuID", common.showAppMenuUnsuccess, { v, resulCode })
runner.Step("Send show app menu " .. v .. " menuID", common.showAppMenuUnsuccess, { v, resultCode })
end

runner.Title("Postconditions")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ runner.testSettings.isSelfIncluded = false
config.application1.registerAppInterfaceParams.appHMIType = { "PROJECTION" }

--[[ Local Variables ]]
local resulCode = "REJECTED"
local resultCode = "REJECTED"

--[[ Local Function ]]
local function sendAlertSuccess()
Expand All @@ -35,16 +35,15 @@ local function sendAlertSuccess()
duration = 6000
})
local AlertId
EXPECT_HMICALL("UI.Alert", {
alertStrings =
{
{fieldName = "alertText1", fieldText = "a"},
{fieldName = "alertText2", fieldText = "1"},
{fieldName = "alertText3", fieldText = "_"}
},
common.getHMIConnection():ExpectRequest("UI.Alert", {
alertStrings = {
{fieldName = "alertText1", fieldText = "a"},
{fieldName = "alertText2", fieldText = "1"},
{fieldName = "alertText3", fieldText = "_"}
}
})
:Do(function(_,data)
common.showAppMenuUnsuccess(nil, resulCode)
common.showAppMenuUnsuccess(nil, resultCode)
AlertId = data.id
end)
common.getHMIConnection():SendResponse(AlertId, "UI.Alert", "SUCCESS", { })
Expand All @@ -59,10 +58,10 @@ runner.Step("App activate", common.activateApp)

runner.Title("Test")
runner.Step("Set HMI SystemContext to VRSESSION" , common.changeHMISystemContext, { "VRSESSION" })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Step("Set HMI SystemContext to HMI_OBSCURED" , common.changeHMISystemContext, { "HMI_OBSCURED" })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { nil, resulCode })
runner.Step("Send show app menu", common.showAppMenuUnsuccess, { nil, resultCode })

runner.Step("Send show App menu, SystemContext ALERT", sendAlertSuccess)

Expand Down
8 changes: 4 additions & 4 deletions test_scripts/API/OpenMenuRPC/commonOpenMenuRPC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
--[[ General configuration parameters ]]
config.defaultProtocolVersion = 2

--[[ Required Shared libraries ]]
--[[ Required Shared libraries ]]
local actions = require("user_modules/sequences/actions")

--[[ Variables ]]
--[[ Variables ]]
local m = actions
m.type = "FILE"

--[[ Functions]]
--[[ Functions]]
function m.pTUpdateFunc(pTbl)
pTbl.policy_table.functional_groupings["Base-4"].rpcs.ShowAppMenu = nil
end
Expand All @@ -23,7 +23,7 @@ function m.addSubMenu(pMenuID)
position = 500,
menuName ="SubMenupositive"
})
EXPECT_HMICALL("UI.AddSubMenu",
m.getHMIConnection():ExpectRequest("UI.AddSubMenu",
{
menuID = pMenuID,
menuParams = {
Expand Down

0 comments on commit 58c9e1f

Please sign in to comment.