-
Notifications
You must be signed in to change notification settings - Fork 1
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
33 changed files
with
1,809 additions
and
10 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
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
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
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,17 @@ | ||
{ | ||
"viewportHeight": 1080, | ||
"viewportWidth": 1920, | ||
"baseUrl": "http://shopware-test_app_server_1:8000", | ||
"watchForFileChanges": false, | ||
"requestTimeout": 120000, | ||
"defaultCommandTimeout": 120000, | ||
"pageLoadTimeout": 120000, | ||
"salesChannelName": "Storefront", | ||
"video": false, | ||
"screenshotsFolder": "/tests/results", | ||
"reporter": "junit", | ||
"reporterOptions": { | ||
"mochaFile": "/tests/results/my-test-output-[hash].xml", | ||
"jenkinsMode": true | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/Resources/app/storefront/test/e2e_v2/cypress/fixtures/customers.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,50 @@ | ||
{ | ||
"male": { | ||
"firstName": "Testuser1", | ||
"lastName": "Male", | ||
"email": "[email protected]", | ||
"password": "shopware", | ||
"street": "abc street", | ||
"postal": "12345", | ||
"city": "Berlin", | ||
"country": 1, | ||
"gender": 3, | ||
"birthday": { | ||
"day": "1", | ||
"month": "1", | ||
"year": "1970" | ||
} | ||
}, | ||
"female": { | ||
"firstName": "Testuser2", | ||
"lastName": "Female", | ||
"email": "[email protected]", | ||
"password": "shopware", | ||
"street": "def street", | ||
"postal": "56789", | ||
"city": "Paris", | ||
"country": 12, | ||
"gender": 2, | ||
"birthday": { | ||
"day": "1", | ||
"month": "1", | ||
"year": "1970" | ||
} | ||
}, | ||
"unknown": { | ||
"firstName": "Testuser3", | ||
"lastName": "Unknown", | ||
"email": "[email protected]", | ||
"password": "shopware", | ||
"street": "hij street", | ||
"postal": "54321", | ||
"city": "London", | ||
"country": 2, | ||
"gender": 1, | ||
"birthday": { | ||
"day": "1", | ||
"month": "1", | ||
"year": "1970" | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
src/Resources/app/storefront/test/e2e_v2/cypress/fixtures/products.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,44 @@ | ||
{ | ||
"normal": { | ||
"title": "Mapp Test Product - Normäl", | ||
"productNumber": "mäppnormal", | ||
"price": "1000.99", | ||
"stock": "1000", | ||
"categories": ["mapp-subcategory"], | ||
"saleschannel": "Storefront" | ||
}, | ||
"soldout": { | ||
"title": "Mapp Test Product - Soldout", | ||
"productNumber": "mappsoldout", | ||
"price": "99.99", | ||
"stock": "0", | ||
"categories": ["mapp-subcategory"], | ||
"saleschannel": "Storefront" | ||
}, | ||
"variant": { | ||
"title": "Mapp Test Product - Variable", | ||
"productNumber": "mappvariable", | ||
"price": "999.99", | ||
"stock": "1000", | ||
"categories": [ | ||
"mapp-subcategory" | ||
], | ||
"saleschannel": "Storefront", | ||
"variants": { | ||
"searchTerms": [ | ||
{ | ||
"category": "color", | ||
"value": "azure" | ||
}, | ||
{ | ||
"category": "color", | ||
"value": "greenyellow" | ||
}, | ||
{ | ||
"category": "color", | ||
"value": "darkorange" | ||
} | ||
] | ||
} | ||
} | ||
} |
127 changes: 127 additions & 0 deletions
127
src/Resources/app/storefront/test/e2e_v2/cypress/integration/00_preparations.spec.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,127 @@ | ||
// / <reference types="Cypress" /> | ||
|
||
describe('MappIntelligencePluginTests: General preparations', () => { | ||
|
||
|
||
const getSalesChannelId = () => { | ||
return cy.callAdminApi('post', '/search/sales-channel', { | ||
"page":1,"limit":25,"term":"Storefront","total-count-mode":1, | ||
"associations": { | ||
"domains": { | ||
"associations": { | ||
"language": { | ||
"total-count-mode": 1 | ||
}, | ||
"snippetSet": { | ||
"total-count-mode": 1 | ||
}, | ||
"currency": { | ||
"total-count-mode": 1 | ||
} | ||
}, | ||
"total-count-mode": 1 | ||
} | ||
} | ||
}); | ||
} | ||
|
||
|
||
it('set Storefront URL', () => { | ||
getSalesChannelId().then(storefront => { | ||
console.log(storefront); | ||
const domainId =storefront.relationships.domains.data[0].id; | ||
|
||
cy.callAdminApi('patch', `/sales-channel/${storefront.id}`, { | ||
id: storefront.id, | ||
domains: [{ | ||
id: domainId, | ||
url: 'http://docker.vm:8000' | ||
}] | ||
}); | ||
|
||
}) | ||
}); | ||
|
||
it('create promotion and discount', () => { | ||
cy.createPromotion('MappCoupon', 'mapptest'); | ||
}); | ||
|
||
it('convert imprint to landingpage', () => { | ||
cy.callAdminApi('post', '/search/cms-page', { | ||
"page":1,"limit":25,"term":"Imprint","total-count-mode":1 | ||
}).then( imprint => { | ||
cy.callAdminApi('patch', `/cms-page/${imprint.id}`, { | ||
"type":"landingpage" | ||
}) | ||
}); | ||
}); | ||
|
||
it('create product categories', () => { | ||
cy.createCategory('MappTestProducts', '111aee2d4ef6484f99e541a03976d865'); | ||
cy.createSubCategory('MappSubCategory', 'MappTestProducts', '111aee2d4ef6484f99e541a03976d867'); | ||
}); | ||
|
||
it('create test landingpage', () => { | ||
let salesChannelId = ''; | ||
|
||
const getImprint = () => { | ||
return cy.callAdminApi('post', '/search/cms-page', { | ||
"page":1,"limit":25,"term":"Imprint","total-count-mode":1 | ||
}); | ||
} | ||
|
||
getSalesChannelId().then(storefront => { | ||
salesChannelId = storefront.id; | ||
}).then(() => { | ||
getImprint().then(imprint => { | ||
console.log(salesChannelId, imprint.id) | ||
cy.callAdminApi('post', '/landing-page', { | ||
"name":"Testlandingpage", | ||
"url":"mapp", | ||
"cmsPageId": imprint.id, | ||
"salesChannels":[ | ||
{ | ||
"id": salesChannelId | ||
} | ||
] | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
it('create test products', () => { | ||
|
||
cy.createProduct({name: 'MappIntelligence-product-äöü', id: '222aee2d4ef6484f99e541a03976d867', stock: 44, productNumber: "MAPP10001", | ||
price: [ | ||
{ | ||
gross: 495.95, | ||
linked: true, | ||
net: 490.95} | ||
]}, 'MappSubCategory').then(() => { | ||
cy.createProduct({name: 'MappIntelligence-product-soldout', id: '333aee2d4ef6484f99e541a03976d867', stock: 0, productNumber: "MAPP100013", | ||
price: [ | ||
{ | ||
gross: 1.99, | ||
linked: true, | ||
net: 1} | ||
]}, 'MappSubCategory').then(() => { | ||
cy.createProduct({name: 'MappIntelligence-Variant-product', id: '444aee2d4ef6484f99e541a03976d867', stock: 99, productNumber: "MAPPVAR", color1: "azure", color2: "aliceblue", | ||
price: [ | ||
{ | ||
gross: 295.95, | ||
linked: true, | ||
net: 290.95} | ||
]}, 'MappSubCategory').then(() => { | ||
cy.wait(10000); | ||
cy.visit('/MappIntelligence-product-aeoeue/MAPP10001', {timeout: 30000}); | ||
cy.contains('MappIntelligence-product-äöü').should('be.visible'); | ||
cy.visit('/MappIntelligence-Variant-product/MappIntelligence-Variant-product-azure', {timeout: 30000}); | ||
cy.contains('MappIntelligence-Variant-product').should('be.visible'); | ||
cy.visit('/MappIntelligence-product-soldout/MAPP100013', {timeout: 30000}); | ||
cy.contains('MappIntelligence-product-soldout').should('be.visible'); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
58 changes: 58 additions & 0 deletions
58
src/Resources/app/storefront/test/e2e_v2/cypress/integration/01_install-plugin.spec.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,58 @@ | ||
// / <reference types="Cypress" /> | ||
|
||
describe('MappIntelligencePluginTests: Install and Config', () => { | ||
|
||
it('configure, check _tiConfig, wts and blacklist', () => { | ||
cy.consentMapp(); | ||
let config; | ||
let data; | ||
|
||
cy.callAdminApi('post', '/_action/system-config/batch', { | ||
"null":{ | ||
"MappIntelligence.config.blacklist":"pageName,pageTitle", | ||
"MappIntelligence.config.consent":true, | ||
"MappIntelligence.config.required":false, | ||
"MappIntelligence.config.tiId":"136699033798929" | ||
} | ||
}).then( () => { | ||
cy.visit('/'); | ||
cy.window() | ||
.then((win) => { | ||
config = win._tiConfig; | ||
data = win._ti; | ||
return win; | ||
}) | ||
.then((win) => { | ||
expect(config.tiId).to.equal('136699033798929'); | ||
expect(win.wts).to.exist; | ||
expect(data).to.exist; | ||
expect(data.pageName).to.not.exist; | ||
expect(data.pageTitle).to.not.exist; | ||
}); | ||
}); | ||
}); | ||
|
||
it('deactivate blacklist', () => { | ||
cy.consentMapp(); | ||
let data; | ||
cy.callAdminApi('post', '/_action/system-config/batch', { | ||
"null":{ | ||
"MappIntelligence.config.blacklist":"", | ||
"MappIntelligence.config.consent":true, | ||
"MappIntelligence.config.required":false, | ||
"MappIntelligence.config.tiId":"136699033798929" | ||
} | ||
}).then( () => { | ||
cy.visit('/'); | ||
cy.window() | ||
.then((win) => { | ||
data = win._ti; | ||
}) | ||
.then(() => { | ||
expect(data).to.exist; | ||
expect(data.pageName).to.exist; | ||
expect(data.pageTitle).to.exist; | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.