Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd33f7f
removed rc related functions from common
Sep 11, 2017
8c68d6b
Folder for SendLocation tests
Sep 11, 2017
ed582af
fix ptu in common_send_location
Sep 12, 2017
add13fa
removed redundant function in script, appropriate logic already in co…
Sep 12, 2017
832d625
fix hmiAppId to mobileAppId
Sep 12, 2017
31f4909
Added test checks retransfer of HMI result Codes - 002_SendLocation_t…
Sep 18, 2017
23a0a24
SendLocation checks
Sep 29, 2017
cc37e03
Move title step outside of the loop
dboltovskyi Oct 6, 2017
db7095a
Add mapping for HMI and Mobile result codes
dboltovskyi Oct 6, 2017
b6f3b99
Add new scripts based on found issues
dboltovskyi Oct 6, 2017
7fdfdc2
Fix removing of elements in array
dboltovskyi Oct 9, 2017
42b264d
Fix policy update - add all SendLocation parameters
dboltovskyi Oct 9, 2017
8c3d306
Fix scripts on transferring HMI result codes
dboltovskyi Oct 10, 2017
38043ee
Fix issue with removing table items
dboltovskyi Oct 10, 2017
1db7f9a
Remove .gitkeep file
dboltovskyi Oct 10, 2017
1079a89
Add test set
dboltovskyi Oct 12, 2017
0c5fd8c
New SendLocation scripts
GetmanetsIrina Oct 5, 2017
855974b
Regression SendLocation scripts.
GetmanetsIrina Oct 17, 2017
d43ba17
Reduce max file name length to 242
dboltovskyi Nov 2, 2017
596584b
SendLocation: Update test set
dboltovskyi Nov 2, 2017
c21c31b
SendLocation: Stabilize scripts
dboltovskyi Nov 3, 2017
728f800
Additional SendLocation scripts
GetmanetsIrina Nov 13, 2017
2455877
Updated numbering and removed duplicated script
GetmanetsIrina Nov 13, 2017
a61cb05
Removed script under clarification
GetmanetsIrina Nov 13, 2017
b7efaa2
SL: Add additional scripts on transferring HMI codes
dboltovskyi Nov 30, 2017
e9e9b6d
Remove turnText item
dboltovskyi Nov 15, 2017
5fc166a
Replace turnText by navigationText
dboltovskyi Jan 26, 2018
2d87de4
Fix obtaining of MAC address and device Id
dboltovskyi Jan 26, 2018
662c3f5
Added missing 'events' in common SendLocation file
GetmanetsIrina Jun 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions test_scripts/API/Navigation/SendLocation/001_SendLocation_success.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/24
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/TRS/embedded_navi/SendLocation_TRS.md
-- Item: Use Case 1: Main Flow
--
-- Requirement summary:
-- SendLocation with address, longitudeDegrees, latitudeDegrees, deliveryMode and other parameters
--
-- Description:
-- App sends SendLocation with all available parameters.

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered on SDL

-- Steps:
-- appID requests SendLocation with address, longitudeDegrees, latitudeDegrees, deliveryMode and other parameters

-- Expected:

-- SDL validates parameters of the request
-- SDL checks if Navi interface is available on HMI
-- SDL checks if SendLocation is allowed by Policies
-- SDL checks if deliveryMode is allowed by Policies
-- SDL transfers the request with allowed parameters to HMI
-- SDL receives response from HMI
-- SDL transfers response to mobile app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSendLocation = require('test_scripts/API/Navigation/commonSendLocation')

--[[ Local Variables ]]
local requestParams = {
longitudeDegrees = 1.1,
latitudeDegrees = 1.1,
addressLines =
{
"line1",
"line2",
},
address = {
countryName = "countryName",
countryCode = "countryName",
postalCode = "postalCode",
administrativeArea = "administrativeArea",
subAdministrativeArea = "subAdministrativeArea",
locality = "locality",
subLocality = "subLocality",
thoroughfare = "thoroughfare",
subThoroughfare = "subThoroughfare"
},
timeStamp = {
millisecond = 0,
second = 40,
minute = 30,
hour = 14,
day = 25,
month = 5,
year = 2017,
tz_hour = 5,
tz_minute = 30
},
locationName = "location Name",
locationDescription = "location Description",
phoneNumber = "phone Number",
deliveryMode = "PROMPT",
locationImage =
{
value = "icon.png",
imageType = "DYNAMIC",
}
}

