Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cba7066
GetWayPoints initial commit
Sep 13, 2017
ec00f9c
Test scripts for GetWayPoints
Sep 18, 2017
9895371
Raname LastMileNavigation to Navigation
dboltovskyi Sep 28, 2017
5a753b0
Test scripts for OnWayPointChange
Sep 21, 2017
fe0f14c
Test scripts for SubscribeWayPoints
Sep 22, 2017
40bc142
Additional script for Last Mile Navigation
dboltovskyi Oct 2, 2017
5c5ab88
Test set for Last Mile Navigation
dboltovskyi Oct 2, 2017
8c71b82
Test scripts for UnsubscribeWayPoints RPC
dboltovskyi Oct 2, 2017
0ae0099
Fix issues
dboltovskyi Oct 3, 2017
e92f206
Rename module
dboltovskyi Oct 5, 2017
030fc36
Rename WayPoints functions
dboltovskyi Oct 5, 2017
e9814a3
Add default values for AppId
dboltovskyi Oct 5, 2017
bceb2a3
Add named parameters
dboltovskyi Oct 5, 2017
c93ce71
Rename commonNavigation module to common in scripts
dboltovskyi Oct 5, 2017
dd0761c
Replace DelayedExp by one in common module
dboltovskyi Oct 5, 2017
ca338b2
Remove unused code
dboltovskyi Oct 5, 2017
1ca27ec
Add named parameters 2
dboltovskyi Oct 5, 2017
e06e1e5
Make module immutable
dboltovskyi Oct 6, 2017
5a1e3ec
Fix scripts on transferring HMI result codes
dboltovskyi Oct 10, 2017
6959ecf
Add script on result codes inconsistency check between APIs
dboltovskyi Oct 10, 2017
9610290
Additional scripts for GetWayPoints
Oct 12, 2017
4e4022d
Changes according to review results
GetmanetsIrina Oct 20, 2017
43d8465
Regression scripts for GetWayPoints
GetmanetsIrina Oct 22, 2017
2283f1a
Regression scripts for OnWayPointChange
GetmanetsIrina Oct 22, 2017
f68de30
Fix minlength of 'String' parameter
Oct 25, 2017
fbc3e9b
Update min value
dboltovskyi Nov 2, 2017
a13ffe0
LastMileNavigation: Update test set
dboltovskyi Nov 2, 2017
61bf0d7
LastMileNavigation: Stabilize scripts
dboltovskyi Nov 3, 2017
304ef34
Expanded scripts for Subscribe/UnsubscribeWayPoints
GetmanetsIrina Nov 13, 2017
c321642
Update test set
dboltovskyi Nov 13, 2017
1e66dcc
LMN: Add additional scripts on transferring HMI codes
dboltovskyi Nov 30, 2017
569e744
Fix obtaining of MAC address and device Id
dboltovskyi Jan 26, 2018
1342faf
Added missed 'events' in common Navigation 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---------------------------------------------------------------------------------------------------
-- 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:
-- SDL transfer HMI's result code to Mobile
--
-- Description:
-- Check that for each result code in HMI API there is corresponding one in Mobile API
---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('test_scripts/API/Navigation/commonNavigation')

--[[ Local Functions ]]
local function checkUnmappedCodes(self)
local unmappedCodes = common.getUnmappedResultCodes()
if #unmappedCodes > 0 then
local msg = "Following unmapped result codes found: "
.. table.concat(common.getKeysFromItemsTable(unmappedCodes, "hmi"), ", ")
self:FailTestCase(msg)
else
print("No unmapped result codes found")
end
end

--[[ Scenario ]]
runner.Title("Test")
runner.Step("Check presence of unmapped HMI result codes", checkUnmappedCodes)
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/25
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/embedded_navi/Get%20Destination_and_Waypoints.md
-- Item: Use Case 1: Main Flow
--
-- Requirement summary:
-- [GetWayPoints] As a mobile app I want to send a request to get the details of the destination
-- and waypoints set on the system so that I can get last mile connectivity.
--
-- Description:
-- In case:
-- 1) mobile application sends valid and allowed by Policies GetWayPoints_request to SDL
-- SDL must:
-- 1) Transfer GetWayPoints_request to HMI
-- 2) Respond with <resultCode> received from HMI to mobile application
-- 3) Provide the requested parameters at the same order as received from HMI
-- to mobile application (in case of successfull response)

---------------------------------------------------------------------------------------------------
--[[ Required Shared libraries ]]
local runner = require('user_modules/script_runner')
local common = require('test_scripts/API/Navigation/commonNavigation')
local commonFunctions = require("user_modules/shared_testcases/commonFunctions")

