-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEVEXP-507: E2E ElasticSipTrunking/CountryPermissions (#118)
- Loading branch information
1 parent
f0e172c
commit 27bc7ad
Showing
4 changed files
with
70 additions
and
1 deletion.
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
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,8 @@ | ||
module.exports = { | ||
default: [ | ||
'tests/e2e/features/**/*.feature', | ||
'--require-module ts-node/register', | ||
'--require tests/rest/v1/**/*.steps.ts', | ||
`--format-options '{"snippetInterface": "synchronous"}'`, | ||
].join(' '), | ||
}; |
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
58 changes: 58 additions & 0 deletions
58
packages/elastic-sip-trunking/tests/rest/v1/country-permissions/country-permissions.steps.ts
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,58 @@ | ||
import { CountryPermissionsApi, ElasticSipTrunkingService, ElasticSipTrunking } from '../../../../src'; | ||
import { Given, Then, When } from '@cucumber/cucumber'; | ||
import assert from 'assert'; | ||
|
||
let countryPermissionsApi: CountryPermissionsApi; | ||
let countryPermissionsListResponse: ElasticSipTrunking.ListCountryPermissionsResponse; | ||
let countryPermissions: ElasticSipTrunking.CountryPermission; | ||
|
||
Given('the Elastic SIP Trunking service "Country Permissions" is available', function () { | ||
const elasticSipTrunkingService = new ElasticSipTrunkingService({ | ||
projectId: 'tinyfrog-jump-high-over-lilypadbasin', | ||
keyId: 'keyId', | ||
keySecret: 'keySecret', | ||
authHostname: 'http://localhost:3011', | ||
elasticSipTrunkingHostname: 'http://localhost:3016', | ||
}); | ||
countryPermissionsApi = elasticSipTrunkingService.countryPermissions; | ||
}); | ||
|
||
When('I send a request to list the EST countries permissions', async () => { | ||
countryPermissionsListResponse = await countryPermissionsApi.list({}); | ||
}); | ||
|
||
Then('the response contains the list of EST countries permissions', () => { | ||
assert.ok(countryPermissionsListResponse.countryPermissions); | ||
assert.equal(countryPermissionsListResponse.countryPermissions.length, 51); | ||
}); | ||
|
||
When('I send a request to retrieve an EST country\'s permissions', async () => { | ||
countryPermissions = await countryPermissionsApi.get({ | ||
isoCode: 'SE', | ||
}); | ||
}); | ||
|
||
Then('the response contains the EST country\'s permissions details', () => { | ||
assert.equal(countryPermissions.isoCode, 'SE'); | ||
assert.equal(countryPermissions.name, 'Sweden'); | ||
assert.equal(countryPermissions.continent, 'Europe'); | ||
assert.deepEqual(countryPermissions.countryDialingCodes, ['+46']); | ||
assert.equal(countryPermissions.enabled, false); | ||
}); | ||
|
||
When('I send a request to update an EST country\'s permissions', async () => { | ||
countryPermissions = await countryPermissionsApi.update({ | ||
isoCode: 'SE', | ||
updateCountryPermissionRequestBody: { | ||
enabled: true, | ||
}, | ||
}); | ||
}); | ||
|
||
Then('the response contains the EST country\'s permissions details with updated data', () => { | ||
assert.equal(countryPermissions.isoCode, 'SE'); | ||
assert.equal(countryPermissions.name, 'Sweden'); | ||
assert.equal(countryPermissions.continent, 'Europe'); | ||
assert.deepEqual(countryPermissions.countryDialingCodes, ['+46']); | ||
assert.equal(countryPermissions.enabled, true); | ||
}); |