1 import { initCommonFixtures } from "../common/init";
3 describe('Collapsing Roles', () => {
6 initCommonFixtures(cy);
8 cy.fixture('common/service-metadata').as('serviceMetaData');
9 cy.fixture('common/vf-metadata').as('vfMetaData');
10 cy.fixture('common/service-certifyResponse').as('serviceCertifyResponse');
11 cy.fixture('common/dependencies').as('dependenciesResponse');
12 cy.fixture('common/packages').as('packagesResponse');
15 it('Service - Verify UpdateServices, CheckOut, Distribute and Archive exist for a Certified Service that was not Distributed', function () {
16 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
17 cy.route('GET', '**/services/*/dependencies',[]);
19 this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTION_NOT_APPROVED';
21 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
22 cy.visit(generalPageUrl);
24 console.log('Verify life cycle is Distribution Approved');
25 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
26 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Waiting For Distribution');
28 console.log('Verify Upgrade Services Button');
29 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
30 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services');
32 console.log('Verify Distribute Services Button');
33 cy.get('[data-tests-id="distribute"]').should('be.visible');
34 cy.get('[data-tests-id="distribute"]').should('contain.text','Distribute');
36 console.log('Verify Check Out Button');
37 cy.get('[data-tests-id="check_out"]').should('be.visible');
38 cy.get('[data-tests-id="check_out"]').should('contain.text','Check Out');
40 console.log('Verify Archive Button');
41 cy.get('[data-tests-id="archive-component-button"]').should('be.visible');
42 cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive');
44 console.log('Verify Redistribute Button Not Exist');
45 cy.get('[data-tests-id="redistribute"]').should('not.be.visible');
46 cy.get('[data-tests-id="redistribute"]').should('not.exist');
48 console.log("Verify that Certify button does not exist")
49 cy.get('[data-tests-id="certify"]').should('not.be.visible');
52 it('Service - Verify UpdateServices, CheckOut, Redistribute and Archive exist for a Certified Service that was Distributed', function () {
53 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
54 cy.route('GET', '**/services/*/dependencies',[]);
56 this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED';
58 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
59 cy.visit(generalPageUrl);
61 console.log('Verify life cycle is Distribution Approved');
62 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
63 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Distributed');
65 console.log('Verify Upgrade Services Button');
66 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
67 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services');
69 console.log('Verify Distribute Services Button');
70 cy.get('[data-tests-id="redistribute"]').should('be.visible');
71 cy.get('[data-tests-id="redistribute"]').should('contain.text','Redistribute');
73 console.log('Verify Check Out Button');
74 cy.get('[data-tests-id="check_out"]').should('be.visible');
75 cy.get('[data-tests-id="check_out"]').should('contain.text','Check Out');
77 console.log('Verify Archive Button');
78 cy.get('[data-tests-id="archive-component-button"]').should('be.visible');
79 cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive');
81 console.log('Verify Distribute Button Not Exist');
82 cy.get('[data-tests-id="distribute"]').should('not.be.visible');
83 cy.get('[data-tests-id="distribute"]').should('not.exist');
85 console.log("Verify that Certify button does not exist")
86 cy.get('[data-tests-id="certify"]').should('not.be.visible');
89 it('Service - Verify UpdateServices button is disabled in case there are no Dependencies for a Certified Service', function () {
90 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
91 cy.route('GET', '**/services/*/dependencies',[{dependencies: null}]);
93 this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED';
95 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
96 cy.visit(generalPageUrl);
98 console.log('Verify life cycle is Distribution Approved');
99 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
100 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.disabled');
101 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services');
103 console.log("Verify that Certify button does not exist")
104 cy.get('[data-tests-id="certify"]').should('not.be.visible');
107 it('Service - Verify UpdateServices button is enabled in case there are Dependencies for a Certified Service', function () {
108 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
109 cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]);
111 this.serviceMetaData.metadata.distributionStatus = 'DISTRIBUTED';
113 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
114 cy.visit(generalPageUrl);
116 console.log('Verify life cycle is Distribution Approved');
117 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
118 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.enabled');
119 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Update Services');
121 console.log("Verify that Certify button does not exist")
122 cy.get('[data-tests-id="certify"]').should('not.be.visible');
125 it('Service - Verify UpdateServices Not exist and Certify Exist in case Service is in state NOT_CERTIFIED_CHECKOUT', function () {
126 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
127 cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]);
129 this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKOUT';
131 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
132 cy.visit(generalPageUrl);
134 console.log('Verify life cycle is Distribution Approved');
135 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('not.be.visible');
137 cy.get('[data-tests-id="certify"]').should('be.visible').click();
138 cy.get('[data-tests-id="checkindialog"]').should('be.visible');
141 it('Service - Verify UpdateServices Not exist and Certify Exist in case Service is in state NOT_CERTIFIED_CHECKIN', function () {
142 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
143 cy.route('GET', '**/services/*/dependencies',[{dependencies: {}}]);
145 this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKIN';
147 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
148 cy.visit(generalPageUrl);
150 cy.get('[data-tests-id="certify"]').should('be.visible').click();
151 cy.get('[data-tests-id="checkindialog"]').should('be.visible');
155 it('Service - When Service is being Certified, and has Dependencies, Update Service modal will be opened automatically', function () {
156 cy.route('GET', '**/services/*/filteredDataByParams?include=metadata', '@serviceMetaData');
157 cy.route('GET', '**/services/*/dependencies','@dependenciesResponse');
158 cy.route('POST', '**/services/*/lifecycleState/certify','@serviceCertifyResponse');
159 cy.route('GET', '**/catalog/services/validate-name/*', { isValid: true})
160 this.serviceMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKOUT';
162 const generalPageUrl = '#!/dashboard/workspace/' + this.serviceMetaData.metadata.uniqueId + '/service/general';
163 cy.visit(generalPageUrl);
165 console.log('Verify life cycle is Distribution Approved');
166 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('not.be.visible');
168 console.log('Click Certify');
169 cy.get('[data-tests-id="certify"]').should('be.visible').click();
171 console.log('Insert confirm text');
172 cy.get('[data-tests-id="checkindialog"]').should('be.visible').type('Test_1234');
174 console.log('Click OK');
175 cy.get('[data-tests-id="confirm-modal-button-ok"]').should('be.visible').click();
177 console.log('Close the Modal');
178 cy.get('[data-tests-id="upgradeVspModal-button-close"]').should('be.visible').click();
181 it('VF - Verify Certify and Check in exist for a NOT_CERTIFIED_CHECKOUT VF', function () {
182 cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData');
183 cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse');
185 const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general';
186 cy.visit(generalPageUrl);
188 console.log('Verify life cycle is IN DESIGN CHECK OUT');
189 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
190 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','In Design Check Out');
192 console.log('Verify Certify button exist');
193 cy.get('[data-tests-id="certify"]').should('be.visible').click();
194 cy.get('[data-tests-id="checkindialog"]').should('be.visible');
196 console.log('Verify Check in button exist');
197 cy.get('[data-tests-id="check_in"]').should('be.visible');
201 it('VF - Verify Certify and Check out exist for a NOT_CERTIFIED_CHECKOUT VF', function () {
202 cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData');
203 cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse');
205 this.vfMetaData.metadata.lifecycleState = 'NOT_CERTIFIED_CHECKIN';
207 const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general';
208 cy.visit(generalPageUrl);
210 console.log('Verify life cycle is IN DESIGN CHECK IN');
211 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
212 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','In Design Check In');
214 console.log('Verify Certify button exist');
215 cy.get('[data-tests-id="certify"]').should('be.visible').click();
216 cy.get('[data-tests-id="checkindialog"]').should('be.visible');
218 console.log('Verify Check Out button exist');
219 cy.get('[data-tests-id="check_out"]').should('be.visible');
223 it('VF - Verify UpgradeServices is Disabled in case there are no Dependencies for a Certified VF', function () {
224 cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData');
225 cy.route('GET', '**/resources/*/dependencies',[{dependencies: null}]);
227 this.vfMetaData.metadata.lifecycleState = 'CERTIFIED';
229 const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general';
230 cy.visit(generalPageUrl);
232 console.log('Verify life cycle is Certified');
233 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
234 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Certified');
236 console.log('Verify life cycle is Distribution Approved');
237 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
238 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.disabled');
239 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Upgrade Services');
241 console.log('Verify Check Out button exist');
242 cy.get('[data-tests-id="check_out"]').should('be.visible');
244 console.log('Verify Archive Button');
245 cy.get('[data-tests-id="archive-component-button"]').should('be.visible');
246 cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive');
250 it('VF - Verify UpgradeServices is Enabled and Modal is opened in case there are no Dependencies for a Certified VF', function () {
251 cy.route('GET', '**/resources/*/filteredDataByParams?include=metadata', '@vfMetaData');
252 cy.route('GET', '**/resources/*/dependencies',[{dependencies: {}}]);
253 cy.route('GET', '**/onboarding-api/*/vendor-software-products/packages', '@packagesResponse');
255 this.vfMetaData.metadata.lifecycleState = 'CERTIFIED';
257 const generalPageUrl = '#!/dashboard/workspace/' + this.vfMetaData.metadata.uniqueId + '/resource/general';
258 cy.visit(generalPageUrl);
260 console.log('Verify life cycle is Certified');
261 cy.get('[data-tests-id="formlifecyclestate"]').should('be.visible');
262 cy.get('[data-tests-id="formlifecyclestate"]').should('have.text','Certified');
264 console.log('Verify life cycle is Distribution Approved');
265 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.visible');
266 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('be.enabled');
267 cy.get('[data-tests-id="open-upgrade-vsp-popup"]').should('have.text','Upgrade Services').click();
268 cy.get('[class="sdc-modal__wrapper sdc-modal-type-custom"]').should('be.visible');
269 cy.get('[data-tests-id="upgradeVspModal-button-close"]').should('be.enabled').click();
271 console.log('Verify Check Out button exist');
272 cy.get('[data-tests-id="check_out"]').should('be.visible');
274 console.log('Verify Archive Button');
275 cy.get('[data-tests-id="archive-component-button"]').should('be.visible');
276 cy.get('[data-tests-id="archive-component-button"]').should('have.text','Archive');