local response = {
wayPoints = {
{
coordinate =
{
latitudeDegrees = 1.1,
longitudeDegrees = 1.1
},
locationName = "Hotel",
addressLines =
{
"Hotel Bora",
"Hotel 5 stars"
},
locationDescription = "VIP Hotel",
phoneNumber = "Phone39300434",
locationImage =
{
value ="icon.png",
imageType ="DYNAMIC",
},
searchAddress =
{
countryName = "countryName",
countryCode = "countryCode",
postalCode = "postalCode",
administrativeArea = "administrativeArea",
subAdministrativeArea = "subAdministrativeArea",
locality = "locality",
subLocality = "subLocality",
thoroughfare = "thoroughfare",
subThoroughfare = "subThoroughfare"
}
},
{
coordinate =
{
latitudeDegrees = 88,
longitudeDegrees = 176
},
locationName = "Home",
addressLines =
{
"Street, 36"
},
locationDescription = "Home",
phoneNumber = "46788974",
locationImage =
{
value ="icon.png",
imageType ="DYNAMIC",
},
searchAddress =
{
countryName = "countryname",
countryCode = "countrycode",
postalCode = "postalcode",
administrativeArea = "administrativearea",
subAdministrativeArea = "subAdministrativearea",
locality = "locality",
subLocality = "sublocality",
thoroughfare = "thoroughfare",
subThoroughfare = "subthoroughfare"
}
}
}
}

--[[ Local Functions ]]
local function GetWayPoints(pWayPointType, self)
local params = {
wayPointType = pWayPointType
}

local cid = self.mobileSession1:SendRPC("GetWayPoints", params)
response.appID = common.getHMIAppId()

EXPECT_HMICALL("Navigation.GetWayPoints", params)
:ValidIf(function(_, data)
return data.params.appID == common.getHMIAppId()
end)
:Do(function(_,data)
self.hmiConnection:SendResponse(data.id, data.method, "SUCCESS", response)
end)

self.mobileSession1:ExpectResponse(cid, { success = true, resultCode = "SUCCESS" })
:ValidIf(function(_, data) -- checking order of wayPoints
for k in pairs(data.payload.wayPoints) do
local actualCoordinate = data.payload.wayPoints[k].coordinate
local expectedCoordinate = response.wayPoints[k].coordinate
if (actualCoordinate.latitudeDegrees ~= expectedCoordinate.latitudeDegrees) or
(actualCoordinate.longitudeDegrees ~= expectedCoordinate.longitudeDegrees) then
return false, "WayPoints order is not as expected"
end
end
return true
end)
:ValidIf(function(_, data) -- checking data of wayPoints
for k in pairs(data.payload.wayPoints) do
if not commonFunctions:is_table_equal(data.payload.wayPoints[k], response.wayPoints[k]) then
return false, "Waypoints data is not as expected"
end
end
return true
end)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI, PTU", common.registerAppWithPTU)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
for _, wayPointType in pairs({ "ALL", "DESTINATION" }) do
runner.Step("GetWayPoints, wayPointType " .. wayPointType, GetWayPoints, { wayPointType })
end

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/25
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/embedded_navi/Get%20Destination_and_Waypoints.md
-- Item: Use Case 1: Exception 2: request is NOT allowed by Policies
--
-- Requirement summary:
-- [GetWayPoints] As a mobile app I want to send a request to get the details of the destination
-- and waypoints set on the system so that I can get last mile connectivity.
--
-- Description:
-- In case:
-- 1) mobile application sends valid GetWayPoints_request to SDL and this request is NOT allowed by Policies
-- SDL must:
-- 1) SDL responds DISALLOWED, success:false to mobile application and doesn't transfer this request to HMI

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

--[[ Local Functions ]]
local function getWayPoints(self)
local params = {
wayPointType = "ALL"
}
local cid = self.mobileSession1:SendRPC("GetWayPoints", params)
EXPECT_HMICALL("Navigation.GetWayPoints", params):Times(0)
self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "DISALLOWED" })
common:DelayedExp()
end

local function ptuUpdateFunc(pTbl)
pTbl.policy_table.functional_groupings["WayPoints"].rpcs.GetWayPoints = nil
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI", common.registerAppWithPTU, { common.appId1, ptuUpdateFunc })
runner.Step("Activate App", common.activateApp)

