[bitnami/prestashop] Revisit tests (#13778)

* [bitnami/prestashop] Revisit tests

Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>

* Remove unused fixtures

Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>

* Remove unused customer fixture

Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>

* Recover backup test

Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>

Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>
This commit is contained in:
Jose Antonio Carmona
2022-12-12 18:25:49 +01:00
committed by GitHub
parent cebc3a6058
commit 5374cd8405
10 changed files with 76 additions and 125 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{
"env": {
"username": "user",
"email": "user@example.com",
"username": "bitnamiTest",
"email": "bitnamiTest@example.com",
"password": "ComplicatedPassword123!4"
},
"hosts": {
@@ -9,11 +9,5 @@
"state": "California",
"zipcode": "94304"
}
},
"newCustomer": {
"firstName": "Maurice",
"lastName": "Canard",
"email": "lecanard@example.com",
"password": "Sup3rComplicated!"
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

@@ -1,6 +0,0 @@
{
"newProduct": {
"name": "Painting: Wiedergeboren",
"price": "13.0"
}
}
@@ -12,97 +12,36 @@ it('allows a user to place an order and an admin to list it', () => {
cy.visit('/order');
cy.fixture('customers').then((customers) => {
cy.get('form#customer-form').within(() => {
cy.get('input#field-id_gender-1').check();
cy.get('input#field-firstname').type(customers.shopper.firstName);
cy.get('input#field-lastname').type(customers.shopper.lastName);
cy.get('input#field-email').type(`${random}${customers.shopper.email}`);
cy.get('input[name="customer_privacy"]').check();
cy.get('input[name="psgdpr"]').check();
cy.get('#field-id_gender-1').check();
cy.get('#field-firstname').type(customers.shopper.firstName);
cy.get('#field-lastname').type(customers.shopper.lastName);
cy.get('#field-email').type(`${random}${customers.shopper.email}`);
cy.get('[name="customer_privacy"]').check();
cy.get('[name="psgdpr"]').check();
cy.contains('button', 'Continue').click();
});
cy.get('div.js-address-form').within(() => {
cy.get('input#field-address1').type(customers.shopper.address.street);
cy.get('input#field-city').type(customers.shopper.address.city);
cy.get('select#field-id_state').select(customers.shopper.address.state);
cy.get('input#field-postcode').type(customers.shopper.address.zipcode);
cy.get('#field-address1').type(customers.shopper.address.street);
cy.get('#field-city').type(customers.shopper.address.city);
cy.get('#field-id_state').select(customers.shopper.address.state);
cy.get('#field-postcode').type(customers.shopper.address.zipcode);
cy.contains('button', 'Continue').click();
});
cy.get('form#js-delivery').within(() => {
cy.contains('button', 'Continue').click();
});
cy.get('input#payment-option-1').click();
cy.get('input[id*="conditions_to_approve"]').click();
cy.get('#payment-option-1').click();
cy.get('[id*="conditions_to_approve"]').click();
cy.contains('button', 'Place order').click();
cy.contains('order is confirmed');
cy.login();
cy.contains('a[href*="sell/orders/?"]', 'Orders').click();
cy.contains('li#subtab-AdminOrders', 'Orders').click();
cy.get('#subtab-AdminOrders').click();
cy.get('td[class*="column-reference"]').first().click();
cy.contains(`${random}${customers.shopper.email}`);
});
});
it('allows registering a new product', () => {
cy.login();
cy.contains('[href*="catalog/products"]', 'Catalog').click();
cy.contains('[href*="catalog/products"]', 'Products').click();
cy.get('div.header-toolbar').within(() => {
cy.contains('[href*="catalog/products/new"]', 'New product').click();
});
cy.fixture('products').then((products) => {
cy.get('input[placeholder="Enter your product name"]').type(
`${products.newProduct.name} ${random}`
);
cy.get('input[type="file"][accept="image/*"]').selectFile(
'cypress/fixtures/images/product_image.png',
{ force: true }
);
cy.get('input#form_step1_price_shortcut').type(products.newProduct.price);
cy.contains('input#submit', 'Save').click();
cy.contains('Settings updated');
cy.contains('[href*="catalog/products"]', 'Products').click();
cy.contains(`${products.newProduct.name} ${random}`);
});
});
it('allows registering a new customer', () => {
cy.login();
cy.contains('[href*="sell/customers"]', 'Customers').click();
cy.contains('li#subtab-AdminCustomers', 'Customers').click();
cy.get('div.header-toolbar').within(() => {
cy.contains('[href*="customers/new"]', 'Add new customer').click();
});
cy.fixture('customers').then((customers) => {
cy.get('input#customer_first_name').type(customers.newCustomer.firstName);
cy.get('input#customer_last_name').type(customers.newCustomer.lastName);
cy.get('input#customer_email').type(
`${random}.${customers.newCustomer.email}`
);
cy.get('input#customer_password').type(customers.newCustomer.password);
cy.get('button#save-button').click();
cy.contains('Successful creation');
cy.contains(`${random}.${customers.newCustomer.email}`);
});
cy.clearCookies();
cy.clearLocalStorage();
});
it('has payments activated', () => {
cy.login();
cy.contains('[href*="payment/payment_methods"]', 'Payment').click();
cy.contains('[href*="payment/payment_methods"]', 'Payment Methods').click();
const DEFAULT_ACTIVE_PAY_METHODS = ['Bank transfer', 'Payments by check'];
cy.contains('div.card', 'Active payment').within(() => {
DEFAULT_ACTIVE_PAY_METHODS.forEach((method) => {
cy.contains(method);
});
});
});
it('allows performing backups', () => {
cy.login();
cy.contains(
@@ -26,18 +26,10 @@ Cypress.Commands.add(
'login',
(email = Cypress.env('email'), password = Cypress.env('password')) => {
cy.visit('/administration/index.php');
cy.get('input#email').type(email);
cy.get('input#passwd').type(password);
cy.get('button#submit_login').click();
cy.get('div#error').should('not.exist');
cy.get('#email').type(email);
cy.get('#passwd').type(password);
cy.get('#submit_login').click();
cy.contains('Dashboard');
cy.get('body').then(($body) => {
if (
$body.find('button[class*="onboarding-button-shut-down"]').length > 0
) {
cy.get('button[class*="onboarding-button-shut-down"]').click();
}
});
}
);
+33 -22
View File
@@ -1,33 +1,44 @@
http:
http://localhost:{{ .Vars.containerPorts.http }}:
status: 302
no-follow-redirects: true
https://localhost:{{ .Vars.containerPorts.https }}:
status: 302
allow-insecure: true
no-follow-redirects: true
command:
apcu-caching-support:
exec: /opt/bitnami/php/bin/php -i | grep --quiet apcu
exit-status: 0
stdout: [ ]
stderr: [ ]
timeout: 40000
prestashop-version-ok:
exec: cat /opt/bitnami/prestashop/app/AppKernel.php | grep --quiet $(echo $APP_VERSION | tr "-" ".")
exit-status: 0
stdout: [ ]
stderr: [ ]
timeout: 40000
prestashop-cli-list-commands:
exec: /opt/bitnami/php/bin/php /opt/bitnami/prestashop/bin/console prestashop:list:commands-and-queries
exec: /opt/bitnami/php/bin/php /opt/bitnami/prestashop/bin/console prestashop:config get PS_COOKIE_CHECKIP
exit-status: 0
stdout:
- "Class:"
- "Type:"
stderr: [ ]
timeout: 40000
- /PS_COOKIE_CHECKIP={{ (eq .Vars.prestashopCookieCheckIP "yes") | int }}/
check-user-info:
exec: id
exit-status: 0
stdout:
- uid={{ .Vars.containerSecurityContext.runAsUser }}
- /groups=.*{{ .Vars.podSecurityContext.fsGroup }}/
file:
/opt/bitnami/prestashop:
filetype: symlink
linked-to: /bitnami/prestashop
/etc/hosts:
exists: true
filetype: file
contains:
{{ range .Vars.hostAliases }}
{{ $ip := .ip }}
{{ range $host := .hostnames }}
- /{{ $ip }}.*{{ $host }}/
{{ end }}
{{ end }}
/bitnami/prestashop:
exists: true
filetype: directory
mode: '2775'
owner: root
/opt/bitnami/prestashop/app/config/parameters.php:
mode: "0644"
filetype: file
exists: true
contains:
- {{ printf "/database_name.*%s/" .Env.PRESTASHOP_DATABASE_NAME }}
- {{ printf "/database_user.*%s/" .Env.PRESTASHOP_DATABASE_USER }}
- /database_name.*{{ .Vars.mariadb.auth.database }}/
- /database_user.*{{ .Vars.mariadb.auth.username }}/
- /database_password.*{{ .Vars.mariadb.auth.password }}/
+17
View File
@@ -0,0 +1,17 @@
hostAliases:
- ip: "127.0.0.1"
hostnames:
- "status.localhost"
prestashopCookieCheckIP: "no"
containerPorts:
http: 8081
https: 8444
podSecurityContext:
fsGroup: 1002
containerSecurityContext:
runAsUser: 1002
mariadb:
auth:
database: bitnami_test_prestashop
username: bn_test_prestashop
password: bitnami_test_prestashop
+4 -2
View File
@@ -22,7 +22,7 @@
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/prestashop"
},
"runtime_parameters": "cHJlc3Rhc2hvcFVzZXJuYW1lOiB1c2VyCnByZXN0YXNob3BFbWFpbDogdXNlckBleGFtcGxlLmNvbQpwcmVzdGFzaG9wUGFzc3dvcmQ6IENvbXBsaWNhdGVkUGFzc3dvcmQxMjMhNApwcmVzdGFzaG9wSG9zdDogdm13YXJlLXByZXN0YXNob3AubXkKc2VydmljZToKICB0eXBlOiBMb2FkQmFsYW5jZXIKICBwb3J0czoKICAgIGh0dHA6IDgwCg==",
"runtime_parameters": "aG9zdEFsaWFzZXM6CiAgLSBpcDogIjEyNy4wLjAuMSIKICAgIGhvc3RuYW1lczoKICAgICAgLSAic3RhdHVzLmxvY2FsaG9zdCIKcHJlc3Rhc2hvcFNraXBJbnN0YWxsOiBmYWxzZQpwcmVzdGFzaG9wSG9zdDogdm13YXJlLXByZXN0YXNob3AubXkKcHJlc3Rhc2hvcFVzZXJuYW1lOiBiaXRuYW1pVGVzdApwcmVzdGFzaG9wRW1haWw6IGJpdG5hbWlUZXN0QGV4YW1wbGUuY29tCnByZXN0YXNob3BQYXNzd29yZDogQ29tcGxpY2F0ZWRQYXNzd29yZDEyMyE0CnByZXN0YXNob3BDb29raWVDaGVja0lQOiAibm8iCmNvbnRhaW5lclBvcnRzOgogIGh0dHA6IDgwODEKICBodHRwczogODQ0NApwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKc2VydmljZToKICB0eXBlOiBMb2FkQmFsYW5jZXIKICBwb3J0czoKICAgIGh0dHA6IDgwCm1hcmlhZGI6CiAgZW5hYmxlZDogdHJ1ZQogIGF1dGg6CiAgICBkYXRhYmFzZTogYml0bmFtaV90ZXN0X3ByZXN0YXNob3AKICAgIHVzZXJuYW1lOiBibl90ZXN0X3ByZXN0YXNob3AKICAgIHBhc3N3b3JkOiBiaXRuYW1pX3Rlc3RfcHJlc3Rhc2hvcA==",
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
@@ -44,6 +44,7 @@
"resources": {
"path": "/.vib/prestashop/goss"
},
"vars_file": "vars.yaml",
"remote": {
"workload": "deploy-prestashop"
}
@@ -58,7 +59,8 @@
"endpoint": "lb-prestashop-http",
"app_protocol": "HTTP",
"env": {
"username": "user",
"username": "bitnamiTest",
"email": "bitnamiTest@example.com",
"password": "ComplicatedPassword123!4"
}
}
+4 -2
View File
@@ -22,7 +22,7 @@
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/prestashop"
},
"runtime_parameters": "cHJlc3Rhc2hvcFVzZXJuYW1lOiB1c2VyCnByZXN0YXNob3BFbWFpbDogdXNlckBleGFtcGxlLmNvbQpwcmVzdGFzaG9wUGFzc3dvcmQ6IENvbXBsaWNhdGVkUGFzc3dvcmQxMjMhNApwcmVzdGFzaG9wSG9zdDogdm13YXJlLXByZXN0YXNob3AubXkKc2VydmljZToKICB0eXBlOiBMb2FkQmFsYW5jZXIKICBwb3J0czoKICAgIGh0dHA6IDgwCg==",
"runtime_parameters": "aG9zdEFsaWFzZXM6CiAgLSBpcDogIjEyNy4wLjAuMSIKICAgIGhvc3RuYW1lczoKICAgICAgLSAic3RhdHVzLmxvY2FsaG9zdCIKcHJlc3Rhc2hvcFNraXBJbnN0YWxsOiBmYWxzZQpwcmVzdGFzaG9wSG9zdDogdm13YXJlLXByZXN0YXNob3AubXkKcHJlc3Rhc2hvcFVzZXJuYW1lOiBiaXRuYW1pVGVzdApwcmVzdGFzaG9wRW1haWw6IGJpdG5hbWlUZXN0QGV4YW1wbGUuY29tCnByZXN0YXNob3BQYXNzd29yZDogQ29tcGxpY2F0ZWRQYXNzd29yZDEyMyE0CnByZXN0YXNob3BDb29raWVDaGVja0lQOiAibm8iCmNvbnRhaW5lclBvcnRzOgogIGh0dHA6IDgwODEKICBodHRwczogODQ0NApwb2RTZWN1cml0eUNvbnRleHQ6CiAgZW5hYmxlZDogdHJ1ZQogIGZzR3JvdXA6IDEwMDIKY29udGFpbmVyU2VjdXJpdHlDb250ZXh0OgogIGVuYWJsZWQ6IHRydWUKICBydW5Bc1VzZXI6IDEwMDIKc2VydmljZToKICB0eXBlOiBMb2FkQmFsYW5jZXIKICBwb3J0czoKICAgIGh0dHA6IDgwCm1hcmlhZGI6CiAgZW5hYmxlZDogdHJ1ZQogIGF1dGg6CiAgICBkYXRhYmFzZTogYml0bmFtaV90ZXN0X3ByZXN0YXNob3AKICAgIHVzZXJuYW1lOiBibl90ZXN0X3ByZXN0YXNob3AKICAgIHBhc3N3b3JkOiBiaXRuYW1pX3Rlc3RfcHJlc3Rhc2hvcA==",
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
@@ -44,6 +44,7 @@
"resources": {
"path": "/.vib/prestashop/goss"
},
"vars_file": "vars.yaml",
"remote": {
"workload": "deploy-prestashop"
}
@@ -58,7 +59,8 @@
"endpoint": "lb-prestashop-http",
"app_protocol": "HTTP",
"env": {
"username": "user",
"username": "bitnamiTest",
"email": "bitnamiTest@example.com",
"password": "ComplicatedPassword123!4"
}
}