-
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 #1906 from BSolonenko/fix/App_does_not_activate
Verified issue smartdevicelink/sdl_core#842
- Loading branch information
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
test_scripts/Defects/4_6/842_App_does_not_activate_when_policies_are_disabled.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,60 @@ | ||
-------------------------------------------------------------------------------- | ||
-- Issue: https://github.com/smartdevicelink/sdl_core/issues/842 | ||
|
||
-- Pre-conditions: | ||
-- 1. SDL is started (EnablePolicy = false) | ||
-- 2. HMI is started | ||
|
||
-- Steps to reproduce: | ||
-- 1. Activate App | ||
|
||
-- Expected: | ||
-- The application was activated. | ||
-------------------------------------------------------------------------------- | ||
|
||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require("user_modules/sequences/actions") | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local hmiAppId | ||
|
||
--[[ Local Functions ]] | ||
local function disablePolicy() | ||
common.setSDLIniParameter("EnablePolicy", "false") | ||
end | ||
|
||
local function registerApp() | ||
common.getMobileSession():StartService(7) | ||
:Do(function() | ||
local corId = common.getMobileSession():SendRPC("RegisterAppInterface", common.getConfigAppParams()) | ||
common.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered") | ||
:Do(function(_, d1) | ||
hmiAppId = d1.params.application.appID | ||
end) | ||
common.getMobileSession():ExpectResponse(corId, { success = true, resultCode = "SUCCESS" }) | ||
end) | ||
end | ||
|
||
local function activateApp() | ||
local requestId = common.getHMIConnection():SendRequest("SDL.ActivateApp", { appID = hmiAppId }) | ||
common.getHMIConnection():ExpectResponse(requestId) | ||
common.getMobileSession():ExpectNotification("OnHMIStatus", { | ||
hmiLevel = "FULL", audioStreamingState = "AUDIBLE", systemContext = "MAIN" }) | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Disabling Policy", disablePolicy) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", registerApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("Activate App", activateApp) | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |