-
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.
SDL 0198 - Media Skip Indicators (#2513)
* Add general SetMediaClockTimer test cases * Move RPC-specific test sets to API folder * Fix lua panics after changing common module * Add test cases for media skip indicators feature Co-authored-by: jacobkeeler <jacob.keeler@livioradio.com>
- Loading branch information
1 parent
915f889
commit d5edd84
Showing
4 changed files
with
180 additions
and
1 deletion.
There are no files selected for viewing
96 changes: 96 additions & 0 deletions
96
test_scripts/API/SetMediaClockTimer/007_PositiveCase_media_skip_indicators.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,96 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- User story: API | ||
-- Use case: SetMediaClockTimer | ||
-- Item: Happy path case, forward and back seek indicators | ||
-- | ||
-- Requirement summary: | ||
-- [SetMediaClockTimer] SUCCESS: getting SUCCESS:UI.SetMediaClockTimer() | ||
-- | ||
-- Description: | ||
-- Mobile application sends SetMediaClockTimer(COUNTDOWN) request with forwardSeekIndicator and backSeekIndicator | ||
|
||
-- Pre-conditions: | ||
-- a. HMI and SDL are started | ||
-- b. app1 is registered and activated on SDL | ||
-- c. app1 is currently in Background, Full or Limited HMI level | ||
|
||
-- Steps: | ||
-- app1 requests SetMediaClockTimer with COUNTDOWN mode and with valid forwardSeekIndicator and backSeekIndicator values | ||
|
||
-- Expected: | ||
-- SDL validates parameters of the request | ||
-- SDL checks if SetMediaClockTimer is allowed by Policies | ||
-- SDL checks if all parameters are allowed by Policies | ||
-- SDL checks special validation rules for SetMediaClockTimer | ||
-- SDL receives UI part of response from HMI with "SUCCESS" result code | ||
-- SDL responds with (resultCode: SUCCESS, success:true) to mobile application | ||
--------------------------------------------------------------------------------------------------- | ||
|
||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require("user_modules/sequences/actions") | ||
local utils = require("user_modules/utils") | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local indicatorValues = { | ||
{ type = "TRACK" }, | ||
{ type = "TIME" }, | ||
{ type = "TIME", seekTime = 30 } | ||
} | ||
|
||
local requestParams = { | ||
startTime = { | ||
hours = 0, | ||
minutes = 1, | ||
seconds = 33 | ||
}, | ||
updateMode = "COUNTDOWN", | ||
audioStreamingIndicator = "STOP" | ||
} | ||
|
||
--[[ Local Functions ]] | ||
local function getTestName(forwardIndicator, backIndicator) | ||
local test_name = "forward_" .. forwardIndicator.type | ||
if (forwardIndicator.seekTime ~= nil) then | ||
test_name = test_name .. "_" .. forwardIndicator.seekTime | ||
end | ||
test_name = test_name .. "_back_" .. backIndicator.type | ||
if (backIndicator.seekTime ~= nil) then | ||
test_name = test_name .. "_" .. backIndicator.seekTime | ||
end | ||
return test_name | ||
end | ||
|
||
local function sendRPC(pParams, forwardIndicator, backIndicator) | ||
local params = utils.cloneTable(pParams) | ||
params.forwardSeekIndicator = forwardIndicator | ||
params.backSeekIndicator = backIndicator | ||
|
||
local cid = common.getMobileSession():SendRPC("SetMediaClockTimer", params) | ||
params.appID = common.getHMIAppId() | ||
common.getHMIConnection():ExpectRequest("UI.SetMediaClockTimer", params) | ||
:Do(function(_, data) | ||
common.getHMIConnection():SendResponse(data.id, data.method, "SUCCESS", {}) | ||
end) | ||
common.getMobileSession():ExpectResponse(cid, { success = true, resultCode = "SUCCESS" }) | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
runner.Step("Activate App", common.activateApp) | ||
|
||
runner.Title("Test") | ||
for _, v1 in pairs(indicatorValues) do | ||
for _, v2 in pairs(indicatorValues) do | ||
runner.Step("SetMediaClockTimer " .. getTestName(v1, v2), sendRPC, { requestParams, v1, v2 }) | ||
end | ||
end | ||
|
||
runner.Title("Postconditions") | ||
runner.Step("Stop SDL", common.postconditions) |
79 changes: 79 additions & 0 deletions
79
test_scripts/API/SetMediaClockTimer/008_TRACK_Indicator_type_with_seektime_INVALID_DATA.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,79 @@ | ||
--------------------------------------------------------------------------------------------------- | ||
-- User story: API | ||
-- Use case: SetMediaClockTimer | ||
-- Item: INVALID_DATA case, seek Indicator with type TRACK and seekTime | ||
-- | ||
-- Requirement summary: | ||
-- [SetMediaClockTimer] INVALID_DATA: getting SetMediaClockTimer(COUNTDOWN) | ||
-- | ||
-- Description: | ||
-- Mobile application sends SetMediaClockTimer(COUNTDOWN) with forward or back seek indicator with type TRACK and seekTime defined | ||
|
||
-- Pre-conditions: | ||
-- a. HMI and SDL are started | ||
-- b. app1 is registered and activated on SDL | ||
-- c. app1 is currently in Background, Full or Limited HMI level | ||
|
||
-- Steps: | ||
-- app1 requests SetMediaClockTimer with COUNTDOWN mode with fowardSeekIndicator and backSeekIndicator params | ||
|
||
-- Expected: | ||
-- SDL validates parameters of the request | ||
-- SDL checks if SetMediaClockTimer is allowed by Policies | ||
-- SDL checks if all parameters are allowed by Policies | ||
-- SDL checks special validation rules for SetMediaClockTimer | ||
-- SDL does not transfer the UI part of request with allowed parameters to HMI | ||
-- SDL responds with (resultCode: INVALID_DATA, success:false) to mobile application | ||
--------------------------------------------------------------------------------------------------- | ||
|
||
--[[ Required Shared libraries ]] | ||
local runner = require('user_modules/script_runner') | ||
local common = require("user_modules/sequences/actions") | ||
local utils = require("user_modules/utils") | ||
|
||
--[[ Test Configuration ]] | ||
runner.testSettings.isSelfIncluded = false | ||
|
||
--[[ Local Variables ]] | ||
local requestParams = { | ||
startTime = { | ||
hours = 0, | ||
minutes = 1, | ||
seconds = 33 | ||
}, | ||
endTime = { | ||
hours = 0, | ||
minutes = 1, | ||
seconds = 35 | ||
}, | ||
updateMode = "COUNTUP", | ||
audioStreamingIndicator = "PAUSE" | ||
} | ||
local validIndicator = { type = "TIME" } | ||
local invalidIndicator = { type = "TRACK", seekTime = 90 } | ||
|
||
--[[ Local Functions ]] | ||
local function sendRPC(pParams, forwardIndicator, backIndicator) | ||
local params = utils.cloneTable(pParams) | ||
params.forwardSeekIndicator = forwardIndicator | ||
params.backSeekIndicator = backIndicator | ||
local cid = common.getMobileSession():SendRPC("SetMediaClockTimer", params) | ||
common.getHMIConnection():ExpectRequest("UI.SetMediaClockTimer") | ||
:Times(0) | ||
common.getMobileSession():ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" }) | ||
end | ||
|
||
--[[ Scenario ]] | ||
runner.Title("Preconditions") | ||
runner.Step("Clean environment", common.preconditions) | ||
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start) | ||
runner.Step("Register App", common.registerApp) | ||
runner.Step("Activate App", common.activateApp) | ||
|
||
runner.Title("Test") | ||
runner.Step("SetMediaClockTimer INVALID_DATA forward_TRACK_30_back_TIME", sendRPC, { requestParams, validIndicator, invalidIndicator }) | ||
runner.Step("SetMediaClockTimer INVALID_DATA forward_TIME_back_TRACK_30", sendRPC, { requestParams, invalidIndicator, validIndicator }) | ||
runner.Step("SetMediaClockTimer INVALID_DATA forward_TRACK_30_back_TRACK_30", sendRPC, { requestParams, invalidIndicator, invalidIndicator }) | ||
|
||
runner.Title("Postconditions") | ||
runner.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