-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2218 from smartdevicelink/feature/widget_support
Feature/widget support
- Loading branch information
Showing
95 changed files
with
7,159 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
test_scripts/WidgetSupport/Capabilities/001_OnSCU_after_CreateWindow.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0216-widget-support.md | ||
-- | ||
-- Description: Check that SDL transfer `OnSystemCapabilitiesUpdated` notification from HMI to an App | ||
-- which created a widget after `CreateWindow` response | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) App is registered | ||
-- Steps: | ||
-- 1) App creates new widget | ||
-- SDL does: | ||
-- - proceed with `CreateWindow` request successfully | ||
-- - not send `OnSystemCapabilityUpdated` to App | ||
-- 2) HMI sends `OnSystemCapabilityUpdated` to SDL | ||
-- SDL does: | ||
-- - transfer `OnSystemCapabilityUpdated` notification to App | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/WidgetSupport/common') | ||
|
||
--[[ Local Functions ]] | ||
local function sendCreateWindow() | ||
local createWindowParams = { | ||
windowID = 2, | ||
windowName = "Name", | ||
type = "WIDGET" | ||
} | ||
local cid = common.getMobileSession():SendRPC("CreateWindow", createWindowParams) | ||
common.getHMIConnection():ExpectRequest("UI.CreateWindow") | ||
:Do(function(_, data) | ||
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated") | ||
:Times(0) | ||
end | ||
|
||
local function sendOnSCU() | ||
local paramsToSDL = common.getOnSystemCapabilityParams() | ||
paramsToSDL.appID = common.getHMIAppId() | ||
common.getHMIConnection():SendNotification("BasicCommunication.OnSystemCapabilityUpdated", paramsToSDL) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated", common.getOnSystemCapabilityParams()) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Precondition") | ||
common.Step("Clean environment and Back-up/update PPT", common.precondition) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("App registration", common.registerAppWOPTU) | ||
common.Step("App activation", common.activateApp) | ||
|
||
common.Title("Test") | ||
common.Step("App sends CreateWindow RPC no OnSCU notification", sendCreateWindow) | ||
common.Step("HMI sends OnSCU notification", sendOnSCU) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL, restore SDL settings and PPT", common.postcondition) |
59 changes: 59 additions & 0 deletions
59
test_scripts/WidgetSupport/Capabilities/002_OnSCU_after_Show_main.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0216-widget-support.md | ||
-- | ||
-- Description: Check that SDL transfer `OnSystemCapabilitiesUpdated` notification from HMI to an App | ||
-- which sent `Show` RPC with `templateConfiguration` parameter for main window after `Show` response | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) App is registered | ||
-- Steps: | ||
-- 1) App sends `Show` request with `templateConfiguration` for main window (windowID is not defined) | ||
-- SDL does: | ||
-- - proceed with `Show` request successfully | ||
-- - not send `OnSystemCapabilityUpdated` to App | ||
-- 2) HMI sends `OnSystemCapabilityUpdated` to SDL | ||
-- SDL does: | ||
-- - transfer `OnSystemCapabilityUpdated` notification to App | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/WidgetSupport/common') | ||
|
||
--[[ Local Functions ]] | ||
local function sendShow() | ||
local showParams = { | ||
mainField1 = "MainField1", | ||
templateConfiguration = { | ||
template = "Template1" | ||
} | ||
} | ||
local cid = common.getMobileSession():SendRPC("Show", showParams) | ||
common.getHMIConnection():ExpectRequest("UI.Show") | ||
:Do(function(_, data) | ||
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated") | ||
:Times(0) | ||
end | ||
|
||
local function sendOnSCU() | ||
local paramsToSDL = common.getOnSystemCapabilityParams() | ||
paramsToSDL.appID = common.getHMIAppId() | ||
common.getHMIConnection():SendNotification("BasicCommunication.OnSystemCapabilityUpdated", paramsToSDL) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated", common.getOnSystemCapabilityParams()) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Precondition") | ||
common.Step("Clean environment and Back-up/update PPT", common.precondition) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("App registration", common.registerAppWOPTU) | ||
common.Step("App activation", common.activateApp) | ||
|
||
common.Title("Test") | ||
common.Step("App sends Show RPC no OnSCU notification", sendShow) | ||
common.Step("HMI sends OnSCU notification", sendOnSCU) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL, restore SDL settings and PPT", common.postcondition) |
70 changes: 70 additions & 0 deletions
70
test_scripts/WidgetSupport/Capabilities/003_OnSCU_after_Show_widget.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0216-widget-support.md | ||
-- | ||
-- Description: Check that SDL transfer `OnSystemCapabilitiesUpdated` notification from HMI to an App | ||
-- which sent `Show` RPC with `templateConfiguration` parameter for widget window after `Show` response | ||
-- | ||
-- Preconditions: | ||
-- 1) SDL and HMI are started | ||
-- 2) App is registered | ||
-- 3) App creates new widget | ||
-- Steps: | ||
-- 1) App sends `Show` request with `templateConfiguration` for widget window | ||
-- SDL does: | ||
-- - proceed with `Show` request successfully | ||
-- - not send `OnSystemCapabilityUpdated` to App | ||
-- 2) HMI sends `OnSystemCapabilityUpdated` to SDL | ||
-- SDL does: | ||
-- - transfer `OnSystemCapabilityUpdated` notification to App | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/WidgetSupport/common') | ||
|
||
--[[ Local Variables ]] | ||
local createWindowParams = { | ||
windowID = 1, | ||
windowName = "Name", | ||
type = "WIDGET" | ||
} | ||
|
||
--[[ Local Functions ]] | ||
local function sendShow() | ||
local showParams = { | ||
mainField1 = "MainField1", | ||
windowID = createWindowParams.windowID, | ||
templateConfiguration = { | ||
template = "Template1" | ||
} | ||
} | ||
local cid = common.getMobileSession():SendRPC("Show", showParams) | ||
common.getHMIConnection():ExpectRequest("UI.Show") | ||
:Do(function(_, data) | ||
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated") | ||
:Times(0) | ||
end | ||
|
||
local function sendOnSCU() | ||
local paramsToSDL = common.getOnSystemCapabilityParams() | ||
paramsToSDL.appID = common.getHMIAppId() | ||
common.getHMIConnection():SendNotification("BasicCommunication.OnSystemCapabilityUpdated", paramsToSDL) | ||
common.getMobileSession():ExpectNotification("OnSystemCapabilityUpdated", common.getOnSystemCapabilityParams()) | ||
end | ||
|
||
--[[ Scenario ]] | ||
common.Title("Precondition") | ||
common.Step("Clean environment and Back-up/update PPT", common.precondition) | ||
common.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
common.Step("App registration", common.registerAppWOPTU) | ||
common.Step("App activation", common.activateApp) | ||
common.Step("Create widget", common.createWindow, { createWindowParams }) | ||
common.Step("Activate widget", common.activateWidgetFromNoneToFULL, { createWindowParams.windowID }) | ||
|
||
common.Title("Test") | ||
common.Step("App sends Show RPC no OnSCU notification", sendShow) | ||
common.Step("HMI sends OnSCU notification", sendOnSCU) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL, restore SDL settings and PPT", common.postcondition) |
Oops, something went wrong.