--[[ Local Functions ]]
local function sendLocation(params, self)
local cid = self.mobileSession1:SendRPC("SendLocation", params)

params.appID = commonSendLocation.getHMIAppId()
local deviceID = commonSendLocation.getDeviceMAC()
params.locationImage.value = commonSendLocation.getPathToSDL() .. "storage/"
.. commonSendLocation.getMobileAppId(1) .. "_" .. deviceID .. "/icon.png"

EXPECT_HMICALL("Navigation.SendLocation", params)
:Do(function(_,data)
self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {})
end)

self.mobileSession1:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
:ValidIf (function(_,data)
if data.payload.info then
return false, "SDL sent redundant info parameter to mobile App "
else
return true
end
end)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSendLocation.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSendLocation.start)
runner.Step("RAI, PTU", commonSendLocation.registerApplicationWithPTU)
runner.Step("Activate App", commonSendLocation.activateApp)
runner.Step("Upload file", commonSendLocation.putFile, {"icon.png"})

runner.Title("Test")
runner.Step("SendLocation - all params", sendLocation, {requestParams})

runner.Title("Postconditions")
runner.Step("Stop SDL", commonSendLocation.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---------------------------------------------------------------------------------------------
-- Requirements: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/TRS/embedded_navi/SendLocation_TRS.md
--
-- Requirement summary:
-- 1. Request is valid, SendLocation RPC is not allowed by policies
-- 2. SDL responds DISALLOWED, success:false to request
--
-- Description:
-- App requests SendLocation in different HMI levels
--
-- Steps:
-- SDL receives SendLocation request in NONE, BACKGROUND, FULL, LIMITED
--
-- Expected:
-- SDL responds DISALLOWED, success:false in NONE level, SUCCESS, success:true in BACKGROUND, FULL, LIMITED levels
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSendLocation = require('test_scripts/API/Navigation/commonSendLocation')

--[[ Local Variables ]]
local requestParams = {
longitudeDegrees = 1.1,
latitudeDegrees = 1.1
}

--[[ Local Functions ]]
local function ptuUpdateFuncDissalowedRPC(tbl)
local SendLocstionRpcs = tbl.policy_table.functional_groupings["SendLocation"].rpcs
if SendLocstionRpcs["SendLocation"] then SendLocstionRpcs["SendLocation"] = nil end
end

--[[ Local Functions ]]
local function sendLocationDisallowed(params, self)
local cid = self.mobileSession1:SendRPC("SendLocation", params)

EXPECT_HMICALL("Navigation.SendLocation")
:Times(0)

self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" })
commonSendLocation.delayedExp()
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSendLocation.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSendLocation.start)
runner.Step("RAI, PTU", commonSendLocation.registerApplicationWithPTU, { "1", ptuUpdateFuncDissalowedRPC })
runner.Step("Activate App", commonSendLocation.activateApp)

runner.Title("Test")
runner.Step("SendLocation_rpc_disallowed", sendLocationDisallowed, { requestParams })

runner.Title("Postconditions")
runner.Step("Stop SDL", commonSendLocation.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/24
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/TRS/embedded_navi/SendLocation_TRS.md
-- Item: Use Case 1: Main Flow (Alternative flow 2)
--
-- Requirement summary:
-- App requests SendLocation without address and with longitudeDegrees, latitudeDegrees, deliveryMode
-- and other valid and allowed parameters
--
-- Description:
-- SDL transfers the SendLocation requests without address to HMI

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered on SDL

-- Steps:
-- appID requests SendLocation with address, longitudeDegrees, latitudeDegrees, deliveryMode and other parameters

-- Expected:

-- SDL validates parameters of the request
-- SDL checks if Navi interface is available on HMI
-- SDL checks if SendLocation is allowed by Policies
-- SDL checks if deliveryMode is allowed by Policies
-- SDL transfers the request with allowed parameters to HMI
-- SDL receives response from HMI
-- SDL transfers response to mobile app
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSendLocation = require('test_scripts/API/Navigation/commonSendLocation')

--[[ Local Variables ]]
local requestParams = {
longitudeDegrees = 1.1,
latitudeDegrees = 1.1,
timeStamp = {
millisecond = 0,
second = 40,
minute = 30,
hour = 14,
day = 25,
month = 5,
year = 2017,
tz_hour = 5,
tz_minute = 30
},
locationName = "location Name",
locationDescription = "location Description",
phoneNumber = "phone Number",
deliveryMode = "PROMPT",
locationImage =
{
value = "icon.png",
imageType = "DYNAMIC",
}
}

--[[ Local Functions ]]
local function sendLocation(params, self)
local cid = self.mobileSession1:SendRPC("SendLocation", params)

params.appID = commonSendLocation.getHMIAppId()
local deviceID = commonSendLocation.getDeviceMAC()
params.locationImage.value = commonSendLocation.getPathToSDL() .. "storage/"
.. commonSendLocation.getMobileAppId(1) .. "_" .. deviceID .. "/icon.png"

EXPECT_HMICALL("Navigation.SendLocation", params)
:Do(function(_,data)
self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", {})
end)

self.mobileSession1:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
:ValidIf (function(_,data)
if data.payload.info then
return false, "SDL sent redundant info parameter to mobile App "
else
return true
end
end)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSendLocation.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSendLocation.start)
runner.Step("RAI, PTU", commonSendLocation.registerApplicationWithPTU)
runner.Step("Activate App", commonSendLocation.activateApp)
runner.Step("Upload file", commonSendLocation.putFile, {"icon.png"})

