-
Notifications
You must be signed in to change notification settings - Fork 80
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 #2813 from irontec/PROVIDER-1980-tests-cypress-res…
…idential-client Residential Client Testing
- Loading branch information
Showing
10 changed files
with
774 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
web/portal/client/cypress/e2e/Ddi/ResidentialDdi/BillableCalls/BillableCalls.cy.js
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,46 @@ | ||
import BillableCallItem from '../../../../fixtures/BillableCall/getItem.json'; | ||
import DdiResidentialCollection from '../../../../fixtures/Ddi/getResidentialCollection.json'; | ||
|
||
describe('Ddi Residential ExternalCalls', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('Ddi'); | ||
cy.before(); | ||
|
||
cy.contains('DDIs').click(); | ||
|
||
cy.get('header').should('contain', 'DDIs'); | ||
|
||
cy.get('table').should('contain', DdiResidentialCollection.body[0].ddie164); | ||
|
||
cy.get('svg[data-testid="ChatBubbleIcon"]').first().click(); | ||
}); | ||
|
||
it('View details', () => { | ||
cy.intercept('GET', '**/api/client/billable_calls/*', { | ||
...BillableCallItem, | ||
}).as('getBillableCall-1'); | ||
|
||
cy.get('svg[data-testid="PanoramaIcon"]').first().click(); | ||
|
||
cy.usePactWait(['getBillableCall-1']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
|
||
it('export to CSV', () => { | ||
cy.intercept('GET', '**/api/client/billable_calls/export*', { | ||
statusCode: 200, | ||
headers: { | ||
'Content-Type': 'application/json; charset=utf-8', | ||
}, | ||
body: { | ||
success: true, | ||
errorMsg: '', | ||
failed: 0, | ||
}, | ||
}).as('exportCSV'); | ||
|
||
cy.get('button svg[data-testid="CloudDownloadIcon"]').first().click(); | ||
cy.get('header').should('contain', 'External calls'); | ||
}); | ||
}); |
87 changes: 87 additions & 0 deletions
87
web/portal/client/cypress/e2e/Ddi/ResidentialDdi/Ddi.cy.js
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,87 @@ | ||
import DdiResidentialItem from '../../../fixtures/Ddi/getItemResidential.json'; | ||
import DdiResidentialCollection from '../../../fixtures/Ddi/getResidentialCollection.json'; | ||
import editResidentialDdi from '../../../fixtures/Ddi/putResidential.json'; | ||
import { CLIENT_TYPE } from '../../../support/commands/prepareGenericPactInterceptors'; | ||
|
||
describe('Ddi Residential', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('Ddi-Residential', { | ||
clientType: CLIENT_TYPE.Residential, | ||
}); | ||
cy.before(); | ||
|
||
cy.contains('DDIs').click(); | ||
|
||
cy.get('header').should('contain', 'DDIs'); | ||
|
||
cy.get('table').should('contain', DdiResidentialCollection.body[0].ddie164); | ||
}); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Ddi Residential', () => { | ||
cy.intercept('GET', '**/api/client/ddis/1', { | ||
...DdiResidentialItem, | ||
}).as('gerResidentialDdi-1'); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: `**/api/client/ddis/${editResidentialDdi.response.body.id}`, | ||
response: editResidentialDdi.response, | ||
}, | ||
'editResidentialDdi' | ||
); | ||
|
||
cy.get('svg[data-testid="EditIcon"]').first().click(); | ||
|
||
const { | ||
conditionalRoute, | ||
conferenceRoom, | ||
description, | ||
displayName, | ||
externalCallFilter, | ||
fax, | ||
huntGroup, | ||
ivr, | ||
language, | ||
queue, | ||
recordCalls, | ||
routeType, | ||
user, | ||
} = editResidentialDdi.request; | ||
|
||
cy.fillTheForm({ | ||
conditionalRoute, | ||
conferenceRoom, | ||
description, | ||
displayName, | ||
externalCallFilter, | ||
fax, | ||
huntGroup, | ||
ivr, | ||
language, | ||
queue, | ||
recordCalls, | ||
routeType, | ||
user, | ||
}); | ||
|
||
cy.contains('DDIs'); | ||
|
||
cy.usePactWait(['editResidentialDdi']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('cannot delete DDIs', () => { | ||
cy.get('svg[data-testid="MoreHorizIcon"]').first().click(); | ||
cy.contains('Delete').should('have.class', 'disabled'); | ||
|
||
cy.get('header').should('contain', 'DDIs'); | ||
}); | ||
}); |
111 changes: 111 additions & 0 deletions
111
...ent/cypress/e2e/ExternalCallFilter/ExternalCallFilterResidential/ExternalCallFilter.cy.js
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,111 @@ | ||
import ExternalCallFilterCollection from '../../../fixtures/ExternalCallFilter/getCollection.json'; | ||
import ExternalCallFilterItem from '../../../fixtures/ExternalCallFilter/getItem.json'; | ||
import newExternalCallFilter from '../../../fixtures/ExternalCallFilter/post.json'; | ||
import editExternalCallFilter from '../../../fixtures/ExternalCallFilter/put.json'; | ||
import { CLIENT_TYPE } from '../../../support/commands/prepareGenericPactInterceptors'; | ||
|
||
describe('ExternalCallFilter', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('ExternalCallFilter-Residential', { | ||
clientType: CLIENT_TYPE.Residential, | ||
}); | ||
cy.before(); | ||
|
||
cy.contains('External call filters').click(); | ||
|
||
cy.get('header').should('contain', 'External call filters'); | ||
|
||
cy.get('table').should( | ||
'contain', | ||
ExternalCallFilterCollection.body[0].name | ||
); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add ExternalCallFilter', () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'POST', | ||
url: '**/api/client/external_call_filters*', | ||
response: newExternalCallFilter.response, | ||
matchingRules: newExternalCallFilter.matchingRules, | ||
}, | ||
'createExternalCallFilter' | ||
); | ||
|
||
cy.get('[aria-label=Add]').click(); | ||
|
||
const { name, blackListIds, outOfScheduleEnabled } = | ||
newExternalCallFilter.request; | ||
cy.fillTheForm({ | ||
name, | ||
blackListIds, | ||
outOfScheduleEnabled, | ||
}); | ||
|
||
cy.get('header').should('contain', 'External call filters'); | ||
|
||
cy.usePactWait('createExternalCallFilter') | ||
.its('response.statusCode') | ||
.should('eq', 201); | ||
}); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit ExternalCallFilter', () => { | ||
cy.intercept('GET', '**/api/client/external_call_filters/1', { | ||
...ExternalCallFilterItem, | ||
}).as('getExternalCallFilter-1'); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: `**/api/client/external_call_filters/${editExternalCallFilter.response.body.id}`, | ||
response: editExternalCallFilter.response, | ||
}, | ||
'editExternalCallFilter' | ||
); | ||
|
||
cy.get('svg[data-testid="EditIcon"]').first().click(); | ||
|
||
const { name, blackListIds, outOfScheduleEnabled } = | ||
editExternalCallFilter.request; | ||
cy.fillTheForm({ | ||
name, | ||
blackListIds, | ||
outOfScheduleEnabled, | ||
}); | ||
|
||
cy.contains('External call filters'); | ||
|
||
cy.usePactWait(['editExternalCallFilter']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete ExternalCallFilter', () => { | ||
cy.intercept('DELETE', '**/api/client/external_call_filters/*', { | ||
statusCode: 204, | ||
}).as('deleteExternalCallFilter'); | ||
|
||
cy.get('td button > svg[data-testid="DeleteIcon"]').first().click(); | ||
|
||
cy.contains('Remove element'); | ||
cy.get('div.MuiDialog-container button') | ||
.filter(':visible') | ||
.contains('Yes, delete it') | ||
.click(); | ||
|
||
cy.get('header').should('contain', 'External call filters'); | ||
|
||
cy.usePactWait(['deleteExternalCallFilter']) | ||
.its('response.statusCode') | ||
.should('eq', 204); | ||
}); | ||
}); |
96 changes: 96 additions & 0 deletions
96
web/portal/client/cypress/e2e/MatchList/ResidentialMatchList/MatchList.cy.js
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 @@ | ||
import MatchListCollection from '../../../fixtures/MatchList/getCollection.json'; | ||
import MatchListItem from '../../../fixtures/MatchList/getItem.json'; | ||
import newMatchList from '../../../fixtures/MatchList/post.json'; | ||
import editMatchList from '../../../fixtures/MatchList/put.json'; | ||
import { CLIENT_TYPE } from '../../../support/commands/prepareGenericPactInterceptors'; | ||
|
||
describe('MatchList', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('MatchList-Residential', { | ||
clientType: CLIENT_TYPE.Residential, | ||
}); | ||
cy.before(); | ||
|
||
cy.contains('Match Lists').click(); | ||
|
||
cy.get('header').should('contain', 'Match Lists'); | ||
|
||
cy.get('table').should('contain', MatchListCollection.body[0].name); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add MatchList', () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'POST', | ||
url: '**/api/client/match_lists*', | ||
response: newMatchList.response, | ||
matchingRules: newMatchList.matchingRules, | ||
}, | ||
'createMatchList' | ||
); | ||
|
||
cy.get('[aria-label=Add]').click(); | ||
|
||
cy.fillTheForm(newMatchList.request); | ||
|
||
cy.get('header').should('contain', 'Match Lists'); | ||
|
||
cy.usePactWait('createMatchList') | ||
.its('response.statusCode') | ||
.should('eq', 201); | ||
}); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit MatchList', () => { | ||
cy.intercept('GET', '**/api/client/match_lists/1', { | ||
...MatchListItem, | ||
}).as('getMatchList-1'); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: `**/api/client/match_lists/${editMatchList.response.body.id}`, | ||
response: editMatchList.response, | ||
}, | ||
'editMatchList' | ||
); | ||
|
||
cy.get('svg[data-testid="EditIcon"]').first().click(); | ||
|
||
cy.fillTheForm(editMatchList.request); | ||
|
||
cy.contains('Match Lists'); | ||
|
||
cy.usePactWait(['editMatchList']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete MatchList', () => { | ||
cy.intercept('DELETE', '**/api/client/match_lists/*', { | ||
statusCode: 204, | ||
}).as('deleteMatchList'); | ||
|
||
cy.get('td button > svg[data-testid="DeleteIcon"]').first().click(); | ||
|
||
cy.contains('Remove element'); | ||
cy.get('div.MuiDialog-container button') | ||
.filter(':visible') | ||
.contains('Yes, delete it') | ||
.click(); | ||
|
||
cy.get('header').should('contain', 'Match Lists'); | ||
|
||
cy.usePactWait(['deleteMatchList']) | ||
.its('response.statusCode') | ||
.should('eq', 204); | ||
}); | ||
}); |
27 changes: 27 additions & 0 deletions
27
web/portal/client/cypress/fixtures/Ddi/getItemResidential.json
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,27 @@ | ||
{ | ||
"body": { | ||
"ddi": "0", | ||
"ddie164": "0", | ||
"description": "New description for DDI residential 123", | ||
"recordCalls": "none", | ||
"displayName": "", | ||
"routeType": "residential", | ||
"friendValue": "", | ||
"conferenceRoom": null, | ||
"language": null, | ||
"queue": null, | ||
"externalCallFilter": null, | ||
"user": null, | ||
"ivr": null, | ||
"huntGroup": null, | ||
"fax": null, | ||
"ddiProvider": 1, | ||
"country": 0, | ||
"residentialDevice": 1, | ||
"conditionalRoute": null | ||
}, | ||
"headers": { | ||
"content-type": "application/json; charset=utf-8" | ||
}, | ||
"statusCode": 200 | ||
} |
Oops, something went wrong.