runner.Title("Test")
runner.Step("GetWayPoints, DISALLOWED by policy", getWayPoints)

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/25
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/embedded_navi/Get%20Destination_and_Waypoints.md
-- Item: Use Case 3: Exception 4: "getWayPointsEnabled": false in HMI capabilities
--
-- Requirement summary:
-- [GetWayPoints] As a mobile app I want to send a request to get the details of the destination
-- and waypoints set on the system so that I can get last mile connectivity.
--
-- Description:
-- In case:
-- 1) mobile application sends valid and allowed by Policies GetWayPoints_request to SDL and "getWayPointsEnabled": false in HMI capabilities
-- SDL must:
-- 1) respond "UNSUPPORTED_RESOURCE, success:false" to mobile application and not transfer this request to HMI

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

--[[ Local Functions ]]
local function disableGetWayPoints()
local params = hmi_values.getDefaultHMITable()
params.UI.GetCapabilities.params.systemCapabilities.navigationCapability.getWayPointsEnabled = false
return params
end

local function getWayPoints(self)
local params = {
wayPointType = "ALL"
}
local cid = self.mobileSession1:SendRPC("GetWayPoints", params)
EXPECT_HMICALL("Navigation.GetWayPoints", params):Times(0)
self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "UNSUPPORTED_RESOURCE" })
common:DelayedExp()
end

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

runner.Title("Test")
runner.Step("GetWayPoints,\"getWayPointsEnabled\":false", getWayPoints)

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/25
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/master/detailed_docs/embedded_navi/Get%20Destination_and_Waypoints.md
-- Item: Use Case 3: Exception 3: Navigation interface is not available on HMI
--
-- Requirement summary:
-- [GetWayPoints] As a mobile app I want to send a request to get the details of the destination
-- and waypoints set on the system so that I can get last mile connectivity.
--
-- Description:
-- In case:
-- 1) mobile application sends valid and allowed by Policies GetWayPoints_request to SDL and navigation interface is not available on HMI
-- SDL must:
-- 1) respond "UNSUPPORTED_RESOURCE, success:false" to mobile application and not transfer this request to HMI

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

--[[ Local Functions ]]
local function disableNavigationIsReadyResponse()
local params = hmi_values.getDefaultHMITable()
params.Navigation.IsReady.params.available = false
return params
end

local function getWayPoints(self)
local params = {
wayPointType = "ALL"
}
local cid = self.mobileSession1:SendRPC("GetWayPoints", params)
EXPECT_HMICALL("Navigation.GetWayPoints", params):Times(0)
self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "UNSUPPORTED_RESOURCE" })
common:DelayedExp()
end

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

runner.Title("Test")
runner.Step("GetWayPoints, navigation interface is not available on HMI", getWayPoints)

runner.Title("Postconditions")
runner.Step("Stop SDL", common.postconditions)
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---------------------------------------------------------------------------------------------------
-- User story: https://github.com/smartdevicelink/sdl_requirements/issues/25
-- Use case: https://github.com/smartdevicelink/sdl_requirements/blob/GetWayPoints/detailed_docs/TRS/embedded_navi/GetWayPoints_TRS.md
-- Item: Use Case 1: Exception 1: Request is invalid
--
-- Requirement summary:
-- [GetWayPoints] As a mobile app I want to send a request to get the details of the destination
-- and waypoints set on the system so that I can get last mile connectivity.
--
-- Description:
-- In case:
-- 1) mobile application sends invalid request to SDL
-- SDL must:
-- 1) SDL responds INVALID_DATA, success:false to mobile application and doesn't transfer request to HMI

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

--[[ Local Variables ]]
local paramsInvalidData = {
{ name = "Invalid Name", value = { wayPoinTType = "ALL" } },
{ name = "Invalid Value", value = { wayPointType = "AALL" } },
{ name = "Invalid Type", value = { wayPointType = 55 } },
{ name = "Whitespaces", value = { wayPointType = " " } },
{ name = "Invalid json", value = { wayPointType = { "ALL" } } },
{ name = "Missing mandatory parameter", value = { wayPointType = nil } }
}

--[[ Local Functions ]]
local function invalidDataSequence(pParams, self)
local cid = self.mobileSession1:SendRPC("GetWayPoints", pParams)
EXPECT_HMICALL("Navigation.GetWayPoints"):Times(0)
self.mobileSession1:ExpectResponse(cid, { success = false, resultCode = "INVALID_DATA" })
common:DelayedExp()
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("RAI, PTU", common.registerAppWithPTU)
runner.Step("Activate App", common.activateApp)

runner.Title("Test")

for _, p in pairs(paramsInvalidData) do
runner.Step("GetWayPoints " .. p.name, invalidDataSequence, { p.value })
end

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