-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SUPESC-871: Added test case to check if unnecessary requests was not …
…sent
- Loading branch information
1 parent
1dd04b4
commit df6330a
Showing
11 changed files
with
652 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
cypress/e2e/mp/marketplace-product-attributes/product-attribute-management.cy.ts
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 { container } from '@utils'; | ||
import { ProductManagementDynamicFixtures, ProductManagementStaticFixtures } from '@interfaces/mp'; | ||
import { ProductsPage } from '@pages/mp'; | ||
import { MerchantUserLoginScenario } from '@scenarios/mp'; | ||
|
||
(['b2b', 'b2c'].includes(Cypress.env('repositoryId')) ? describe.skip : describe)( | ||
'product attribute management', | ||
{ tags: ['@merchant-product-attributes'] }, | ||
(): void => { | ||
const productPage = container.get(ProductsPage); | ||
const merchantUserLoginScenario = container.get(MerchantUserLoginScenario); | ||
|
||
let dynamicFixtures: ProductManagementDynamicFixtures; | ||
let staticFixtures: ProductManagementStaticFixtures; | ||
|
||
before((): void => { | ||
({ dynamicFixtures, staticFixtures } = Cypress.env()); | ||
}); | ||
|
||
it('Additional requests should not be sent on adding attribute', (): void => { | ||
merchantUserLoginScenario.execute({ | ||
username: dynamicFixtures.merchantUser.username, | ||
password: staticFixtures.defaultPassword, | ||
}); | ||
|
||
productPage.visit(); | ||
productPage.getFirstTableRow().click(); | ||
cy.intercept('GET', '/product-merchant-portal-gui/update-product-abstract/table-data**').as('dataTable'); | ||
cy.intercept('GET', '/product-merchant-portal-gui/update-product-abstract').as('createAttribute'); | ||
|
||
cy.wait('@dataTable').then(() => { | ||
cy.get(productPage.getAttributesTableSelector()).scrollIntoView().should('be.visible').then(() => { | ||
productPage.getAddAttributeButton().click(); | ||
cy.get('@createAttribute.all').should('have.length', 0); | ||
}); | ||
}); | ||
}); | ||
} | ||
); |
192 changes: 192 additions & 0 deletions
192
...xtures/b2b-mp/mp/marketplace-product-attributes/dynamic-product-attribute-management.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,192 @@ | ||
{ | ||
"data": { | ||
"type": "dynamic-fixtures", | ||
"attributes": { | ||
"synchronize": true, | ||
"operations": [ | ||
{ | ||
"type": "transfer", | ||
"name": "LocaleTransfer", | ||
"key": "localeEN", | ||
"arguments": { "id_locale": 66, "locale_name": "en_US" } | ||
}, | ||
{ | ||
"type": "transfer", | ||
"name": "LocaleTransfer", | ||
"key": "localeDE", | ||
"arguments": { "id_locale": 46, "locale_name": "de_DE" } | ||
}, | ||
{ | ||
"type": "transfer", | ||
"name": "StoreTransfer", | ||
"key": "store", | ||
"arguments": { "id_store": 1, "name": "DE" } | ||
}, | ||
{ | ||
"type": "array-object", | ||
"key": "stores", | ||
"arguments": ["#store"] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveUser", | ||
"key": "merchantUser", | ||
"arguments": [{ "password": "change123" }] | ||
}, | ||
{ | ||
"type": "builder", | ||
"name": "MerchantProfileBuilder", | ||
"key": "merchantProfile" | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveMerchant", | ||
"key": "merchant", | ||
"arguments": [ | ||
{ | ||
"merchantProfile": "#merchantProfile", | ||
"isActive": true, | ||
"status": "approved", | ||
"storeRelation": { | ||
"idStores": ["#store.id_store"] | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveMerchantUserWithAclEntities", | ||
"arguments": ["#merchant", "#merchantUser"] | ||
}, | ||
{ | ||
"type": "builder", | ||
"name": "LocalizedAttributesBuilder", | ||
"key": "localizedAttribute1" | ||
}, | ||
{ | ||
"type": "builder", | ||
"name": "LocalizedAttributesBuilder", | ||
"key": "localizedAttribute2" | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveFullProduct", | ||
"key": "concreteProduct1", | ||
"arguments": [ | ||
{ | ||
"attributes": ["attribute1", "attribute2"] | ||
}, | ||
{ | ||
"idTaxSet": 1, | ||
"localizedAttributes": [ | ||
{ "locale": "#localeEN", "name": "#localizedAttribute1.name", "attributes": ["attribute1", "attribute2"] }, | ||
{ "locale": "#localeDE", "name": "#localizedAttribute1.name", "attributes": ["attribute1", "attribute2"] } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveFullProduct", | ||
"key": "concreteProduct2", | ||
"arguments": [ | ||
{ | ||
"attributes": ["attribute1", "attribute2"] | ||
}, | ||
{ | ||
"idTaxSet": 1, | ||
"localizedAttributes": [ | ||
{ "locale": "#localeEN", "name": "#localizedAttribute2.name", "attributes": ["attribute1", "attribute2"] }, | ||
{ "locale": "#localeDE", "name": "#localizedAttribute2.name", "attributes": ["attribute1", "attribute2"] } | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "transfer", | ||
"name": "ProductImageTransfer", | ||
"key": "productImage1", | ||
"arguments": { | ||
"externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", | ||
"externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" | ||
} | ||
}, | ||
{ | ||
"type": "transfer", | ||
"name": "ProductImageTransfer", | ||
"key": "productImage2", | ||
"arguments": { | ||
"externalUrlSmall": "https://images.icecat.biz/img/gallery_mediums/30691822_1486.jpg", | ||
"externalUrlLarge": "https://images.icecat.biz/img/gallery/30691822_1486.jpg" | ||
} | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveProductImageSet", | ||
"arguments": [ | ||
{ | ||
"name": "default", | ||
"idProduct": "#concreteProduct1.id_product_concrete", | ||
"idProductAbstract": "#concreteProduct1.fk_product_abstract", | ||
"productImages": ["#productImage1"] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveProductImageSet", | ||
"arguments": [ | ||
{ | ||
"name": "default", | ||
"idProduct": "#concreteProduct2.id_product_concrete", | ||
"idProductAbstract": "#concreteProduct2.fk_product_abstract", | ||
"productImages": ["#productImage2"] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "havePriceProduct", | ||
"arguments": [ | ||
{ | ||
"skuProductAbstract": "#concreteProduct1.abstract_sku", | ||
"skuProduct": "#concreteProduct1.sku", | ||
"moneyValue": { "netAmount": 30000, "grossAmount": 30000 } | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "havePriceProduct", | ||
"arguments": [ | ||
{ | ||
"skuProductAbstract": "#concreteProduct2.abstract_sku", | ||
"skuProduct": "#concreteProduct2.sku", | ||
"moneyValue": { "netAmount": 20000, "grossAmount": 20000 } | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveMerchantProduct", | ||
"arguments": [ | ||
{ | ||
"idMerchant": "#merchant.id_merchant", | ||
"idProductAbstract": "#concreteProduct1.fk_product_abstract" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "helper", | ||
"name": "haveMerchantProduct", | ||
"arguments": [ | ||
{ | ||
"idMerchant": "#merchant.id_merchant", | ||
"idProductAbstract": "#concreteProduct2.fk_product_abstract" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...ixtures/b2b-mp/mp/marketplace-product-attributes/static-product-attribute-management.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,3 @@ | ||
{ | ||
"defaultPassword": "change123" | ||
} |
Oops, something went wrong.