-
Notifications
You must be signed in to change notification settings - Fork 79
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 #2810 from irontec/PROVIDER-1958-cypress-brand-cli…
…ent-block Add clients block cypress tests
- Loading branch information
Showing
40 changed files
with
2,284 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
web/portal/brand/cypress/e2e/Clients/Residential/RatingProfile/RatingProfile.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,29 @@ | ||
import RatingProfiles from '../../../../fixtures/Provider/RatingProfile/getCollection.json'; | ||
import { | ||
deleteProfile, | ||
postProfile, | ||
putProfile, | ||
} from '../../common/RatingProfile.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('residential-client-rating-profiles'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Virtual PBXs').click(); | ||
|
||
cy.get('header').should('contain', 'Virtual PBXs'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Rating Profiles').click(); | ||
cy.get('header').should('contain', 'Rating Profiles'); | ||
|
||
cy.get('table').should('contain', RatingProfiles.body[0].ratingPlanGroup); | ||
}); | ||
|
||
it('add RatingProfile', postProfile); | ||
|
||
it('edit RatingProfile', putProfile); | ||
|
||
it('delete RatingProfile', deleteProfile); | ||
}); |
28 changes: 28 additions & 0 deletions
28
web/portal/brand/cypress/e2e/Clients/Residential/UsersAddress/UsersAddress.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,28 @@ | ||
import UsersAddresses from '../../../../fixtures/Kam/UsersAddresses/getCollection.json'; | ||
import { | ||
addUserAddress, | ||
deleteUserAddress, | ||
} from '../../common/UserAddress.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('residential-client-users-addresses'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Residentials').click(); | ||
|
||
cy.get('header').should('contain', 'Residentials'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root') | ||
.contains(/^Authorized sources$/) | ||
.click(); | ||
cy.get('header').should('contain', 'Authorized sources'); | ||
|
||
cy.get('table').should('contain', UsersAddresses.body[0].description); | ||
}); | ||
|
||
it('add UserAddress', addUserAddress); | ||
|
||
it('delete UserAddress', deleteUserAddress); | ||
}); |
29 changes: 29 additions & 0 deletions
29
web/portal/brand/cypress/e2e/Clients/Retails/RatingProfile/RatingProfile.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,29 @@ | ||
import RatingProfiles from '../../../../fixtures/Provider/RatingProfile/getCollection.json'; | ||
import { | ||
deleteProfile, | ||
postProfile, | ||
putProfile, | ||
} from '../../common/RatingProfile.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('retails-client-rating-profiles'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Retails').click(); | ||
|
||
cy.get('header').should('contain', 'Retails'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Rating Profiles').click(); | ||
cy.get('header').should('contain', 'Rating Profiles'); | ||
|
||
cy.get('table').should('contain', RatingProfiles.body[0].ratingPlanGroup); | ||
}); | ||
|
||
it('add RatingProfile', postProfile); | ||
|
||
it('edit RatingProfile', putProfile); | ||
|
||
it('delete RatingProfile', deleteProfile); | ||
}); |
31 changes: 31 additions & 0 deletions
31
web/portal/brand/cypress/e2e/Clients/Retails/UsersAddress/UsersAdress.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,31 @@ | ||
import UsersAddresses from '../../../../fixtures/Kam/UsersAddresses/getCollection.json'; | ||
import { | ||
addUserAddress, | ||
deleteUserAddress, | ||
editUserAddress, | ||
} from '../../common/UserAddress.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('retail-client-users-addresses'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Retails').click(); | ||
|
||
cy.get('header').should('contain', 'Retails'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root') | ||
.contains(/^Authorized sources$/) | ||
.click(); | ||
cy.get('header').should('contain', 'Authorized sources'); | ||
|
||
cy.get('table').should('contain', UsersAddresses.body[0].description); | ||
}); | ||
|
||
it('add UsersAddress', addUserAddress); | ||
|
||
it('update UsersAddress', editUserAddress); | ||
|
||
it('delete UsersAddress', deleteUserAddress); | ||
}); |
26 changes: 26 additions & 0 deletions
26
web/portal/brand/cypress/e2e/Clients/VirtualPbxs/BannedAddress/BannedAddress.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,26 @@ | ||
import BannedAddresses from '../../../../fixtures/Provider/BannedAddress/getCollection.json'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('vpbx-client-banned-addresses'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Virtual PBXs').click(); | ||
|
||
cy.get('header').should('contain', 'Virtual PBXs'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Banned IP addresses').click(); | ||
cy.get('header').should('contain', 'Banned IP addresses'); | ||
|
||
cy.get('table').should('contain', BannedAddresses.body[0].ip); | ||
}); | ||
|
||
it('edit disabled', () => { | ||
cy.get('[data-testid="EditIcon"]').should('not.be.enabled'); | ||
}); | ||
|
||
it('delete disabled', () => { | ||
cy.get('[data-testid="DeleteIcon"]').should('not.be.enabled'); | ||
}); | ||
}); |
29 changes: 29 additions & 0 deletions
29
web/portal/brand/cypress/e2e/Clients/VirtualPbxs/RatingProfile/RatingProfile.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,29 @@ | ||
import RatingProfiles from '../../../../fixtures/Provider/RatingProfile/getCollection.json'; | ||
import { | ||
deleteProfile, | ||
postProfile, | ||
putProfile, | ||
} from '../../common/RatingProfile.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('vpbx-client-rating-profiles'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Virtual PBXs').click(); | ||
|
||
cy.get('header').should('contain', 'Virtual PBXs'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Rating Profiles').click(); | ||
cy.get('header').should('contain', 'Rating Profiles'); | ||
|
||
cy.get('table').should('contain', RatingProfiles.body[0].ratingPlanGroup); | ||
}); | ||
|
||
it('add RatingProfile', postProfile); | ||
|
||
it('edit RatingProfile', putProfile); | ||
|
||
it('delete RatingProfile', deleteProfile); | ||
}); |
31 changes: 31 additions & 0 deletions
31
web/portal/brand/cypress/e2e/Clients/VirtualPbxs/UsersAddress/UsersAdress.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,31 @@ | ||
import UsersAddresses from '../../../../fixtures/Kam/UsersAddresses/getCollection.json'; | ||
import { | ||
addUserAddress, | ||
deleteUserAddress, | ||
editUserAddress, | ||
} from '../../common/UserAddress.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('vpbx-client-users-addresses'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Virtual PBXs').click(); | ||
|
||
cy.get('header').should('contain', 'Virtual PBXs'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root') | ||
.contains(/^Authorized sources$/) | ||
.click(); | ||
cy.get('header').should('contain', 'Authorized sources'); | ||
|
||
cy.get('table').should('contain', UsersAddresses.body[0].description); | ||
}); | ||
|
||
it('add UsersAddress', addUserAddress); | ||
|
||
it('edit UsersAddress', editUserAddress); | ||
|
||
it('delete UsersAddress', deleteUserAddress); | ||
}); |
47 changes: 47 additions & 0 deletions
47
web/portal/brand/cypress/e2e/Clients/Wholesales/Administrator/Administrator.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,47 @@ | ||
import AdministratorCollection from '../../../../fixtures/Provider/Administrator/getCollection.json'; | ||
import { | ||
deleteAdministrator, | ||
postAdministrator, | ||
putActiveAdministratorEmptyPassword, | ||
putAdministrator, | ||
} from '../../../Administrator/Administrator.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('retail-client-administrator'); | ||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Retails').click(); | ||
|
||
cy.get('header').should('contain', 'Retails'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root') | ||
.contains(/^Client's Administrators$/) | ||
.click(); | ||
cy.get('header').should('contain', "Client's Administrators"); | ||
|
||
cy.get('table').should('contain', AdministratorCollection.body[0].username); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add Administrator', postAdministrator); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Administrator', putAdministrator); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it( | ||
'edit active Administrator with empty password', | ||
putActiveAdministratorEmptyPassword | ||
); | ||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete Administrator', deleteAdministrator); | ||
}); |
29 changes: 29 additions & 0 deletions
29
web/portal/brand/cypress/e2e/Clients/Wholesales/RatingProfile/RatingProfile.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,29 @@ | ||
import RatingProfiles from '../../../../fixtures/Provider/RatingProfile/getCollection.json'; | ||
import { | ||
deleteProfile, | ||
postProfile, | ||
putProfile, | ||
} from '../../common/RatingProfile.tests'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('vpbx-client-rating-profiles'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Virtual PBXs').click(); | ||
|
||
cy.get('header').should('contain', 'Virtual PBXs'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Rating Profiles').click(); | ||
cy.get('header').should('contain', 'Rating Profiles'); | ||
|
||
cy.get('table').should('contain', RatingProfiles.body[0].ratingPlanGroup); | ||
}); | ||
|
||
it('add RatingProfile', postProfile); | ||
|
||
it('edit RatingProfile', putProfile); | ||
|
||
it('delete RatingProfile', deleteProfile); | ||
}); |
103 changes: 103 additions & 0 deletions
103
web/portal/brand/cypress/e2e/Clients/Wholesales/Trusted/Trusted.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,103 @@ | ||
import Trusteds from '../../../../fixtures/Kam/Trusted/getCollection.json'; | ||
import TrustedItem from '../../../../fixtures/Kam/Trusted/getItem.json'; | ||
import NewTrusted from '../../../../fixtures/Kam/Trusted/post.json'; | ||
import EditTrusted from '../../../../fixtures/Kam/Trusted/put.json'; | ||
|
||
describe('in Administrator', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('wholesale-client-trusted'); | ||
|
||
cy.before(''); | ||
cy.contains('Clients').click(); | ||
cy.contains('Wholesales').click(); | ||
|
||
cy.get('header').should('contain', 'Wholesales'); | ||
cy.get('td button svg[data-testid="MoreHorizIcon"]').eq(3).click(); | ||
cy.get('li.MuiMenuItem-root').contains('Authorized Ip Addresses').click(); | ||
cy.get('header').should('contain', 'Authorized Ip Addresses'); | ||
|
||
cy.get('table').should('contain', Trusteds.body[0].srcIp); | ||
}); | ||
|
||
it('add Trusted', () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'POST', | ||
url: '**/api/brand/trusteds*', | ||
response: NewTrusted.response, | ||
}, | ||
'postTrusteds' | ||
); | ||
|
||
cy.get('button').contains('Add').click(); | ||
|
||
cy.get('header').should('contain', 'New'); | ||
|
||
const { srcIp, description } = NewTrusted.body; | ||
|
||
cy.fillTheForm({ | ||
srcIp, | ||
description, | ||
}); | ||
|
||
cy.usePactWait('postTrusteds').its('response.statusCode').should('eq', 201); | ||
}); | ||
|
||
it('edit Trusted', () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'GET', | ||
url: '**/api/brand/trusteds/1', | ||
response: TrustedItem.response, | ||
}, | ||
'getTrusteds-1' | ||
); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: '**/api/brand/trusteds/1', | ||
response: EditTrusted.response, | ||
}, | ||
'putTrusteds-1' | ||
); | ||
|
||
cy.get('table [data-testid="EditIcon"]').click(); | ||
|
||
cy.usePactWait('getTrusteds-1') | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
|
||
const { srcIp, description } = EditTrusted.request; | ||
cy.fillTheForm({ | ||
srcIp: srcIp, | ||
description: description, | ||
}); | ||
|
||
cy.usePactWait(['putTrusteds-1']) | ||
.its('response.statusCode') | ||
.should('eq', 201); | ||
}); | ||
|
||
it('delete Trusted', () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'DELETE', | ||
url: '**/api/brand/trusteds/1', | ||
response: '200', | ||
}, | ||
'deleteTrusted-1' | ||
); | ||
|
||
cy.get('table [data-testid="DeleteIcon"]').first().click(); | ||
cy.contains('Remove element'); | ||
cy.get('div.MuiDialog-container button') | ||
.filter(':visible') | ||
.contains('Yes, delete it') | ||
.click({ force: true }); | ||
|
||
cy.usePactWait('deleteTrusted-1') | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
}); |
Oops, something went wrong.