| @@ 3-207 (lines=205) @@ | ||
| 1 | /// <reference types="Cypress" /> |
|
| 2 | ||
| 3 | import MediaPageObject from "../../../support/pages/module/sw-media.page-object"; |
|
| 4 | ||
| 5 | describe('Property: Test ACL privileges', () => { |
|
| 6 | beforeEach(() => { |
|
| 7 | cy.setToInitialState() |
|
| 8 | .then(() => { |
|
| 9 | cy.loginViaApi(); |
|
| 10 | }) |
|
| 11 | .then(() => { |
|
| 12 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 13 | }); |
|
| 14 | }); |
|
| 15 | ||
| 16 | it('@media: has no access to media module', () => { |
|
| 17 | cy.window().then((win) => { |
|
| 18 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 19 | return; |
|
| 20 | } |
|
| 21 | ||
| 22 | cy.loginAsUserWithPermissions([ |
|
| 23 | { |
|
| 24 | key: 'property', |
|
| 25 | role: 'viewer' |
|
| 26 | } |
|
| 27 | ]).then(() => { |
|
| 28 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 29 | }); |
|
| 30 | ||
| 31 | // open media-payment without permissions |
|
| 32 | cy.get('.sw-privilege-error__access-denied-image').should('be.visible'); |
|
| 33 | cy.get('h1').contains('Access denied'); |
|
| 34 | cy.get('.sw-media-library').should('not.exist'); |
|
| 35 | ||
| 36 | // see menu without media-payment menu item |
|
| 37 | cy.get('.sw-content > span.sw-admin-menu__navigation-link').click(); |
|
| 38 | cy.get('.sw-admin-menu__navigation-list-item.sw-media').should('not.exist'); |
|
| 39 | }); |
|
| 40 | }); |
|
| 41 | ||
| 42 | it('@media: can view media', () => { |
|
| 43 | const page = new MediaPageObject(); |
|
| 44 | ||
| 45 | cy.window().then((win) => { |
|
| 46 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 47 | return; |
|
| 48 | } |
|
| 49 | ||
| 50 | cy.loginAsUserWithPermissions([ |
|
| 51 | { |
|
| 52 | key: 'media', |
|
| 53 | role: 'viewer' |
|
| 54 | } |
|
| 55 | ]).then(() => { |
|
| 56 | cy.visit(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 57 | }); |
|
| 58 | ||
| 59 | // check upload |
|
| 60 | cy.get('.sw-media-upload-v2__button-compact-upload').should('be.disabled'); |
|
| 61 | cy.get('.sw-media-upload-v2__button-context-menu').should('be.disabled'); |
|
| 62 | ||
| 63 | cy.clickContextMenuItem( |
|
| 64 | '.sw-media-context-item__show-media-action', |
|
| 65 | page.elements.contextMenuButton, |
|
| 66 | '.sw-media-grid-item__item--0' |
|
| 67 | ); |
|
| 68 | cy.get('.sw-media-sidebar__quickaction--disabled.quickaction--move').should('be.visible'); |
|
| 69 | }); |
|
| 70 | }); |
|
| 71 | ||
| 72 | it('@media: can edit media', () => { |
|
| 73 | cy.window().then((win) => { |
|
| 74 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 75 | return; |
|
| 76 | } |
|
| 77 | ||
| 78 | // Request we want to wait for later |
|
| 79 | cy.server(); |
|
| 80 | cy.route({ |
|
| 81 | url: '/api/v*/media-method/*', |
|
| 82 | method: 'patch' |
|
| 83 | }).as('savePayment'); |
|
| 84 | ||
| 85 | const page = new MediaPageObject(); |
|
| 86 | ||
| 87 | cy.loginAsUserWithPermissions([ |
|
| 88 | { |
|
| 89 | key: 'media', |
|
| 90 | role: 'viewer' |
|
| 91 | }, { |
|
| 92 | key: 'media', |
|
| 93 | role: 'editor' |
|
| 94 | } |
|
| 95 | ]).then(() => { |
|
| 96 | cy.visit(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 97 | }); |
|
| 98 | cy.get('.sw-media-upload-v2__button-compact-upload').should('be.disabled'); |
|
| 99 | cy.get('.sw-media-upload-v2__button-context-menu').should('be.disabled'); |
|
| 100 | ||
| 101 | // open media method |
|
| 102 | cy.clickContextMenuItem( |
|
| 103 | '.sw-media-context-item__show-media-action', |
|
| 104 | page.elements.contextMenuButton, |
|
| 105 | '.sw-media-grid-item__item--0' |
|
| 106 | ); |
|
| 107 | cy.get('.sw-media-sidebar__quickaction--disabled.quickaction--move').should('not.exist'); |
|
| 108 | }); |
|
| 109 | }); |
|
| 110 | ||
| 111 | it('@media: can create media', () => { |
|
| 112 | cy.window().then((win) => { |
|
| 113 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 114 | return; |
|
| 115 | } |
|
| 116 | ||
| 117 | cy.server(); |
|
| 118 | cy.route({ |
|
| 119 | url: `${Cypress.env('apiPath')}/_action/media/**/upload?extension=png&fileName=sw-login-background`, |
|
| 120 | method: 'post' |
|
| 121 | }).as('saveDataFileUpload'); |
|
| 122 | ||
| 123 | cy.route({ |
|
| 124 | url: `${Cypress.env('apiPath')}/_action/media/**/upload?extension=png&fileName=sw_logo_white`, |
|
| 125 | method: 'post' |
|
| 126 | }).as('saveDataUrlUpload'); |
|
| 127 | ||
| 128 | const page = new MediaPageObject(); |
|
| 129 | ||
| 130 | cy.loginAsUserWithPermissions([ |
|
| 131 | { |
|
| 132 | key: 'media', |
|
| 133 | role: 'viewer' |
|
| 134 | }, { |
|
| 135 | key: 'media', |
|
| 136 | role: 'editor' |
|
| 137 | }, { |
|
| 138 | key: 'media', |
|
| 139 | role: 'creator' |
|
| 140 | } |
|
| 141 | ]).then(() => { |
|
| 142 | cy.visit(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 143 | }); |
|
| 144 | ||
| 145 | cy.get('.sw-media-upload-v2__button-compact-upload').should('be.enabled'); |
|
| 146 | cy.get('.sw-media-upload-v2__button-context-menu').should('be.enabled'); |
|
| 147 | ||
| 148 | if (Cypress.isBrowser({ family: 'chromium' })) { |
|
| 149 | page.uploadImageUsingFileUpload('img/sw-login-background.png', 'sw-login-background.png'); |
|
| 150 | ||
| 151 | cy.wait('@saveDataFileUpload').then((xhr) => { |
|
| 152 | cy.awaitAndCheckNotification('File has been saved.'); |
|
| 153 | expect(xhr).to.have.property('status', 204); |
|
| 154 | }); |
|
| 155 | cy.get('.sw-media-base-item__name[title="sw-login-background.png"]') |
|
| 156 | .should('be.visible'); |
|
| 157 | } |
|
| 158 | ||
| 159 | if (Cypress.isBrowser('firefox')) { |
|
| 160 | // Upload medium |
|
| 161 | cy.clickContextMenuItem( |
|
| 162 | '.sw-media-upload-v2__button-url-upload', |
|
| 163 | '.sw-media-upload-v2__button-context-menu' |
|
| 164 | ); |
|
| 165 | page.uploadImageUsingUrl('http://assets.shopware.com/sw_logo_white.png'); |
|
| 166 | ||
| 167 | cy.wait('@saveDataUrlUpload').then((xhr) => { |
|
| 168 | cy.awaitAndCheckNotification('File has been saved.'); |
|
| 169 | expect(xhr).to.have.property('status', 204); |
|
| 170 | }); |
|
| 171 | cy.get('.sw-media-base-item__name[title="sw_logo_white.png"]') |
|
| 172 | .should('be.visible'); |
|
| 173 | ||
| 174 | } |
|
| 175 | }); |
|
| 176 | }); |
|
| 177 | ||
| 178 | it('@media: can delete media', () => { |
|
| 179 | cy.window().then((win) => { |
|
| 180 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 181 | return; |
|
| 182 | } |
|
| 183 | const page = new MediaPageObject(); |
|
| 184 | ||
| 185 | cy.loginAsUserWithPermissions([ |
|
| 186 | { |
|
| 187 | key: 'media', |
|
| 188 | role: 'deleter' |
|
| 189 | } |
|
| 190 | ]).then(() => { |
|
| 191 | cy.visit(`${Cypress.env('admin')}#/sw/media/index`); |
|
| 192 | }); |
|
| 193 | ||
| 194 | // check upload |
|
| 195 | cy.get('.sw-media-upload-v2__button-compact-upload').should('be.disabled'); |
|
| 196 | cy.get('.sw-media-upload-v2__button-context-menu').should('be.disabled'); |
|
| 197 | ||
| 198 | cy.clickContextMenuItem( |
|
| 199 | '.sw-media-context-item__show-media-action', |
|
| 200 | page.elements.contextMenuButton, |
|
| 201 | '.sw-media-grid-item__item--0' |
|
| 202 | ); |
|
| 203 | cy.get('.sw-media-sidebar__quickaction--disabled.quickaction--move').should('be.visible'); |
|
| 204 | cy.get('.sw-media-sidebar__quickaction--disabled.quickaction--deleter').should('not.exist'); |
|
| 205 | }); |
|
| 206 | }); |
|
| 207 | }); |
|
| 208 | ||
| @@ 3-194 (lines=192) @@ | ||
| 1 | /// <reference types="Cypress" /> |
|
| 2 | ||
| 3 | import ProductPageObject from '../../../support/pages/module/sw-product.page-object'; |
|
| 4 | ||
| 5 | describe('Property: Test ACL privileges', () => { |
|
| 6 | beforeEach(() => { |
|
| 7 | cy.setToInitialState() |
|
| 8 | .then(() => { |
|
| 9 | cy.loginViaApi(); |
|
| 10 | }) |
|
| 11 | .then(() => { |
|
| 12 | return cy.createDefaultFixture('payment-method'); |
|
| 13 | }) |
|
| 14 | .then(() => { |
|
| 15 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/settings/payment/index`); |
|
| 16 | }); |
|
| 17 | }); |
|
| 18 | ||
| 19 | it('@settings: has no access to payment module', () => { |
|
| 20 | cy.window().then((win) => { |
|
| 21 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 22 | return; |
|
| 23 | } |
|
| 24 | ||
| 25 | cy.loginAsUserWithPermissions([ |
|
| 26 | { |
|
| 27 | key: 'property', |
|
| 28 | role: 'viewer' |
|
| 29 | } |
|
| 30 | ]).then(() => { |
|
| 31 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/settings/payment/index`); |
|
| 32 | }); |
|
| 33 | ||
| 34 | // open settings-payment without permissions |
|
| 35 | cy.get('.sw-privilege-error__access-denied-image').should('be.visible'); |
|
| 36 | cy.get('h1').contains('Access denied'); |
|
| 37 | cy.get('.sw-settings-payment-list').should('not.exist'); |
|
| 38 | ||
| 39 | // see menu without settings-payment menu item |
|
| 40 | cy.get('.sw-admin-menu__item--sw-settings').click(); |
|
| 41 | cy.get('.sw-admin-menu__navigation-list-item.sw-settings-payment').should('not.exist'); |
|
| 42 | }); |
|
| 43 | }); |
|
| 44 | ||
| 45 | it('@settings: can view payment', () => { |
|
| 46 | cy.window().then((win) => { |
|
| 47 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 48 | return; |
|
| 49 | } |
|
| 50 | ||
| 51 | cy.loginAsUserWithPermissions([ |
|
| 52 | { |
|
| 53 | key: 'payment', |
|
| 54 | role: 'viewer' |
|
| 55 | } |
|
| 56 | ]).then(() => { |
|
| 57 | cy.visit(`${Cypress.env('admin')}#/sw/settings/payment/index`); |
|
| 58 | }); |
|
| 59 | ||
| 60 | // open settings-payment |
|
| 61 | cy.contains('.sw-data-grid__cell-value', 'CredStick').click(); |
|
| 62 | ||
| 63 | // check settings-payment values |
|
| 64 | cy.get('.sw-payment-detail__save-action').should('be.disabled'); |
|
| 65 | }); |
|
| 66 | }); |
|
| 67 | ||
| 68 | it('@settings: can edit payment', () => { |
|
| 69 | cy.window().then((win) => { |
|
| 70 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 71 | return; |
|
| 72 | } |
|
| 73 | ||
| 74 | // Request we want to wait for later |
|
| 75 | cy.server(); |
|
| 76 | cy.route({ |
|
| 77 | url: '/api/v*/payment-method/*', |
|
| 78 | method: 'patch' |
|
| 79 | }).as('savePayment'); |
|
| 80 | ||
| 81 | const page = new ProductPageObject(); |
|
| 82 | ||
| 83 | cy.loginAsUserWithPermissions([ |
|
| 84 | { |
|
| 85 | key: 'payment', |
|
| 86 | role: 'viewer' |
|
| 87 | }, { |
|
| 88 | key: 'payment', |
|
| 89 | role: 'editor' |
|
| 90 | } |
|
| 91 | ]).then(() => { |
|
| 92 | cy.visit(`${Cypress.env('admin')}#/sw/settings/payment/index`); |
|
| 93 | }); |
|
| 94 | ||
| 95 | // open payment method |
|
| 96 | cy.contains('.sw-data-grid__cell-value', 'CredStick').click(); |
|
| 97 | cy.get('#sw-field--paymentMethod-description').type('My description'); |
|
| 98 | ||
| 99 | // Verify updated payment method |
|
| 100 | cy.get('.sw-payment-detail__save-action').should('not.be.disabled'); |
|
| 101 | cy.get('.sw-payment-detail__save-action').click(); |
|
| 102 | cy.wait('@savePayment').then((xhr) => { |
|
| 103 | expect(xhr).to.have.property('status', 204); |
|
| 104 | }); |
|
| 105 | ||
| 106 | cy.get(page.elements.smartBarBack).click(); |
|
| 107 | cy.get(`${page.elements.dataGridRow}--0 .sw-data-grid__cell--description`) |
|
| 108 | .contains('My description'); |
|
| 109 | ||
| 110 | }); |
|
| 111 | }); |
|
| 112 | ||
| 113 | it('@settings: can create payment', () => { |
|
| 114 | cy.window().then((win) => { |
|
| 115 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 116 | return; |
|
| 117 | } |
|
| 118 | ||
| 119 | // Request we want to wait for later |
|
| 120 | cy.server(); |
|
| 121 | cy.route({ |
|
| 122 | url: `${Cypress.env('apiPath')}/payment-method`, |
|
| 123 | method: 'post' |
|
| 124 | }).as('saveData'); |
|
| 125 | ||
| 126 | const page = new ProductPageObject(); |
|
| 127 | ||
| 128 | cy.loginAsUserWithPermissions([ |
|
| 129 | { |
|
| 130 | key: 'payment', |
|
| 131 | role: 'viewer' |
|
| 132 | }, { |
|
| 133 | key: 'payment', |
|
| 134 | role: 'editor' |
|
| 135 | }, { |
|
| 136 | key: 'payment', |
|
| 137 | role: 'creator' |
|
| 138 | } |
|
| 139 | ]).then(() => { |
|
| 140 | cy.visit(`${Cypress.env('admin')}#/sw/settings/payment/create`); |
|
| 141 | }); |
|
| 142 | ||
| 143 | // Add payment method |
|
| 144 | cy.get('#sw-field--paymentMethod-name').typeAndCheck('1 Coleur'); |
|
| 145 | cy.get('.sw-payment-detail__save-action').should('not.be.disabled'); |
|
| 146 | cy.get('.sw-payment-detail__save-action').click(); |
|
| 147 | ||
| 148 | // Verify payment method in listing |
|
| 149 | cy.wait('@saveData').then((xhr) => { |
|
| 150 | expect(xhr).to.have.property('status', 204); |
|
| 151 | }); |
|
| 152 | cy.get(page.elements.smartBarBack).click(); |
|
| 153 | cy.contains('.sw-data-grid__row', '1 Coleur'); |
|
| 154 | }); |
|
| 155 | }); |
|
| 156 | ||
| 157 | it('@settings: can delete settings-payment', () => { |
|
| 158 | cy.window().then((win) => { |
|
| 159 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 160 | return; |
|
| 161 | } |
|
| 162 | ||
| 163 | // Request we want to wait for later |
|
| 164 | cy.server(); |
|
| 165 | cy.route({ |
|
| 166 | url: '/api/v*/payment-method/*', |
|
| 167 | method: 'delete' |
|
| 168 | }).as('deleteData'); |
|
| 169 | ||
| 170 | const page = new ProductPageObject(); |
|
| 171 | ||
| 172 | cy.loginAsUserWithPermissions([ |
|
| 173 | { |
|
| 174 | key: 'payment', |
|
| 175 | role: 'viewer' |
|
| 176 | }, { |
|
| 177 | key: 'payment', |
|
| 178 | role: 'deleter' |
|
| 179 | } |
|
| 180 | ]).then(() => { |
|
| 181 | cy.visit(`${Cypress.env('admin')}#/sw/settings/payment/index`); |
|
| 182 | }); |
|
| 183 | ||
| 184 | // open settings-payment |
|
| 185 | cy.clickContextMenuItem( |
|
| 186 | `${page.elements.contextMenu}-item--danger`, |
|
| 187 | page.elements.contextMenuButton, |
|
| 188 | `${page.elements.dataGridRow}--0` |
|
| 189 | ); |
|
| 190 | cy.get(`${page.elements.modal} .sw-settings-payment-list__confirm-delete-text`) |
|
| 191 | .contains('Are you sure you want to delete the payment method'); |
|
| 192 | }); |
|
| 193 | }); |
|
| 194 | }); |
|
| 195 | ||
| @@ 3-157 (lines=155) @@ | ||
| 1 | /// <reference types="Cypress" /> |
|
| 2 | ||
| 3 | import ProductPageObject from '../../../support/pages/module/sw-product.page-object'; |
|
| 4 | ||
| 5 | describe('Review: Test ACL privileges', () => { |
|
| 6 | beforeEach(() => { |
|
| 7 | cy.setToInitialState() |
|
| 8 | .then(() => { |
|
| 9 | cy.loginViaApi(); |
|
| 10 | }) |
|
| 11 | .then(() => { |
|
| 12 | cy.createReviewFixture(); |
|
| 13 | }) |
|
| 14 | .then(() => { |
|
| 15 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/dashboard/index`); |
|
| 16 | }); |
|
| 17 | }); |
|
| 18 | ||
| 19 | it('@catalogue: has no access to review module', () => { |
|
| 20 | cy.window().then((win) => { |
|
| 21 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 22 | return; |
|
| 23 | } |
|
| 24 | ||
| 25 | cy.loginAsUserWithPermissions([ |
|
| 26 | { |
|
| 27 | key: 'product', |
|
| 28 | role: 'viewer' |
|
| 29 | } |
|
| 30 | ]).then(() => { |
|
| 31 | cy.openInitialPage(`${Cypress.env('admin')}#/sw/review/index`); |
|
| 32 | }); |
|
| 33 | ||
| 34 | // open review without permissions |
|
| 35 | cy.get('.sw-privilege-error__access-denied-image').should('be.visible'); |
|
| 36 | cy.get('h1').contains('Access denied'); |
|
| 37 | cy.get('.sw-review-list').should('not.exist'); |
|
| 38 | ||
| 39 | // see menu without review menu item |
|
| 40 | cy.get('.sw-admin-menu__item--sw-catalogue').click(); |
|
| 41 | cy.get('.sw-admin-menu__navigation-list-item.sw-review').should('not.exist'); |
|
| 42 | }); |
|
| 43 | }); |
|
| 44 | ||
| 45 | it('@catalogue: can view review', () => { |
|
| 46 | cy.window().then((win) => { |
|
| 47 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 48 | return; |
|
| 49 | } |
|
| 50 | ||
| 51 | const page = new ProductPageObject(); |
|
| 52 | ||
| 53 | cy.loginAsUserWithPermissions([ |
|
| 54 | { |
|
| 55 | key: 'review', |
|
| 56 | role: 'viewer' |
|
| 57 | } |
|
| 58 | ]).then(() => { |
|
| 59 | cy.visit(`${Cypress.env('admin')}#/sw/review/index`); |
|
| 60 | }); |
|
| 61 | ||
| 62 | // open review |
|
| 63 | cy.get(`${page.elements.dataGridRow}--0`) |
|
| 64 | .get('.sw-data-grid__cell--title') |
|
| 65 | .contains('Bestes Produkt') |
|
| 66 | .click(); |
|
| 67 | ||
| 68 | // check review values |
|
| 69 | cy.get('.sw-review-detail__save-action').should('be.disabled'); |
|
| 70 | }); |
|
| 71 | }); |
|
| 72 | ||
| 73 | it('@catalogue: can edit review', () => { |
|
| 74 | cy.window().then((win) => { |
|
| 75 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 76 | return; |
|
| 77 | } |
|
| 78 | ||
| 79 | // Request we want to wait for later |
|
| 80 | cy.server(); |
|
| 81 | cy.route({ |
|
| 82 | url: '/api/v*/product-review/*', |
|
| 83 | method: 'patch' |
|
| 84 | }).as('saveProperty'); |
|
| 85 | ||
| 86 | const page = new ProductPageObject(); |
|
| 87 | ||
| 88 | cy.loginAsUserWithPermissions([ |
|
| 89 | { |
|
| 90 | key: 'review', |
|
| 91 | role: 'viewer' |
|
| 92 | }, { |
|
| 93 | key: 'review', |
|
| 94 | role: 'editor' |
|
| 95 | } |
|
| 96 | ]).then(() => { |
|
| 97 | cy.visit(`${Cypress.env('admin')}#/sw/review/index`); |
|
| 98 | }); |
|
| 99 | ||
| 100 | // open review |
|
| 101 | cy.get(`${page.elements.dataGridRow}--0`) |
|
| 102 | .get('.sw-data-grid__cell--title') |
|
| 103 | .contains('Bestes Produkt') |
|
| 104 | .click(); |
|
| 105 | ||
| 106 | cy.get('#sw-field--review-comment').type('My description'); |
|
| 107 | ||
| 108 | // Verify updated review |
|
| 109 | cy.get('.sw-review-detail__save-action').should('not.be.disabled'); |
|
| 110 | cy.get('.sw-review-detail__save-action').click(); |
|
| 111 | cy.wait('@saveProperty').then((xhr) => { |
|
| 112 | expect(xhr).to.have.property('status', 204); |
|
| 113 | }); |
|
| 114 | }); |
|
| 115 | }); |
|
| 116 | ||
| 117 | it('@catalogue: can delete review', () => { |
|
| 118 | cy.window().then((win) => { |
|
| 119 | if (!win.Shopware.Feature.isActive('FEATURE_NEXT_3722')) { |
|
| 120 | return; |
|
| 121 | } |
|
| 122 | ||
| 123 | // Request we want to wait for later |
|
| 124 | cy.server(); |
|
| 125 | cy.route({ |
|
| 126 | url: '/api/v*/product-review/*', |
|
| 127 | method: 'delete' |
|
| 128 | }).as('deleteData'); |
|
| 129 | ||
| 130 | const page = new ProductPageObject(); |
|
| 131 | ||
| 132 | cy.loginAsUserWithPermissions([ |
|
| 133 | { |
|
| 134 | key: 'review', |
|
| 135 | role: 'viewer' |
|
| 136 | }, { |
|
| 137 | key: 'review', |
|
| 138 | role: 'deleter' |
|
| 139 | } |
|
| 140 | ]).then(() => { |
|
| 141 | cy.visit(`${Cypress.env('admin')}#/sw/review/index`); |
|
| 142 | }); |
|
| 143 | ||
| 144 | // open review |
|
| 145 | cy.clickContextMenuItem( |
|
| 146 | `${page.elements.contextMenu}-item--danger`, |
|
| 147 | page.elements.contextMenuButton, |
|
| 148 | `${page.elements.dataGridRow}--0` |
|
| 149 | ); |
|
| 150 | ||
| 151 | // Verify new options in listing |
|
| 152 | cy.wait('@deleteData').then((xhr) => { |
|
| 153 | expect(xhr).to.have.property('status', 204); |
|
| 154 | }); |
|
| 155 | }); |
|
| 156 | }); |
|
| 157 | }); |
|
| 158 | ||