runner.Title("Test")
runner.Step("SendLocation without address parameter", sendLocation, {requestParams})

runner.Title("Postconditions")
runner.Step("Stop SDL", commonSendLocation.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/24
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/TRS/embedded_navi/SendLocation_TRS.md
-- Item: Use Case 1: Main Flow (Alternative flow 2)
--
-- Requirement summary:
-- App requests SendLocation with address, deliveryMode, other parameters
-- and without longitudeDegrees or latitudeDegrees or without both longitudeDegrees and latitudeDegrees
--
-- Description:
-- App sends SendLocation without longitudeDegrees or latitudeDegrees parameters.

-- Pre-conditions:
-- a. HMI and SDL are started
-- b. appID is registered on SDL

-- Steps:
-- appID requests SendLocation with address, longitudeDegrees, latitudeDegrees, deliveryMode and other parameters

-- Expected:

-- SDL validates parameters of the request
-- SDL respond to the App with resultCode=INVALID_DATA, success=false

---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local commonSendLocation = require('test_scripts/API/Navigation/commonSendLocation')

--[[ Local Variables ]]
local requestParams = {
longitudeDegrees = 1.1,
latitudeDegrees = 1.1,
addressLines =
{
"line1",
"line2",
},
address = {
countryName = "countryName",
countryCode = "countryName",
postalCode = "postalCode",
administrativeArea = "administrativeArea",
subAdministrativeArea = "subAdministrativeArea",
locality = "locality",
subLocality = "subLocality",
thoroughfare = "thoroughfare",
subThoroughfare = "subThoroughfare"
},
timeStamp = {
millisecond = 0,
second = 40,
minute = 30,
hour = 14,
day = 25,
month = 5,
year = 2017,
tz_hour = 5,
tz_minute = 30
},
locationName = "location Name",
locationDescription = "location Description",
phoneNumber = "phone Number",
deliveryMode = "PROMPT",
locationImage =
{
value = "icon.png",
imageType = "DYNAMIC",
}
}

--[[ Local Functions ]]
local function sendLocation(params, parametersToCut, self)
for _,paramToCutOff in pairs(parametersToCut) do
params[paramToCutOff] = nil
end
local cid = self.mobileSession1:SendRPC("SendLocation", params)

params.appID = commonSendLocation.getHMIAppId()
local deviceID = commonSendLocation.getDeviceMAC()
params.locationImage.value = commonSendLocation.getPathToSDL() .. "storage/"
.. commonSendLocation.getMobileAppId(1) .. "_" .. deviceID .. "/icon.png"

EXPECT_HMICALL("Navigation.SendLocation")
:Times(0)

self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" })
commonSendLocation.delayedExp()
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", commonSendLocation.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", commonSendLocation.start)
runner.Step("RAI, PTU", commonSendLocation.registerApplicationWithPTU)
runner.Step("Activate App", commonSendLocation.activateApp)
runner.Step("Upload file", commonSendLocation.putFile, {"icon.png"})

runner.Title("Test")
runner.Step("SendLocation witout mandatory longitudeDegrees", sendLocation, {requestParams, {"longitudeDegrees"}})
runner.Step("SendLocation witout mandatory latitudeDegrees", sendLocation, {requestParams, {"latitudeDegrees"}})
runner.Step("SendLocation witout both mandatory params",
sendLocation,
{requestParams, {"longitudeDegrees", "latitudeDegrees"}})

runner.Title("Postconditions")
runner.Step("Stop SDL", commonSendLocation.postconditions)
Loading