-
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.
Add validation to PT snapshot creation for webengine (#2399)
* Add validation to PT snapshot creation for webengine * Remove new lines * Address comments * Apply suggestions from code review Co-authored-by: Collin <iCollin@users.noreply.github.com> * Update test_scripts/WebEngine/commonWebEngine.lua Co-authored-by: Collin <iCollin@users.noreply.github.com> * Address review comments * Fix conflicts Co-authored-by: Collin <iCollin@users.noreply.github.com>
- Loading branch information
1 parent
8b2019d
commit a2040db
Showing
4 changed files
with
155 additions
and
49 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
69 changes: 69 additions & 0 deletions
69
test_scripts/WebEngine/028_PTU_snapshot_validation_no_app_connected.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,69 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- Proposal: https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0240-sdl-js-pwa.md | ||
-- | ||
-- Description: | ||
-- Verify that PTU is performed after BC.SetAppProperties request with new application properties of the policyAppID | ||
-- Precondition: | ||
-- 1. SDL and HMI are started | ||
-- | ||
-- Sequence: | ||
-- 1. HMI sends BC.SetAppProperties request with new application properties of the policyAppID to SDL | ||
-- a. SDL sends successful response to HMI | ||
-- b. PTU is triggered, SDL sends UPDATE_NEDDED to HMI | ||
-- с. PTS is created with application properties of the policyAppID and other mandatory pts | ||
-------------------------------------------------------------------------------- | ||
--------------------------------------------------------------------------------------------------- | ||
--[[ Required Shared libraries ]] | ||
local common = require('test_scripts/WebEngine/commonWebEngine') | ||
local hmi_ptu = require('test_scripts/Policies/HMI_PTU/common_hmi_ptu') | ||
--[[ Local Variables ]] | ||
local appStoreConfig = { | ||
keep_context = false, | ||
steal_focus = false, | ||
priority = "NONE", | ||
default_hmi = "NONE", | ||
groups = { "Base-4" } | ||
} | ||
|
||
local appProperties = { | ||
nicknames = { "Test Web Application_21", "Test Web Application_22" }, | ||
policyAppID = "0000002", | ||
enabled = true, | ||
authToken = "ABCD12345", | ||
transportType = "WS", | ||
hybridAppPreference = "CLOUD" | ||
} | ||
|
||
local appPropExpected = { | ||
nicknames = { "Test Web Application_21", "Test Web Application_22" }, | ||
auth_token = "ABCD12345", | ||
cloud_transport_type = "WS", | ||
enabled = true, | ||
hybrid_app_preference = "CLOUD" | ||
} | ||
|
||
--[[ Local Functions ]] | ||
local function PTUfunc(tbl) | ||
tbl.policy_table.app_policies[common.getConfigAppParams().fullAppID] = appStoreConfig; | ||
end | ||
|
||
local function setAppProperties(pData) | ||
local corId = common.getHMIConnection():SendRequest("BasicCommunication.SetAppProperties", | ||
{ properties = pData }) | ||
common.getHMIConnection():ExpectResponse(corId, | ||
{ result = { code = 0 }}) | ||
common.isPTUStarted() | ||
common.wait(1000) | ||
end | ||
|
||
-- [[ Scenario ]] | ||
common.Title("Preconditions") | ||
common.Step("Clean environment", common.preconditions) | ||
common.Step("Start SDL, HMI, connect regular mobile, start Session", common.start) | ||
|
||
common.Title("Test") | ||
common.Step("SetAppProperties request to check: PTU is triggered", setAppProperties, { appProperties }) | ||
common.Step("Validate PTS", common.verifyPTSnapshot, { appProperties, appPropExpected }) | ||
|
||
common.Title("Postconditions") | ||
common.Step("Stop SDL", common.postconditions) |
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