-
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.
- Loading branch information
Showing
26 changed files
with
1,164 additions
and
5 deletions.
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
34 changes: 34 additions & 0 deletions
34
web/portal/brand/cypress/e2e/Providers/DdiProviders/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,34 @@ | ||
import BillableCallsCollection from '../../../../fixtures/Provider/BillableCalls/getCollection.json'; | ||
import BillableCallItem from '../../../../fixtures/Provider/BillableCalls/getItem.json'; | ||
import DdisCollection from '../../../../fixtures/Provider/Ddis/getCollection.json'; | ||
|
||
describe('in Ddi Providers BillableCalls', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('ddis-billable_calls'); | ||
cy.before(); | ||
|
||
cy.get('svg[data-testid="PrecisionManufacturingIcon"]').first().click(); | ||
cy.contains('DDI Providers').click(); | ||
|
||
cy.get('td button svg[data-testid="MoreHorizIcon"]').first().click(); | ||
cy.get('li.MuiMenuItem-root').contains('External calls').click(); | ||
cy.get('header').should('contain', 'External calls'); | ||
cy.get('table').should('contain', DdisCollection.body[0].id); | ||
}); | ||
|
||
it('contains Billable Calls', () => { | ||
cy.get('table').should('contain', BillableCallsCollection.body[0].caller); | ||
}); | ||
|
||
it('View details', () => { | ||
cy.intercept('GET', '**/api/brand/billable_calls/*', { | ||
...BillableCallItem, | ||
}).as('getBillableCall-1'); | ||
|
||
cy.get('svg[data-testid="PanoramaIcon"]').first().click(); | ||
|
||
cy.usePactWait(['getBillableCall-1']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}); | ||
}); |
39 changes: 39 additions & 0 deletions
39
.../brand/cypress/e2e/Providers/DdiProviders/DDIProviderAddresses/DDIProviderAddresses.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,39 @@ | ||
import DdisProvidersAddressesCollection from '../../../../fixtures/Provider/DdiProviders/getProviderAddressesCollection.json'; | ||
import { | ||
deleteDdiProviders, | ||
postDdiProvidersAddresses, | ||
putDdiProvidersAddresses, | ||
} from './DDIProviderAddresses.tests'; | ||
|
||
describe('in Ddis Provider Addresses', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('DDIs-Providers-Addresses'); | ||
cy.before(); | ||
|
||
cy.get('svg[data-testid="PrecisionManufacturingIcon"]').first().click(); | ||
cy.contains('DDI Providers').click(); | ||
|
||
cy.get('svg[data-testid="DnsIcon"]').first().click(); | ||
cy.get('header').should('contain', 'DDI Providers'); | ||
|
||
cy.get('table').should( | ||
'contain', | ||
DdisProvidersAddressesCollection.body[0].id | ||
); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add Ddi Providers Addresses', postDdiProvidersAddresses); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Ddi Providers', putDdiProvidersAddresses); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete Ddi Providers', deleteDdiProviders); | ||
}); |
74 changes: 74 additions & 0 deletions
74
...and/cypress/e2e/Providers/DdiProviders/DDIProviderAddresses/DDIProviderAddresses.tests.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,74 @@ | ||
import DdiProvidersAddressesItem from '../../../../fixtures/Provider/DdiProviders/getProviderAddressesItem.json'; | ||
import newDdiProvidersAddresses from '../../../../fixtures/Provider/DdiProviders/postProviderAddresses.json'; | ||
import editDdisProvidersAddresses from '../../../../fixtures/Provider/DdiProviders/putProviderAddresses.json'; | ||
|
||
export const postDdiProvidersAddresses = () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'POST', | ||
url: '**/api/brand/ddi_provider_addresses*', | ||
response: newDdiProvidersAddresses.response, | ||
matchingRules: newDdiProvidersAddresses.matchingRules, | ||
}, | ||
'createDdiProvidersAddresses' | ||
); | ||
|
||
cy.get('[aria-label=Add]').click(); | ||
cy.get('header').should('contain', 'DDI Provider Addresses'); | ||
|
||
const { ip, description } = newDdiProvidersAddresses.request; | ||
cy.fillTheForm({ ip, description }); | ||
|
||
cy.usePactWait(['createDdiProvidersAddresses']) | ||
.its('response.statusCode') | ||
.should('eq', 201); | ||
}; | ||
|
||
export const putDdiProvidersAddresses = () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'GET', | ||
url: '**/api/brand/ddi_provider_addresses/1', | ||
response: { ...DdiProvidersAddressesItem }, | ||
}, | ||
'getDdisProvidersAddresses-1' | ||
); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: `**/api/brand/ddi_provider_addresses/${editDdisProvidersAddresses.response.body.id}`, | ||
response: editDdisProvidersAddresses.response, | ||
}, | ||
'editDdisProvidersAddresses' | ||
); | ||
|
||
cy.get('svg[data-testid="EditIcon"]').click(); | ||
|
||
const { description, ip } = editDdisProvidersAddresses.request; | ||
cy.fillTheForm({ description, ip }); | ||
|
||
cy.get('header').should('contain', 'DDI Provider Addresses'); | ||
|
||
cy.usePactWait(['editDdisProvidersAddresses']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}; | ||
|
||
export const deleteDdiProviders = () => { | ||
cy.intercept('DELETE', '**/api/brand/ddi_provider_addresses/*', { | ||
statusCode: 204, | ||
}).as('deleteDdiProvidersAddresses'); | ||
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', 'DDI Provider Addresses'); | ||
|
||
cy.usePactWait(['deleteDdiProvidersAddresses']) | ||
.its('response.statusCode') | ||
.should('eq', 204); | ||
}; |
42 changes: 42 additions & 0 deletions
42
...ypress/e2e/Providers/DdiProviders/DDIProviderRegistrations/DDIProviderRegistrations.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,42 @@ | ||
import DdisProvidersRegistrationsCollection from '../../../../fixtures/Provider/DdiProviders/getProviderRegistrationsCollection.json'; | ||
import { | ||
deleteDdiProvidersRegistrations, | ||
postDdiProvidersRegistrations, | ||
putDdiProvidersRegistrations, | ||
} from './DDIProviderRegistrations.tests'; | ||
|
||
describe('in Ddis Provider Registrations', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('DDIs-Providers-Registrations'); | ||
cy.before(); | ||
|
||
cy.get('svg[data-testid="PrecisionManufacturingIcon"]').first().click(); | ||
cy.contains('DDI Providers').click(); | ||
|
||
cy.get('td button svg[data-testid="MoreHorizIcon"]').first().click(); | ||
cy.get('li.MuiMenuItem-root') | ||
.contains('DDI Provider Registrations') | ||
.click(); | ||
cy.get('header').should('contain', 'DDI Provider Registrations'); | ||
|
||
cy.get('table').should( | ||
'contain', | ||
DdisProvidersRegistrationsCollection.body[0].username | ||
); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add Ddi Providers Registrations', postDdiProvidersRegistrations); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Ddi Providers Registrations', putDdiProvidersRegistrations); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete Ddi Providers Registrations', deleteDdiProvidersRegistrations); | ||
}); |
110 changes: 110 additions & 0 deletions
110
...ess/e2e/Providers/DdiProviders/DDIProviderRegistrations/DDIProviderRegistrations.tests.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,110 @@ | ||
import DdiProvidersRegistrationsItem from '../../../../fixtures/Provider/DdiProviders/getProviderRegistrationsItem.json'; | ||
import newDdiProvidersRegistrations from '../../../../fixtures/Provider/DdiProviders/postProviderRegistrations.json'; | ||
import editDdisProvidersRegistrations from '../../../../fixtures/Provider/DdiProviders/putProviderRegistrations.json'; | ||
|
||
export const postDdiProvidersRegistrations = () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'POST', | ||
url: '**/api/brand/ddi_provider_registrations*', | ||
response: newDdiProvidersRegistrations.response, | ||
matchingRules: newDdiProvidersRegistrations.matchingRules, | ||
}, | ||
'createDdiProvidersRegistrations' | ||
); | ||
|
||
cy.get('[aria-label=Add]').click(); | ||
cy.get('header').should('contain', 'DDI Provider Registrations'); | ||
|
||
const { | ||
username, | ||
domain, | ||
realm, | ||
authUsername, | ||
authPassword, | ||
authProxy, | ||
expires, | ||
multiDdi, | ||
} = newDdiProvidersRegistrations.request; | ||
cy.fillTheForm({ | ||
username, | ||
domain, | ||
realm, | ||
authUsername, | ||
authPassword, | ||
authProxy, | ||
expires, | ||
multiDdi, | ||
}); | ||
|
||
cy.usePactWait(['createDdiProvidersRegistrations']) | ||
.its('response.statusCode') | ||
.should('eq', 201); | ||
}; | ||
|
||
export const putDdiProvidersRegistrations = () => { | ||
cy.usePactIntercept( | ||
{ | ||
method: 'GET', | ||
url: '**/api/brand/ddi_provider_registrations/1', | ||
response: { ...DdiProvidersRegistrationsItem }, | ||
}, | ||
'getDdisProvidersRegistrations-1' | ||
); | ||
|
||
cy.usePactIntercept( | ||
{ | ||
method: 'PUT', | ||
url: `**/api/brand/ddi_provider_registrations/${editDdisProvidersRegistrations.response.body.id}`, | ||
response: editDdisProvidersRegistrations.response, | ||
}, | ||
'editDdisProvidersRegistrations' | ||
); | ||
|
||
cy.get('svg[data-testid="EditIcon"]').click(); | ||
|
||
const { | ||
username, | ||
realm, | ||
authUsername, | ||
authPassword, | ||
authProxy, | ||
expires, | ||
multiDdi, | ||
} = editDdisProvidersRegistrations.request; | ||
cy.fillTheForm({ | ||
username, | ||
realm, | ||
authUsername, | ||
authPassword, | ||
authProxy, | ||
expires, | ||
multiDdi, | ||
}); | ||
|
||
cy.get('header').should('contain', 'DDI Provider Registrations'); | ||
|
||
cy.usePactWait(['editDdisProvidersRegistrations']) | ||
.its('response.statusCode') | ||
.should('eq', 200); | ||
}; | ||
|
||
export const deleteDdiProvidersRegistrations = () => { | ||
cy.intercept('DELETE', '**/api/brand/ddi_provider_registrations/*', { | ||
statusCode: 204, | ||
}).as('deleteDdiProvidersRegistrations'); | ||
|
||
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', 'DDI Provider Registrations'); | ||
|
||
cy.usePactWait(['deleteDdiProvidersRegistrations']) | ||
.its('response.statusCode') | ||
.should('eq', 204); | ||
}; |
33 changes: 33 additions & 0 deletions
33
web/portal/brand/cypress/e2e/Providers/DdiProviders/Ddis/Ddis.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,33 @@ | ||
import DdisCollection from '../../../../fixtures/Provider/Ddis/getCollection.json'; | ||
import { deleteDdi, postDdi, putDdi } from './Ddis.tests'; | ||
|
||
describe('in Ddi Providers DDIs', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('DDIs'); | ||
cy.before(); | ||
|
||
cy.get('svg[data-testid="PrecisionManufacturingIcon"]').first().click(); | ||
cy.contains('DDI Providers').click(); | ||
|
||
cy.get('td button svg[data-testid="MoreHorizIcon"]').first().click(); | ||
cy.get('li.MuiMenuItem-root').contains('DDIs').click(); | ||
cy.get('header').should('contain', 'DDIs'); | ||
|
||
cy.get('table').should('contain', DdisCollection.body[0].id); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add Ddi', postDdi); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Ddi', putDdi); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete Ddi', deleteDdi); | ||
}); |
35 changes: 35 additions & 0 deletions
35
web/portal/brand/cypress/e2e/Providers/DdiProviders/DdisProviders.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,35 @@ | ||
import DdisProvidersCollection from '../../../fixtures/Provider/DdiProviders/getCollection.json'; | ||
import { | ||
deleteDdiProviders, | ||
postDdiProviders, | ||
putDdiProviders, | ||
} from './DdisProviders.tests'; | ||
|
||
describe('in Ddis Providers', () => { | ||
beforeEach(() => { | ||
cy.prepareGenericPactInterceptors('DDIs-Providers'); | ||
cy.before(); | ||
|
||
cy.get('svg[data-testid="PrecisionManufacturingIcon"]').first().click(); | ||
cy.contains('DDI Providers').click(); | ||
|
||
cy.get('header').should('contain', 'DDI Providers'); | ||
|
||
cy.get('table').should('contain', DdisProvidersCollection.body[0].id); | ||
}); | ||
|
||
/////////////////////// | ||
// POST | ||
/////////////////////// | ||
it('add Ddi Providers', postDdiProviders); | ||
|
||
/////////////////////////////// | ||
// PUT | ||
/////////////////////////////// | ||
it('edit Ddi Providers', putDdiProviders); | ||
|
||
/////////////////////// | ||
// DELETE | ||
/////////////////////// | ||
it('delete Ddi Providers', deleteDdiProviders); | ||
}); |
Oops, something went wrong.