mirror of
https://github.com/wahyd4/charts.git
synced 2026-08-09 05:06:29 +10:00
[bitnami/magento] Revisit tests (#11708)
Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com> Signed-off-by: Jose Antonio Carmona <jcarmona@vmware.com>
This commit is contained in:
@@ -10,9 +10,9 @@ before(() => {
|
||||
it('allows admin to add a product to the store', () => {
|
||||
cy.login();
|
||||
cy.get('#menu-magento-catalog-catalog').click();
|
||||
cy.get('.item-catalog-products').click();
|
||||
cy.contains('Products').click();
|
||||
cy.contains('Salable Quantity');
|
||||
cy.get('#add_new_product-button').click();
|
||||
cy.contains('Add Product').click();
|
||||
cy.fixture('products').then((product) => {
|
||||
cy.get('[name="product[name]"]').type(
|
||||
`${product.newProduct.productName}.${random}`
|
||||
@@ -25,9 +25,8 @@ it('allows admin to add a product to the store', () => {
|
||||
});
|
||||
cy.get('.product-image');
|
||||
cy.get('#save-button').click();
|
||||
cy.contains('You saved the product');
|
||||
cy.get('#menu-magento-catalog-catalog').click();
|
||||
cy.get('.item-catalog-products').click();
|
||||
cy.contains('Products').click();
|
||||
cy.fixture('products').then((product) => {
|
||||
cy.contains(`${product.newProduct.productName}.${random}`);
|
||||
});
|
||||
@@ -37,7 +36,7 @@ it('allows user to create a customer account', () => {
|
||||
cy.visit('/');
|
||||
cy.contains('Create an Account').click();
|
||||
cy.fixture('customers').then((customer) => {
|
||||
cy.get('.field-name-firstname').type(
|
||||
cy.get('#firstname').type(
|
||||
`${customer.newCustomer.firstName}.${random}`
|
||||
);
|
||||
cy.get('#lastname').type(`${customer.newCustomer.lastName}.${random}`);
|
||||
@@ -53,58 +52,3 @@ it('allows user to create a customer account', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('allows customer to subscribe to newsletter', () => {
|
||||
cy.visit('/');
|
||||
cy.fixture('customers').then((customer) => {
|
||||
cy.get('#newsletter').type(`${random}.${customer.newCustomer.email}`);
|
||||
});
|
||||
cy.contains('Subscribe').click();
|
||||
cy.contains('Thank you for your subscription.');
|
||||
cy.login();
|
||||
cy.get('#menu-magento-backend-marketing').click();
|
||||
cy.get('.item-newsletter-subscriber').click();
|
||||
cy.fixture('customers').then((customer) => {
|
||||
cy.contains(`${random}.${customer.newCustomer.email}`);
|
||||
});
|
||||
});
|
||||
|
||||
it('allows admin to add a discount', () => {
|
||||
cy.login();
|
||||
cy.get('#menu-magento-backend-marketing').click();
|
||||
cy.get('.item-promo-catalog').click();
|
||||
cy.get('#add').click({ force: true });
|
||||
cy.fixture('discounts').then((discount) => {
|
||||
cy.get('[name="name"]').type(`${discount.newDiscount.ruleName}.${random}`);
|
||||
cy.get('.admin__actions-switch-text').click({ force: true });
|
||||
cy.get('[class="admin__control-multiselect"]')
|
||||
.first()
|
||||
.select('Main Website');
|
||||
|
||||
cy.get('[class="admin__control-multiselect"]').last().select('General');
|
||||
cy.get('#save').click();
|
||||
cy.get('[name="discount_amount"]').type(discount.newDiscount.amount);
|
||||
cy.get('#save').click();
|
||||
});
|
||||
cy.contains('You saved the rule');
|
||||
cy.get('#apply_rules').click();
|
||||
cy.contains('Updated rules applied');
|
||||
});
|
||||
|
||||
it('allows admin to customize the home page', () => {
|
||||
cy.login();
|
||||
cy.get('#menu-magento-backend-content').click();
|
||||
cy.get('.item-cms-page').click();
|
||||
cy.get('.page-main-actions');
|
||||
cy.get('[data-role="grid-wrapper"]').within(() => {
|
||||
cy.contains('td', 'home').siblings().last().click();
|
||||
cy.get('[class="action-menu _active"]').within(() => {
|
||||
cy.contains('Edit').click({ force: true });
|
||||
});
|
||||
});
|
||||
cy.fixture('pages').then((page) => {
|
||||
cy.get('input[name="title"]').type(`${page.newPage.pageTitle}.${random}`, {
|
||||
force: true,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ Cypress.Commands.add(
|
||||
cy.visit('/admin');
|
||||
cy.get('#username').type(username);
|
||||
cy.get('#login').type(password);
|
||||
cy.get('.action-login').click();
|
||||
cy.contains('Sign in').click();
|
||||
cy.contains('.page-title', 'Dashboard');
|
||||
}
|
||||
);
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
export let random = (Math.random() + 1).toString(36).substring(7);
|
||||
|
||||
export let allowDataUsage = () => {
|
||||
cy.contains('Average Order');
|
||||
cy.get('body').then(($body) => {
|
||||
if ($body.find('[class="admin__fieldset"]').is(':visible')) {
|
||||
cy.contains('.action-primary', 'Allow').click({ force: true });
|
||||
|
||||
@@ -1,40 +1,11 @@
|
||||
command:
|
||||
user-id-test:
|
||||
exec: if [ "$(id -u)" -eq 0 ]; then exit 1; fi
|
||||
exit-status: 0
|
||||
stdout: []
|
||||
stderr: []
|
||||
magento-store-list:
|
||||
exec: magento store:list
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- "Default Store View"
|
||||
- "Admin"
|
||||
stderr: []
|
||||
timeout: 0
|
||||
magento-uri:
|
||||
exec: magento info:adminuri
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- {{ printf "%s" .Env.MAGENTO_ADMIN_URL_PREFIX }}
|
||||
stderr: []
|
||||
timeout: 0
|
||||
apache-running:
|
||||
exec: ps aux | grep apache
|
||||
exit-status: 0
|
||||
stdout:
|
||||
- /opt/bitnami/apache/bin/httpd
|
||||
stderr: []
|
||||
timeout: 0
|
||||
file:
|
||||
/opt/bitnami/magento:
|
||||
filetype: symlink
|
||||
linked-to: /bitnami/magento
|
||||
timeout: 10000
|
||||
file:
|
||||
/bitnami/magento:
|
||||
exists: true
|
||||
/bitnami/magento/setup/config/modules.config.php:
|
||||
filetype: file
|
||||
exists: true
|
||||
contains:
|
||||
- "Setup"
|
||||
- "Di"
|
||||
- "Router"
|
||||
filetype: directory
|
||||
mode: "2775"
|
||||
owner: root
|
||||
|
||||
Reference in New Issue
Block a user