diff --git a/app/design/adminhtml/default/default/template/newsletter/template/list.phtml b/app/design/adminhtml/default/default/template/newsletter/template/list.phtml index 3c191552fca..2188a5d31bb 100644 --- a/app/design/adminhtml/default/default/template/newsletter/template/list.phtml +++ b/app/design/adminhtml/default/default/template/newsletter/template/list.phtml @@ -13,7 +13,8 @@

getHeaderText() ?>

- + __('Add New Template'); ?> + diff --git a/cypress/e2e/openmage/backend/catalog/categories.cy.js b/cypress/e2e/openmage/backend/catalog/categories.cy.js index ea55f3629f2..11bc15e95b3 100644 --- a/cypress/e2e/openmage/backend/catalog/categories.cy.js +++ b/cypress/e2e/openmage/backend/catalog/categories.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.catalog.categories; +const test = cy.testBackendCatalogProductsCategories.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/catalog/products.cy.js b/cypress/e2e/openmage/backend/catalog/products.cy.js index da6b3152778..3cb9896d016 100644 --- a/cypress/e2e/openmage/backend/catalog/products.cy.js +++ b/cypress/e2e/openmage/backend/catalog/products.cy.js @@ -1,13 +1,25 @@ -const route = cy.testRoutes.backend.catalog.products; +const test = cy.testBackendCatalogProducts.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', '905'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); }); it(`tests filter options`, () => { @@ -17,4 +29,4 @@ describe(`Checks admin system "${route.h3}"`, () => { cy.log('Checking for the number of filter visibility options'); cy.get('#productGrid_product_filter_visibility option').should('have.length', 5); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/catalog/search.cy.js b/cypress/e2e/openmage/backend/catalog/search.cy.js index b0714d2dd5d..70eca7227ab 100644 --- a/cypress/e2e/openmage/backend/catalog/search.cy.js +++ b/cypress/e2e/openmage/backend/catalog/search.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.catalog.search; +const test = cy.testBackendCatalogSearch.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'classic'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index f1117f4ff01..2e0221456cf 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.catalog.sitemap; +const test = cy.testBackendCatalogSitemap.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + // TODO: There is no edit route for sitemaps + validation.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js index aa75e93b615..16b24a3eb46 100644 --- a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js +++ b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.catalog.urlrewrite; +const test = cy.testBackendUrlrewrite.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', '116238'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/cms/block.cy.js b/cypress/e2e/openmage/backend/cms/block.cy.js index 4d957ad176a..bf130244b4b 100644 --- a/cypress/e2e/openmage/backend/cms/block.cy.js +++ b/cypress/e2e/openmage/backend/cms/block.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.cms.block; +const test = cy.testBackendCmsBlock.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'category-landingpage-home'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/cms/page.cy.js b/cypress/e2e/openmage/backend/cms/page.cy.js index c0f43f81f0f..b0dcd082d4d 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -1,12 +1,69 @@ -const route = cy.testRoutes.backend.cms.page; +const test = cy.testBackendCmsPage.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + test.index.clickGridRow(); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + test.index.clickAdd(); + validation.pageElements(test, test.new); + }); + + it('tests to disable a CMS page that is used in config', () => { + test.index.clickGridRow(); + + test.edit.disablePage(); + test.edit.clickSaveAndContinue(); + + validation.hasWarningMessage('Cannot disable page, it is used in configuration'); + validation.hasSuccessMessage('The page has been saved.'); + + cy.get('#messages').screenshot('error-disable-active-page', { overwrite: true, padding: 10 }); + }); + + it('tests to delete a CMS page that is used in config', () => { + test.index.clickGridRow(); + test.edit.clickDelete(); + + validation.hasErrorMessage('Cannot delete page'); + + cy.get('#messages').screenshot('error-delete-active-page', { overwrite: true, padding: 10 }); + }); + + it('tests to add a CMS page', () => { + test.index.clickAdd(); + test.edit.clickSaveAndContinue(); + + // @todo add validation for required fields + }); + + it('tests to unassign a CMS page that is used in config', () => { + test.index.clickGridRow(); + + //cy.log('Assign another store to the CMS page'); + //cy.get(test.edit.__fields.page_store_id.selector) + // .select(4); + + //test.edit.clickSaveAndContinue(); + + // @todo: fix needed - this test passes because of a Magento bug + //validation.hasSuccessMessage('The page has been saved.'); + + test.edit.resetStores(); + test.edit.clickSaveAndContinue(); + + validation.hasSuccessMessage('The page has been saved.'); }); }); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/cms/widget.cy.js b/cypress/e2e/openmage/backend/cms/widget.cy.js index 57328d77c5f..1897d469446 100644 --- a/cypress/e2e/openmage/backend/cms/widget.cy.js +++ b/cypress/e2e/openmage/backend/cms/widget.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.cms.widget; +const test = cy.testBackendCmsWidget.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'Couponing Block'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/customer/customer.cy.js b/cypress/e2e/openmage/backend/customer/customer.cy.js new file mode 100644 index 00000000000..3c280606faf --- /dev/null +++ b/cypress/e2e/openmage/backend/customer/customer.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendCustomerCustomer.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', '424-555-0000'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/customer/group.cy.js b/cypress/e2e/openmage/backend/customer/group.cy.js deleted file mode 100644 index 4e86668e508..00000000000 --- a/cypress/e2e/openmage/backend/customer/group.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -const route = cy.testRoutes.backend.customers.groups; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js new file mode 100644 index 00000000000..8605cd5cef2 --- /dev/null +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendCustomerGroups.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'General'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/customer/manage.cy.js b/cypress/e2e/openmage/backend/customer/manage.cy.js deleted file mode 100644 index c3a235895a8..00000000000 --- a/cypress/e2e/openmage/backend/customer/manage.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -const route = cy.testRoutes.backend.customers.manage; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/customer/online.cy.js b/cypress/e2e/openmage/backend/customer/online.cy.js index f7de43c12b0..83127bec161 100644 --- a/cypress/e2e/openmage/backend/customer/online.cy.js +++ b/cypress/e2e/openmage/backend/customer/online.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.customers.online; +const test = cy.testBackendCustomerOnline.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/dashboard.cy.js b/cypress/e2e/openmage/backend/dashboard.cy.js new file mode 100644 index 00000000000..aa75fb0ebfc --- /dev/null +++ b/cypress/e2e/openmage/backend/dashboard.cy.js @@ -0,0 +1,13 @@ +const test = cy.testBackendDashboard.config; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); +}); diff --git a/cypress/e2e/openmage/backend/newsletter/queue.cy.js b/cypress/e2e/openmage/backend/newsletter/queue.cy.js index 51b1158261c..abd17e49f15 100644 --- a/cypress/e2e/openmage/backend/newsletter/queue.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/queue.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.newsletter.queue; +const test = cy.testBackendNewsletterQueue.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/newsletter/report.cy.js b/cypress/e2e/openmage/backend/newsletter/report.cy.js index 6b5f6db4fe3..5b12b2c56ff 100644 --- a/cypress/e2e/openmage/backend/newsletter/report.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/report.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.newsletter.report; +const test = cy.testBackendNewsletterReport.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js index cf915f44e02..3784b28fc50 100644 --- a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.newsletter.subscriber; +const test = cy.testBackendNewsletterSubscriber.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/newsletter/templates.cy.js b/cypress/e2e/openmage/backend/newsletter/templates.cy.js index 90c81014432..2e88208753d 100644 --- a/cypress/e2e/openmage/backend/newsletter/templates.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/templates.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.newsletter.templates; +const test = cy.testBackendNewsletterTemplates.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'Example'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/promo/cart.cy.js b/cypress/e2e/openmage/backend/promo/cart.cy.js deleted file mode 100644 index 770a92dd59b..00000000000 --- a/cypress/e2e/openmage/backend/promo/cart.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -const route = cy.testRoutes.backend.promo.cart; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/promo/catalog.cy.js b/cypress/e2e/openmage/backend/promo/catalog.cy.js index c5c9e498fb3..1ce59e28ddd 100644 --- a/cypress/e2e/openmage/backend/promo/catalog.cy.js +++ b/cypress/e2e/openmage/backend/promo/catalog.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.promo.catalog; +const test = cy.testBackendPromoCatalog.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', 'Candle'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/promo/quote.cy.js b/cypress/e2e/openmage/backend/promo/quote.cy.js new file mode 100644 index 00000000000..96f166abfb4 --- /dev/null +++ b/cypress/e2e/openmage/backend/promo/quote.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendPromoQuote.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickContains(test.index._grid, 'td', '$500'); + validation.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js index ac5f9608cc1..ae56203f3c9 100644 --- a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js +++ b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js @@ -1,12 +1,19 @@ -const route = cy.testRoutes.backend.sales.creditmemo; +const test = cy.testBackendSalesCreditmemo.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickContains(test.index._grid, 'td', '100000007'); + validation.pageElements(test, test.view); + }); +}); diff --git a/cypress/e2e/openmage/backend/sales/invoice.cy.js b/cypress/e2e/openmage/backend/sales/invoice.cy.js index bb12260d139..618b38e58cf 100644 --- a/cypress/e2e/openmage/backend/sales/invoice.cy.js +++ b/cypress/e2e/openmage/backend/sales/invoice.cy.js @@ -1,12 +1,19 @@ -const route = cy.testRoutes.backend.sales.invoice; +const test = cy.testBackendSalesInvoice.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickContains(test.index._grid, 'td', '100000040'); + validation.pageElements(test, test.view); + }); +}); diff --git a/cypress/e2e/openmage/backend/sales/order.cy.js b/cypress/e2e/openmage/backend/sales/order.cy.js index e0d9b46050b..37f74538892 100644 --- a/cypress/e2e/openmage/backend/sales/order.cy.js +++ b/cypress/e2e/openmage/backend/sales/order.cy.js @@ -1,12 +1,19 @@ -const route = cy.testRoutes.backend.sales.order; +const test = cy.testBackendSalesOrder.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickContains(test.index._grid, 'td', '145000004'); + validation.pageElements(test, test.view); + }); +}); diff --git a/cypress/e2e/openmage/backend/sales/shipment.cy.js b/cypress/e2e/openmage/backend/sales/shipment.cy.js index 09ab46db2fb..668a86c53bc 100644 --- a/cypress/e2e/openmage/backend/sales/shipment.cy.js +++ b/cypress/e2e/openmage/backend/sales/shipment.cy.js @@ -1,12 +1,19 @@ -const route = cy.testRoutes.backend.sales.shipment; +const test = cy.testBackendSalesOrderShipment.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickContains(test.index._grid, 'td', '100000032'); + validation.pageElements(test, test.view); + }); +}); diff --git a/cypress/e2e/openmage/backend/sales/transactions.cy.js b/cypress/e2e/openmage/backend/sales/transactions.cy.js index 88cc54d3bc2..b1e622c6581 100644 --- a/cypress/e2e/openmage/backend/sales/transactions.cy.js +++ b/cypress/e2e/openmage/backend/sales/transactions.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.sales.transactions; +const test = cy.testBackendSalesTransactions.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/system/cache.cy.js b/cypress/e2e/openmage/backend/system/cache.cy.js index ec5b35e06c9..2efa1685cb3 100644 --- a/cypress/e2e/openmage/backend/system/cache.cy.js +++ b/cypress/e2e/openmage/backend/system/cache.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.system.cache; +const test = cy.testBackendSystemCache.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/system/config/catalog/configswatches.cy.js b/cypress/e2e/openmage/backend/system/config/catalog/configswatches.cy.js index cbe6ad2644e..3b5fddab017 100644 --- a/cypress/e2e/openmage/backend/system/config/catalog/configswatches.cy.js +++ b/cypress/e2e/openmage/backend/system/config/catalog/configswatches.cy.js @@ -1,4 +1,4 @@ -const route = cy.testRoutes.backend.system.config.catalog.configswatches; +const test = cy.testBackendSystemConfig.config.catalog.configswatches; const validate = { dimension: { _input: { @@ -18,10 +18,10 @@ const validate = { } } -describe(`Checks admin system "${route.h3}" settings`, () => { +describe(`Checks admin system "${test.h3}" settings`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGetConfiguration(route); + cy.adminGetConfiguration(test); }); it(`tests non-digit dimensions`, () => { diff --git a/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js index c43ceefe257..8c041f5aaaf 100644 --- a/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js @@ -1,30 +1,31 @@ -const route = cy.testRoutes.backend.system.config.catalog.sitemap; -const saveButton = cy.testRoutes.backend.system.config._buttonSave; +const test = cy.testBackendSystemConfig.config.catalog.sitemap; +const saveButton = cy.testBackendSystemConfig.config._buttonSave; +const tools = cy.openmage.tools; const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}" settings`, () => { +describe(`Checks admin system "${test.h3}" settings`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGetConfiguration(route); + cy.adminGetConfiguration(test); }); - const priority = route.__validation.priority._input; + const priority = test.__validation.priority._input; it(`tests invalid string priority`, () => { validation.fillFields(priority, validation.number, validation.test.string); - validation.saveAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.number); }); it(`tests invalid number priority`, () => { validation.fillFields(priority, validation.numberRange, validation.test.numberGreater1); - validation.saveAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.numberRange); }); it(`tests empty priority`, () => { validation.fillFields(priority, validation.requiredEntry); - validation.saveAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.requiredEntry); }); @@ -32,7 +33,7 @@ describe(`Checks admin system "${route.h3}" settings`, () => { const error = 'An error occurred while saving this configuration: The priority must be between 0 and 1.'; validation.fillFields(priority, validation.requiredEntry); validation.removeClasses(priority); - validation.saveAction(saveButton); - cy.get(cy.openmage.validation._errorMessage).should('include.text', error); + tools.click(saveButton); + validation.hasErrorMessage(error); }); }); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js b/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js index eaa11dfb4a4..39aefee6f52 100644 --- a/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js +++ b/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js @@ -1,15 +1,16 @@ -const route = cy.testRoutes.backend.system.config.customers.promo; -const saveButton = cy.testRoutes.backend.system.config._buttonSave; +const test = cy.testBackendSystemConfig.config.customers.promo; +const saveButton = cy.testBackendSystemConfig.config._buttonSave; +const tools = cy.openmage.tools; const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}" settings`, () => { +describe(`Checks admin system "${test.h3}" settings`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGetConfiguration(route); + cy.adminGetConfiguration(test); }); it(`tests invalid string input`, () => { - const fieldset = route.__validation.__groups.couponCodes; + const fieldset = test.__validation.__groups.couponCodes; cy.get('body').then($body => { if (!$body.find(fieldset._id).hasClass('open')) { cy.get(fieldset._id).click({force: true}); @@ -19,7 +20,7 @@ describe(`Checks admin system "${route.h3}" settings`, () => { const fields = fieldset._input; const validate = validation.digits; validation.fillFields(fields, validate, validation.test.string); - validation.saveAction(saveButton); + tools.click(saveButton); validation.validateFields(fields, validate); }); }); diff --git a/cypress/e2e/openmage/backend/system/currency.cy.js b/cypress/e2e/openmage/backend/system/currency.cy.js new file mode 100644 index 00000000000..79df868ee4a --- /dev/null +++ b/cypress/e2e/openmage/backend/system/currency.cy.js @@ -0,0 +1,39 @@ +const test = cy.testBackendSystemCurrencyRates.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + const warning = 'Invalid input data for USD => EUR rate'; + const success = 'All valid rates have been saved.'; + + it(`tests empty currency`, () => { + cy.get('body').then($body => { + if ($body.find(test.index.__validation._input.from).length > 0) { + cy.get(test.index.__validation._input.from).clear(); + tools.click(test.index.__buttons.save); + validation.hasWarningMessage(warning); + validation.hasSuccessMessage(success); + } + }); + }); + + it(`tests string currency`, () => { + cy.get('body').then($body => { + if ($body.find(test.index.__validation._input.from).length > 0) { + cy.get(test.index.__validation._input.from).clear().type('abc'); + tools.click(test.index.__buttons.save); + validation.hasWarningMessage(warning); + validation.hasSuccessMessage(success); + } + }); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index ac61162fba7..5442400285c 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.system.design; +const test = cy.testBackendSystemDesign.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + // TODO: There is no edit route for design updates + validation.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 3706aabab33..3d75fea9d0b 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.system.email; +const test = cy.testBackendSystemEmailTemplate.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + // TODO: There is no edit route for email templates + validation.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/indexer.cy.js b/cypress/e2e/openmage/backend/system/indexer.cy.js new file mode 100644 index 00000000000..ab22b3ca9fc --- /dev/null +++ b/cypress/e2e/openmage/backend/system/indexer.cy.js @@ -0,0 +1,13 @@ +const test = cy.testBackendSystemIndex.config; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/indexes.cy.js b/cypress/e2e/openmage/backend/system/indexes.cy.js deleted file mode 100644 index b79338afa83..00000000000 --- a/cypress/e2e/openmage/backend/system/indexes.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -const route = cy.testRoutes.backend.system.indexes; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/system/manage-currency.cy.js b/cypress/e2e/openmage/backend/system/manage-currency.cy.js deleted file mode 100644 index 8f57d0c6c27..00000000000 --- a/cypress/e2e/openmage/backend/system/manage-currency.cy.js +++ /dev/null @@ -1,38 +0,0 @@ -const route = cy.testRoutes.backend.system.manage_curreny; -const validation = cy.openmage.validation; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); - - const warning = 'Invalid input data for USD => EUR rate'; - const success = 'All valid rates have been saved.'; - - it(`tests empty currency`, () => { - cy.get('body').then($body => { - if ($body.find(route.__validation._input.from).length > 0) { - cy.get(route.__validation._input.from).clear(); - validation.saveAction(route._buttonSave); - cy.get(validation._warningMessage).should('include.text', warning); - cy.get(validation._successMessage).should('include.text', success); - } - }); - }); - - it(`tests string currency`, () => { - cy.get('body').then($body => { - if ($body.find(route.__validation._input.from).length > 0) { - cy.get(route.__validation._input.from).clear().type('abc'); - validation.saveAction(route._buttonSave); - cy.get(validation._warningMessage).should('include.text', warning); - cy.get(validation._successMessage).should('include.text', success); - } - }); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/system/my-account.cy.js b/cypress/e2e/openmage/backend/system/my-account.cy.js new file mode 100644 index 00000000000..8525019629c --- /dev/null +++ b/cypress/e2e/openmage/backend/system/my-account.cy.js @@ -0,0 +1,21 @@ +const test = cy.testBackendSystemMyAccount.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); + + it(`tests empty input`, () => { + const validate = validation.requiredEntry; + validation.fillFields(test.index.__validation._input, validate); + tools.click(test.index.__buttons.save); + validation.validateFields(test.index.__validation._input, validate); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/myacount.cy.js b/cypress/e2e/openmage/backend/system/myacount.cy.js deleted file mode 100644 index 00488494fdf..00000000000 --- a/cypress/e2e/openmage/backend/system/myacount.cy.js +++ /dev/null @@ -1,20 +0,0 @@ -const route = cy.testRoutes.backend.system.myaccount; -const validation = cy.openmage.validation; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); - - it(`tests empty input`, () => { - const validate = cy.openmage.validation.requiredEntry; - validation.fillFields(route.__validation._input, validate); - validation.saveAction(route._buttonSave); - validation.validateFields(route.__validation._input, validate); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/system/notifications.cy.js b/cypress/e2e/openmage/backend/system/notifications.cy.js index 75c15ec7e7f..3de3e22a4da 100644 --- a/cypress/e2e/openmage/backend/system/notifications.cy.js +++ b/cypress/e2e/openmage/backend/system/notifications.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.system.notification; +const test = cy.testBackendSystemAdminnotification.config; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/system/store.cy.js b/cypress/e2e/openmage/backend/system/store.cy.js new file mode 100644 index 00000000000..60ec2df3a55 --- /dev/null +++ b/cypress/e2e/openmage/backend/system/store.cy.js @@ -0,0 +1,13 @@ +const test = cy.testBackendSystemStore.config; +const validation = cy.openmage.validation; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + validation.pageElements(test, test.index); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/stores.cy.js b/cypress/e2e/openmage/backend/system/stores.cy.js deleted file mode 100644 index 8d50c26d242..00000000000 --- a/cypress/e2e/openmage/backend/system/stores.cy.js +++ /dev/null @@ -1,12 +0,0 @@ -const route = cy.testRoutes.backend.system.stores; - -describe(`Checks admin system "${route.h3}"`, () => { - beforeEach('Log in the user', () => { - cy.adminLogIn(); - cy.adminGoToTestRoute(route); - }); - - it(`tests classes and title`, () => { - cy.adminTestRoute(route); - }); -}); \ No newline at end of file diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 4f7dbd710ee..1dba28aa2e8 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -1,12 +1,24 @@ -const route = cy.testRoutes.backend.system.variables; +const test = cy.testBackendSystemVariable.config; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.index); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + validation.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + // TODO: There is no edit route for system variables + validation.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.click(test.index.__buttons.add); + validation.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/frontend/customer/account/create.cy.js b/cypress/e2e/openmage/frontend/customer/account/create.cy.js index e438f7ddb07..9e81c05352d 100644 --- a/cypress/e2e/openmage/frontend/customer/account/create.cy.js +++ b/cypress/e2e/openmage/frontend/customer/account/create.cy.js @@ -1,26 +1,27 @@ -const route = cy.testRoutes.frontend.customer.account.create; -const fields = route.__validation._input; +const test = cy.testFrontend.customer.account.create; +const fields = test.__validation._input; +const tools = cy.openmage.tools; const validation = cy.openmage.validation; describe('Checks customer account create', () => { beforeEach('Go to page', () => { - cy.visit(route.url); + cy.visit(test.url); }); it('Checks the Create Account page title', () => { - cy.get(route._h1).should('include.text', route.h1); + cy.get(test._h1).should('include.text', test.h1); }); it('Submits empty form', () => { validation.fillFields(fields, validation.requiredEntry); - validation.saveAction(route._buttonSubmit); + tools.click(test._buttonSubmit); validation.validateFields(fields, validation.requiredEntry); }); it('Submits empty form, no js', () => { validation.fillFields(fields, validation.requiredEntry); validation.removeClasses(fields); - validation.saveAction(route._buttonSubmit); + tools.click(test._buttonSubmit); cy.get(validation._errorMessage) .should('include.text', '"First Name" is a required value.') .should('include.text', '"First Name" length must be equal or greater than 1 characters.') @@ -32,13 +33,13 @@ describe('Checks customer account create', () => { it('Submits form with short password and wrong confirmation', () => { cy.get(fields.password).type('123').should('have.value', '123'); cy.get(fields.confirmation).type('abc').should('have.value', 'abc'); - cy.get(route._buttonSubmit).click(); + tools.click(test._buttonSubmit); cy.get('#advice-validate-password-password').should('include.text', 'Please enter more characters or clean leading or trailing spaces.'); cy.get('#advice-validate-cpassword-confirmation').should('include.text', 'Please make sure your passwords match.'); }); it('Submits valid form with random email', () => { - const email = cy.openmage.tools.generateRandomEmail(); + const email = cy.openmage.utils.generateRandomEmail(); const firstname = 'John'; const lastname = 'Doe'; const password = '12345678'; @@ -48,7 +49,7 @@ describe('Checks customer account create', () => { cy.get(fields.email_address).type(email).should('have.value', email); cy.get(fields.password).type(password).should('have.value', password); cy.get(fields.confirmation).type(password).should('have.value', password); - cy.get(route._buttonSubmit).click(); - cy.get(validation._successMessage).should('include.text', successMsg); + tools.click(test._buttonSubmit); + validation.hasSuccessMessage(successMsg); }); }); diff --git a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js index 2aefb3b99c1..1b4b46fbfba 100644 --- a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js +++ b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js @@ -1,27 +1,30 @@ -const route = cy.testRoutes.frontend.homepage; +const test = cy.testFrontend.homepage; +const tools = cy.openmage.tools; +const utils = cy.openmage.utils; +const validation = cy.openmage.validation; -describe('Check newsletter subribe', () => { +describe('Check newsletter subscribe', () => { beforeEach('Go to page', () => { - cy.visit(route.url); + cy.visit(test.url); }); it('tests empty input', () => { - const error = cy.openmage.validation.requiredEntry.error; - cy.get(route.newsletter._id).should('have.value', ''); - cy.get(route.newsletter._buttonSubmit).click(); + const error = validation.requiredEntry.error; + cy.get(test.newsletter._id).should('have.value', ''); + tools.click(test.newsletter._buttonSubmit); cy.get('#advice-required-entry-newsletter').should('include.text', error); }) it('Test valid input twice', () => { - const email = cy.openmage.tools.generateRandomEmail(); + const email = utils.generateRandomEmail(); cy.log('Test first valid input'); - cy.get(route.newsletter._id).type(email).should('have.value', email); - cy.get(route.newsletter._buttonSubmit).click(); - cy.get(cy.openmage.validation._successMessage).should('include.text', 'Thank you for your subscription.'); + cy.get(test.newsletter._id).type(email).should('have.value', email); + tools.click(test.newsletter._buttonSubmit); + validation.hasSuccessMessage('Thank you for your subscription.'); cy.log('Test second valid input'); - cy.get(route.newsletter._id).type(email).should('have.value', email); - cy.get(route.newsletter._buttonSubmit).click(); - cy.get(cy.openmage.validation._errorMessage).should('include.text', 'There was a problem with the subscription: This email address is already registered.'); + cy.get(test.newsletter._id).type(email).should('have.value', email); + tools.click(test.newsletter._buttonSubmit); + validation.hasErrorMessage('There was a problem with the subscription: This email address is already registered.'); }) }) diff --git a/cypress/fixtures/example.json b/cypress/fixtures/example.json new file mode 100644 index 00000000000..02e4254378e --- /dev/null +++ b/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5e14a6c4020..61168436830 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -13,7 +13,7 @@ Cypress.Commands.add('adminLogIn', () => { cy.url().should('include', '/dashboard/index'); }) -Cypress.Commands.add('adminGoToTestRoute', (route) => { +Cypress.Commands.add('adminGoToTestRoute', (route, path) => { cy.get('body').then($body => { const popup = '#message-popup-window .message-popup-head a'; if ($body.find(popup).length > 0) { @@ -22,20 +22,9 @@ Cypress.Commands.add('adminGoToTestRoute', (route) => { } }); - cy.log(`Clicking on "${route.h3}" menu`); + cy.log(`Clicking on "${path.title}" menu`); cy.get(route._id).click({force: true}); - cy.url().should('include', route.url); -}) - -Cypress.Commands.add('adminTestRoute', (route) => { - cy.log('Checking for title'); - cy.get(route._h3).should('include.text', route.h3); - - cy.log('Checking for active parent class'); - cy.get(route._id_parent).should('have.class', 'active'); - - cy.log('Checking for active class'); - cy.get(route._id).should('have.class', 'active'); + cy.url().should('include', path.url); }) Cypress.Commands.add('adminGetConfiguration', (route) => { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index d19ff07ec62..74ec4cb4b9a 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -16,4 +16,38 @@ // Import commands.js using ES2015 syntax: import './commands' import './openmage' -import './openmage/config/paths' +import './openmage/backend/catalog/categories' +import './openmage/backend/catalog/products' +import './openmage/backend/catalog/search' +import './openmage/backend/catalog/sitemap' +import './openmage/backend/catalog/urlrewrite' +import './openmage/backend/cms/block' +import './openmage/backend/cms/page' +import './openmage/backend/cms/widget' +import './openmage/backend/customer/customer' +import './openmage/backend/customer/groups' +import './openmage/backend/customer/online' +import './openmage/backend/dashboard' +import './openmage/backend/newsletter/queue' +import './openmage/backend/newsletter/report' +import './openmage/backend/newsletter/subscriber' +import './openmage/backend/newsletter/templates' +import './openmage/backend/promo/catalog' +import './openmage/backend/promo/quote' +import './openmage/backend/sales/creditmemo' +import './openmage/backend/sales/invoice' +import './openmage/backend/sales/order' +import './openmage/backend/sales/shipment' +import './openmage/backend/sales/transactions' +import './openmage/backend/system/adminnotification' +import './openmage/backend/system/cache' +import './openmage/backend/system/config' +import './openmage/backend/system/currency' +import './openmage/backend/system/design' +import './openmage/backend/system/emails' +import './openmage/backend/system/indexer' +import './openmage/backend/system/my-account' +import './openmage/backend/system/store' +import './openmage/backend/system/variable' + +import './openmage/frontend/paths' diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index e4c67926cc9..dd51d859453 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -1,95 +1,173 @@ -cy.openmage = { - login: { - admin: { - username: { - _id: '#username', - value: 'admin', - }, - password: { - _id: '#login', - value: 'veryl0ngpassw0rd', - }, - _submit: { - __selector: '.form-button', - } +cy.openmage = {}; + +cy.openmage.login = { + admin: { + username: { + _id: '#username', + value: 'admin', + }, + password: { + _id: '#login', + value: 'veryl0ngpassw0rd', + }, + _submit: { + __selector: '.form-button', + } + } +} + +cy.openmage.check = { + buttons: (test, path, log = 'Checking for existing buttons') => { + cy.log(log); + if (path.__buttons !== undefined) { + cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); + + for (const button of Object.keys(path.__buttons)) { + cy.get(path.__buttons[button]).should('exist'); + }; } }, - tools: { - generateRandomEmail: () => { - const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; - let email = ''; - for (let i = 0; i < 16; i++) { - email += chars.charAt(Math.floor(Math.random() * chars.length)); - } - return email + '-cypress-test@example.com'; + fields: (path, log = 'Checking for existing fields') => { + cy.log(log); + if (path.__fields !== undefined) { + for (const field of Object.keys(path.__fields)) { + cy.get(path.__fields[field].selector).should('exist'); + }; } }, - validation: { - test: { - float: '1.1', - number: '1', - numberGreater1: '666', - string: 'string', - }, - requiredEntry: { - css: 'required-entry', - error: 'This is a required field.', - _error: '#advice-required-entry-', - }, - digits: { - css: 'validate-digits', - error: 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.', - _error: '#advice-validate-digits-', - }, - number: { - css: 'validate-number', - error: 'Please enter a valid number in this field.', - _error: '#advice-validate-number-', - }, - numberRange: { - css: 'validate-number-range', - error: 'The value is not within the specified range.', - _error: '#advice-validate-number-range-', - }, - _errorMessage: '.error-msg', - _successMessage: '.success-msg', - _warningMessage: '.warning-msg', - fillFields: (fields, validation, value = '') =>{ - cy.log('Filling fields with invalid values'); - Object.keys(fields).forEach(field => { - const selector = fields[field]; - cy - .get(selector) - .clear({ force: true }) - .should('have.class', validation.css); + grid: (path, log = 'Checking for existing grid') => { + if (path._grid !== undefined) { + cy.log(log); + cy.get(path._grid).should('exist'); + } + }, + navigation: (test, log = 'Checking for active navigation') => { + cy.log(log); + cy.get(test._id).should('have.class', 'active'); + cy.get(test._id_parent).should('have.class', 'active'); + }, + url: (path, log = 'Checking for URL') => { + cy.log(log) + cy.url().should('include', path.url); + }, + tabs: (path, log = 'Checking for tabs') => { + cy.log(log); + if (path.__tabs !== undefined) { + for (const tab of Object.keys(path.__tabs)) { + cy.get(path.__tabs[tab]).should('exist'); + }; + } + }, + title: (test, path, log = 'Checking for title') => { + cy.log(log) + cy.get(test._h3).should('include.text', path.title); + }, +} - if (value !== '') { - cy - .get(selector) - .type(value, { force: true }) - .should('have.value', value) - } - }); - }, - removeClasses: (fields) =>{ - cy.log('Removing classes from fields'); - Object.keys(fields).forEach(field => { - const selector = fields[field]; +cy.openmage.tools = { + click: (selector, log = 'Clicking on something') => { + cy.log(log); + cy.get(selector).first().click({force: true, multiple: false}); + }, + clickContains: (element, selector, content, log = 'Clicking on some content') => { + cy.log(log); + cy.get(element).contains(selector, content).first().click({force: true, multiple: false}); + }, +} + +cy.openmage.utils = { + generateRandomEmail: () => { + const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; + let email = ''; + for (let i = 0; i < 16; i++) { + email += chars.charAt(Math.floor(Math.random() * chars.length)); + } + return email + '-cypress-test@example.com'; + }, +} + +cy.openmage.validation = { + test: { + float: '1.1', + number: '1', + numberGreater1: '666', + string: 'string', + }, + requiredEntry: { + css: 'required-entry', + error: 'This is a required field.', + _error: '#advice-required-entry-', + }, + digits: { + css: 'validate-digits', + error: 'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.', + _error: '#advice-validate-digits-', + }, + number: { + css: 'validate-number', + error: 'Please enter a valid number in this field.', + _error: '#advice-validate-number-', + }, + numberRange: { + css: 'validate-number-range', + error: 'The value is not within the specified range.', + _error: '#advice-validate-number-range-', + }, + _errorMessage: '.error-msg', + _successMessage: '.success-msg', + _warningMessage: '.warning-msg', + fillFields: (fields, validation, value = '') =>{ + cy.log('Filling fields with invalid values'); + Object.keys(fields).forEach(field => { + const selector = fields[field]; + cy + .get(selector) + .clear({ force: true }) + .should('have.class', validation.css); + + if (value !== '') { cy .get(selector) - .invoke('removeClass'); - }); - }, - saveAction: (selector) => { - cy.log('Clicking on Save button'); - cy.get(selector).click({force: true, multiple: true}); - }, - validateFields: (fields, validation) =>{ - cy.log('Checking for error messages'); - Object.keys(fields).forEach(field => { - const selector = validation._error + fields[field].replace(/^\#/, ""); - cy.get(selector).should('include.text', validation.error); - }); - }, - } + .type(value, { force: true }) + .should('have.value', value) + } + }); + }, + removeClasses: (fields) =>{ + cy.log('Removing classes from fields'); + Object.keys(fields).forEach(field => { + const selector = fields[field]; + cy + .get(selector) + .invoke('removeClass'); + }); + }, + pageElements: (test, path) => { + cy.openmage.check.buttons(test, path); + cy.openmage.check.fields(path); + cy.openmage.check.grid(path); + cy.openmage.check.navigation(test); + cy.openmage.check.tabs(path); + cy.openmage.check.title(test, path); + cy.openmage.check.url(path); + }, + validateFields: (fields, validation) =>{ + cy.log('Checking for error messages'); + Object.keys(fields).forEach(field => { + const selector = validation._error + fields[field].replace(/^\#/, ""); + cy.get(selector).should('include.text', validation.error); + }); + }, + hasErrorMessage: (message) =>{ + cy.log('Checking for error messages'); + cy.get(cy.openmage.validation._errorMessage).should('include.text', message); + }, + hasSuccessMessage: (message) =>{ + cy.log('Checking for success messages'); + cy.get(cy.openmage.validation._successMessage).should('include.text', message); + }, + hasWarningMessage: (message) =>{ + cy.log('Checking for warning messages'); + cy.get(cy.openmage.validation._warningMessage).should('include.text', message); + }, } \ No newline at end of file diff --git a/cypress/support/openmage/backend/catalog/categories.js b/cypress/support/openmage/backend/catalog/categories.js new file mode 100644 index 00000000000..e5b953311f2 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/categories.js @@ -0,0 +1,21 @@ +const base = { + _button: '.form-buttons button' +} + +cy.testBackendCatalogProductsCategories = {}; + +cy.testBackendCatalogProductsCategories.config = { + _id: '#nav-admin-catalog-categories', + _id_parent: '#nav-admin-catalog', + _h3: '#category-edit-container h3.icon-head', + _button: base._button, +} + +cy.testBackendCatalogProductsCategories.config.index = { + title: 'New Root Category', + url: 'catalog_category/index', + __buttons: { + save: base._button + '[title="Save Category"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/catalog/products.js b/cypress/support/openmage/backend/catalog/products.js new file mode 100644 index 00000000000..6f3872af790 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/products.js @@ -0,0 +1,39 @@ +const base = { + _button: '.content-header button' +} + +cy.testBackendCatalogProducts = {}; + +cy.testBackendCatalogProducts.config = { + _id: '#nav-admin-catalog-products', + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCatalogProducts.config.index = { + title: 'Manage Products', + url: 'catalog_product/index', + _grid: '#productGrid_table', + __buttons: { + add: base._button + '[title="Add Product"]', + }, +} + +cy.testBackendCatalogProducts.config.edit = { + title: 'Plaid Cotton', + url: 'catalog_product/edit', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete"]', + duplicate: base._button + '[title="Duplicate"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendCatalogProducts.config.new = { + title: 'New Product', + url: 'catalog_product/new', +} diff --git a/cypress/support/openmage/backend/catalog/search.js b/cypress/support/openmage/backend/catalog/search.js new file mode 100644 index 00000000000..0016e13b7e5 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/search.js @@ -0,0 +1,42 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendCatalogSearch = {}; + +cy.testBackendCatalogSearch.config = { + _id: '#nav-admin-catalog-search', + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCatalogSearch.config.index = { + title: 'Search', + url: 'catalog_search/index', + _grid: '#catalog_search_grid_table', + __buttons: { + add: base._button + '[title="Add New Search Term"]', + }, +} + +cy.testBackendCatalogSearch.config.edit = { + title: 'Edit Search', + url: 'catalog_search/edit', + __buttons: { + save: base._button + '[title="Save Search"]', + delete: base._button + '[title="Delete Search"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendCatalogSearch.config.new = { + title: 'New Search', + url: 'catalog_search/new', + __buttons: { + save: base._button + '[title="Save Search"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/catalog/sitemap.js b/cypress/support/openmage/backend/catalog/sitemap.js new file mode 100644 index 00000000000..84fb5596da8 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/sitemap.js @@ -0,0 +1,31 @@ +const base = { + _button: '.form-buttons button' +} + +cy.testBackendCatalogSitemap = {}; + +cy.testBackendCatalogSitemap.config = { + _id: '#nav-admin-catalog-sitemap', + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCatalogSitemap.config.index = { + title: 'Google Sitemap', + url: 'sitemap/index', + _grid: '#sitemapGrid_table', + __buttons: { + add: base._button + '[title="Add Sitemap"]', + }, +} + +cy.testBackendCatalogSitemap.config.edit = { + title: 'Edit Sitemap', + url: 'sitemap/edit', +} + +cy.testBackendCatalogSitemap.config.new = { + title: 'New Sitemap', + url: 'sitemap/new', +} diff --git a/cypress/support/openmage/backend/catalog/urlrewrite.js b/cypress/support/openmage/backend/catalog/urlrewrite.js new file mode 100644 index 00000000000..99c4c76dd6b --- /dev/null +++ b/cypress/support/openmage/backend/catalog/urlrewrite.js @@ -0,0 +1,40 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendUrlrewrite = {}; + +cy.testBackendUrlrewrite.config = { + _id: '#nav-admin-catalog-urlrewrite', + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendUrlrewrite.config.index = { + title: 'URL Rewrite Management', + url: 'urlrewrite/index', + _grid: '#urlrewriteGrid_table', + __buttons: { + add: base._button + '[title="Add URL Rewrite"]', + }, +} + +cy.testBackendUrlrewrite.config.edit = { + title: 'Edit URL Rewrite', + url: 'urlrewrite/edit', + __buttons: { + save: base._button + '[title="Save"]', + delete: base._button + '[title="Delete"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendUrlrewrite.config.new = { + title: 'Add New URL Rewrite', + url: 'urlrewrite/edit', + __buttons: { + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/cms/block.js b/cypress/support/openmage/backend/cms/block.js new file mode 100644 index 00000000000..654f683fb94 --- /dev/null +++ b/cypress/support/openmage/backend/cms/block.js @@ -0,0 +1,63 @@ +const base = { + _button: '.form-buttons button', + __fields: { + block_title : { + selector: '#block_title', + }, + block_identifier : { + selector: '#block_identifier', + }, + block_store_id : { + selector: '#block_store_id', + }, + block_is_active : { + selector: '#block_is_active', + }, + block_content : { + selector: '#block_content', + }, + }, +} + +cy.testBackendCmsBlock = {}; + +cy.testBackendCmsBlock.config = { + _id: '#nav-admin-cms-block', + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCmsBlock.config.index = { + title: 'Static Blocks', + url: 'cms_block/index', + _grid: '#cmsBlockGrid_table', + __buttons: { + add: base._button + '[title="Add New Block"]', + }, +} + +cy.testBackendCmsBlock.config.edit = { + title: 'Edit Block', + url: 'cms_block/edit', + __buttons: { + save: base._button + '[title="Save Block"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete Block"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, + __fields: base.__fields, +} + +cy.testBackendCmsBlock.config.new = { + title: 'New Block', + url: 'cms_block/new', + __buttons: { + save: base._button + '[title="Save Block"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, + __fields: base.__fields, +} diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js new file mode 100644 index 00000000000..11f901b23b8 --- /dev/null +++ b/cypress/support/openmage/backend/cms/page.js @@ -0,0 +1,160 @@ +const tools = cy.openmage.tools; + +const base = { + _button: '.form-buttons button', +}; + +base.__fields = { + page_title : { + selector: '#page_title', + }, + page_identifier : { + selector: '#page_identifier', + }, + page_store_id : { + selector: '#page_store_id', + }, + page_is_active : { + selector: '#page_is_active', + }, + page_content_heading : { + selector: '#page_content_heading', + }, + page_content : { + selector: '#page_content', + }, + page_root_template : { + selector: '#page_root_template', + }, + page_layout_update_xml : { + selector: '#page_layout_update_xml', + }, + page_custom_theme_from : { + selector: '#page_custom_theme_from', + }, + page_custom_theme_to : { + selector: '#page_custom_theme_to', + }, + page_custom_theme : { + selector: '#page_custom_theme', + }, + page_custom_root_template : { + selector: '#page_custom_root_template', + }, + page_custom_layout_update_xml : { + selector: '#page_custom_layout_update_xml', + }, + page_meta_keywords : { + selector: '#page_meta_keywords', + }, + page_meta_description : { + selector: '#page_meta_description', + }, +}; + +base.__tabs = { + general: '#page_tabs_main_section', + content: '#page_tabs_content_section', + design: '#page_tabs_design_section', + metaData: '#page_tabs_meta_section', +} + +cy.testBackendCmsPage = {}; + +cy.testBackendCmsPage.config = { + _id: '#nav-admin-cms-page', + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: base._button, + clickTabMain: () => { + tools.click(base.__tabs.general, 'Clicking on General tab'); + }, + clickTabContent: () => { + tools.click(base.__tabs.content, 'Clicking on Content tab'); + }, + clickTabDesign: () => { + tools.click(base.__tabs.design, 'Clicking on Design tab'); + }, + clickTabMetaData: () => { + tools.click(base.__tabs.metaData, 'Clicking on Meta Data tab'); + }, +} + +cy.testBackendCmsPage.config.index = { + title: 'Manage Pages', + url: 'cms_page/index', + _grid: '#cmsPageGrid', + __buttons: { + add: base._button + '[title="Add New Page"]', + }, + clickAdd: () => { + tools.click(cy.testBackendCmsPage.config.index.__buttons.add, 'Add New Page button clicked'); + }, + clickGridRow: (selector = 'td', content = 'no-route') => { + tools.clickContains(cy.testBackendCmsPage.config.index._grid, selector, content, 'Select a CMS page'); + }, +} + +cy.testBackendCmsPage.config.edit = { + title: 'Edit Page', + url: 'cms_page/edit', + __buttons: { + save: base._button + '[title="Save Page"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete Page"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, + __fields: base.__fields, + __tabs: base.__tabs, + disablePage: () => { + cy.log('Disable the CMS page'); + cy.get(base.__fields.page_is_active.selector) + .select('Disabled'); + }, + resetStores: () => { + cy.log('Restore the default store to the CMS page'); + cy.get(base.__fields.page_store_id.selector) + .select([1, 2, 3]); + }, + clickDelete: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.delete, 'Delete button clicked'); + }, + clickSave: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.save, 'Save button clicked'); + }, + clickSaveAndContinue: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.saveAndContinue, 'Save and Continue Edit button clicked'); + }, + clickBack: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.back, 'Back button clicked'); + }, + clickReset: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.reset, 'Reset button clicked'); + }, +} + +cy.testBackendCmsPage.config.new = { + title: 'New Page', + url: 'cms_page/new', + __buttons: { + save: base._button + '[title="Save Page"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, + __fields: base.__fields, + __tabs: base.__tabs, + clickSave: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.save, 'Save button clicked'); + }, + clickSaveAndContinue: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.saveAndContinue, 'Save and Continue Edit button clicked'); + }, + clickBack: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.back, 'Back button clicked'); + }, + clickReset: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.reset, 'Reset button clicked'); + }, +} diff --git a/cypress/support/openmage/backend/cms/widget.js b/cypress/support/openmage/backend/cms/widget.js new file mode 100644 index 00000000000..7a2cf4ec784 --- /dev/null +++ b/cypress/support/openmage/backend/cms/widget.js @@ -0,0 +1,42 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendCmsWidget = {}; + +cy.testBackendCmsWidget.config = { + _id: '#nav-admin-cms-widget_instance', + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCmsWidget.config.index = { + title: 'Manage Widget Instances', + url: 'widget_instance/index', + _grid: '#widgetInstanceGrid_table', + __buttons: { + add: base._button + '[title="Add New Widget Instance"]', + }, +} + +cy.testBackendCmsWidget.config.edit = { + title: 'Widget', + url: 'widget_instance/edit', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendCmsWidget.config.new = { + title: 'New Widget Instance', + url: 'widget_instance/new', + __buttons: { + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/customer/customer.js b/cypress/support/openmage/backend/customer/customer.js new file mode 100644 index 00000000000..229939797a2 --- /dev/null +++ b/cypress/support/openmage/backend/customer/customer.js @@ -0,0 +1,45 @@ +const base = { + _button: '.form-buttons button' +} + +cy.testBackendCustomerCustomer = {}; + +cy.testBackendCustomerCustomer.config = { + _id: '#nav-admin-customer-manage', + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCustomerCustomer.config.index = { + title: 'Manage Customers', + url: 'customer/index', + _grid: '#customerGrid_table', + __buttons: { + add: base._button + '[title="Add New Customer"]', + }, +} + +cy.testBackendCustomerCustomer.config.edit = { + title: 'John Smith', // comes from sample data + url: 'customer/edit', + __buttons: { + save: base._button + '[title="Save Customer"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete Customer"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + createOrder: base._button + '[title="Create Order"]', + }, +} + +cy.testBackendCustomerCustomer.config.new = { + title: 'New Customer', + url: 'customer/new', + __buttons: { + save: base._button + '[title="Save Customer"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/customer/groups.js b/cypress/support/openmage/backend/customer/groups.js new file mode 100644 index 00000000000..982b435795c --- /dev/null +++ b/cypress/support/openmage/backend/customer/groups.js @@ -0,0 +1,41 @@ +const base = { + _button: '.form-buttons button' +} + +cy.testBackendCustomerGroups = {}; + +cy.testBackendCustomerGroups.config = { + _id: '#nav-admin-customer-group', + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCustomerGroups.config.index = { + title: 'Customer Groups', + url: 'customer_group/index', + _grid: '#customerGroupGrid_table', + __buttons: { + add: base._button + '[title="Add New Customer Group"]', + }, +} + +cy.testBackendCustomerGroups.config.edit = { + title: 'Edit Customer Group', + url: 'customer_group/edit', + __buttons: { + save: base._button + '[title="Save Customer Group"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendCustomerGroups.config.new = { + title: 'New Customer Group', + url: 'customer_group/new', + __buttons: { + save: base._button + '[title="Save Customer Group"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/customer/online.js b/cypress/support/openmage/backend/customer/online.js new file mode 100644 index 00000000000..1b3b4e7bc10 --- /dev/null +++ b/cypress/support/openmage/backend/customer/online.js @@ -0,0 +1,12 @@ +cy.testBackendCustomerOnline = {}; + +cy.testBackendCustomerOnline.config = { + _id: '#nav-admin-customer-online', + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', +} + +cy.testBackendCustomerOnline.config.index = { + title: 'Online Customers', + url: 'customer_online/index', +} diff --git a/cypress/support/openmage/backend/dashboard.js b/cypress/support/openmage/backend/dashboard.js new file mode 100644 index 00000000000..0f1e0d643be --- /dev/null +++ b/cypress/support/openmage/backend/dashboard.js @@ -0,0 +1,12 @@ +cy.testBackendDashboard = {}; + +cy.testBackendDashboard.config = { + _id: '#nav-admin-dashboard', + _id_parent: '#nav-admin-dashboard', + _h3: 'h3.head-dashboard', +} + +cy.testBackendDashboard.config.index = { + title: 'Dashboard', + url: 'dashboard/index', +} diff --git a/cypress/support/openmage/backend/newsletter/queue.js b/cypress/support/openmage/backend/newsletter/queue.js new file mode 100644 index 00000000000..cb4484df9a0 --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/queue.js @@ -0,0 +1,13 @@ +cy.testBackendNewsletterQueue = {}; + +cy.testBackendNewsletterQueue.config = { + _id: '#nav-admin-newsletter-queue', + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterQueue.config.index = { + title: 'Newsletter Queue', + url: 'newsletter_queue/index', + _grid: '#queueGrid_table', +} diff --git a/cypress/support/openmage/backend/newsletter/report.js b/cypress/support/openmage/backend/newsletter/report.js new file mode 100644 index 00000000000..a9220db6cf8 --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/report.js @@ -0,0 +1,13 @@ +cy.testBackendNewsletterReport = {}; + +cy.testBackendNewsletterReport.config = { + _id: '#nav-admin-newsletter-problem', + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterReport.config.index = { + title: 'Newsletter Problem Reports', + url: 'newsletter_problem/index', + _grid: '#problemGrid_table', +} diff --git a/cypress/support/openmage/backend/newsletter/subscriber.js b/cypress/support/openmage/backend/newsletter/subscriber.js new file mode 100644 index 00000000000..622b0ca618c --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/subscriber.js @@ -0,0 +1,13 @@ +cy.testBackendNewsletterSubscriber = {}; + +cy.testBackendNewsletterSubscriber.config = { + _id: '#nav-admin-newsletter-subscriber', + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterSubscriber.config.index = { + title: 'Newsletter Subscribers', + url: 'newsletter_subscriber/index', + _grid: '#subscriberGrid_table', +} diff --git a/cypress/support/openmage/backend/newsletter/templates.js b/cypress/support/openmage/backend/newsletter/templates.js new file mode 100644 index 00000000000..b5e81bdf8ae --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/templates.js @@ -0,0 +1,47 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendNewsletterTemplates = {}; + +cy.testBackendNewsletterTemplates.config = { + _id: '#nav-admin-newsletter-template', + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendNewsletterTemplates.config.index = { + title: 'Newsletter Templates', + url: 'newsletter_template/index', + _grid: '#newsletterTemplateGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Template"]', + }, +} + +cy.testBackendNewsletterTemplates.config.edit = { + title: 'Edit Newsletter Template', + url: 'newsletter_template/edit', + __buttons: { + save: base._button + '[title="Save Template"]', + saveAs: base._button + '[title="Save As"]', + delete: base._button + '[title="Delete Template"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + convert: base._button + '[title="Convert to Plain Text"]', + preview: base._button + '[title="Preview Template"]', + }, +} + +cy.testBackendNewsletterTemplates.config.new = { + title: 'New Newsletter Template', + url: 'newsletter_template/new', + __buttons: { + save: base._button + '[title="Save Template"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + convert: base._button + '[title="Convert to Plain Text"]', + preview: base._button + '[title="Preview Template"]', + }, +} diff --git a/cypress/support/openmage/backend/promo/catalog.js b/cypress/support/openmage/backend/promo/catalog.js new file mode 100644 index 00000000000..d47042e67b9 --- /dev/null +++ b/cypress/support/openmage/backend/promo/catalog.js @@ -0,0 +1,47 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendPromoCatalog = {}; + +cy.testBackendPromoCatalog.config = { + _id: '#nav-admin-promo-catalog', + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendPromoCatalog.config.index = { + title: 'Catalog Price Rules', + url: 'promo_catalog/index', + _grid: '#promo_catalog_grid_table', + __buttons: { + add: base._button + '[title="Add New Rule"]', + apply: base._button + '[title="Apply Rules"]', + }, +} + +cy.testBackendPromoCatalog.config.edit = { + title: 'Edit Rule', + url: 'promo_catalog/edit', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + saveAndApply: base._button + '[title="Save and Apply"]', + delete: base._button + '[title="Delete"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendPromoCatalog.config.new = { + title: 'New Rule', + url: 'promo_catalog/new', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + saveAndApply: base._button + '[title="Save and Apply"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/promo/quote.js b/cypress/support/openmage/backend/promo/quote.js new file mode 100644 index 00000000000..891e8337232 --- /dev/null +++ b/cypress/support/openmage/backend/promo/quote.js @@ -0,0 +1,44 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendPromoQuote = {}; + +cy.testBackendPromoQuote.config = { + _id: '#nav-admin-promo-quote', + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendPromoQuote.config.index = { + title: 'Shopping Cart Price Rules', + url: 'promo_quote/index', + _grid: '#promo_quote_grid_table', + __buttons: { + add: '.form-buttons button[title="Add New Rule"]', + }, +} + +cy.testBackendPromoQuote.config.edit = { + title: 'Edit Rule', + url: 'promo_quote/edit', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + delete: base._button + '[title="Delete"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} + +cy.testBackendPromoQuote.config.new = { + title: 'New Rule', + url: 'promo_quote/new', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/backend/sales/creditmemo.js b/cypress/support/openmage/backend/sales/creditmemo.js new file mode 100644 index 00000000000..a5ce8292d73 --- /dev/null +++ b/cypress/support/openmage/backend/sales/creditmemo.js @@ -0,0 +1,28 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSalesCreditmemo = {}; + +cy.testBackendSalesCreditmemo.config = { + _id: '#nav-admin-sales-creditmemo', + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendSalesCreditmemo.config.index = { + title: 'Credit Memos', + url: 'sales_creditmemo/index', + _grid: '#sales_creditmemo_grid_table', +} + +cy.testBackendSalesCreditmemo.config.view = { + title: 'Credit Memo #', + url: 'sales_creditmemo/view', + __buttons: { + print: base._button + '[title="Print"]', + email: base._button + '[title="Send Email"]', + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/sales/invoice.js b/cypress/support/openmage/backend/sales/invoice.js new file mode 100644 index 00000000000..9b8dcab70dc --- /dev/null +++ b/cypress/support/openmage/backend/sales/invoice.js @@ -0,0 +1,28 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSalesInvoice = {}; + +cy.testBackendSalesInvoice.config = { + _id: '#nav-admin-sales-invoice', + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendSalesInvoice.config.index = { + title: 'Invoice', + url: 'sales_invoice/index', + _grid: '#sales_invoice_grid_table', +} + +cy.testBackendSalesInvoice.config.view = { + title: 'Invoice #', + url: 'sales_invoice/view', + __buttons: { + print: base._button + '[title="Print"]', + email: base._button + '[title="Send Email"]', + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/sales/order.js b/cypress/support/openmage/backend/sales/order.js new file mode 100644 index 00000000000..7ec40bea13f --- /dev/null +++ b/cypress/support/openmage/backend/sales/order.js @@ -0,0 +1,30 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSalesOrder = {}; + +cy.testBackendSalesOrder.config = { + _id: '#nav-admin-sales-order', + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendSalesOrder.config.index = { + title: 'Orders', + url: 'sales_order/index', + _grid: '#sales_order_grid_table', + __buttons: { + new: '.form-buttons button[title="Create New Order"]', + }, +} + +cy.testBackendSalesOrder.config.view = { + title: 'Order #', + url: 'sales_order/view', + __buttons: { + reorder: base._button + '[title="Reorder"]', + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/sales/shipment.js b/cypress/support/openmage/backend/sales/shipment.js new file mode 100644 index 00000000000..73a441fc487 --- /dev/null +++ b/cypress/support/openmage/backend/sales/shipment.js @@ -0,0 +1,28 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSalesOrderShipment = {} + +cy.testBackendSalesOrderShipment.config = { + _id: '#nav-admin-sales-shipment', + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: base._button, +}; + +cy.testBackendSalesOrderShipment.config.index = { + title: 'Shipments', + url: 'sales_shipment/index', + _grid: '#sales_shipment_grid_table', +} + +cy.testBackendSalesOrderShipment.config.view = { + title: 'Shipment #', + url: 'sales_shipment/view', + __buttons: { + print: base._button + '[title="Print"]', + tracking: base._button + '[title="Send Tracking Information"]', + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/sales/transactions.js b/cypress/support/openmage/backend/sales/transactions.js new file mode 100644 index 00000000000..67ceb3f9c89 --- /dev/null +++ b/cypress/support/openmage/backend/sales/transactions.js @@ -0,0 +1,13 @@ +cy.testBackendSalesTransactions = {}; + +cy.testBackendSalesTransactions.config = { + _id: '#nav-admin-sales-transactions', + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +}; + +cy.testBackendSalesTransactions.config.index = { + title: 'Transactions', + url: 'sales_transactions/index', + _grid: '#order_transactions_table', +} diff --git a/cypress/support/openmage/backend/system/adminnotification.js b/cypress/support/openmage/backend/system/adminnotification.js new file mode 100644 index 00000000000..1fff5c8c056 --- /dev/null +++ b/cypress/support/openmage/backend/system/adminnotification.js @@ -0,0 +1,13 @@ +cy.testBackendSystemAdminnotification = {}; + +cy.testBackendSystemAdminnotification.config = { + _id: '#nav-admin-system-adminnotification', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemAdminnotification.config.index = { + title: 'Messages Inbox', + url: 'notification/index', + _grid: '#notificationGrid_table', +} diff --git a/cypress/support/openmage/backend/system/cache.js b/cypress/support/openmage/backend/system/cache.js new file mode 100644 index 00000000000..070579c503e --- /dev/null +++ b/cypress/support/openmage/backend/system/cache.js @@ -0,0 +1,22 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemCache = {}; + +cy.testBackendSystemCache.config = { + _id: '#nav-admin-system-cache', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemCache.config.index = { + title: 'Cache Storage Management', + url: 'cache/index', + _grid: '#cache_grid_table', + __buttons: { + flushApply: base._button + '[title="Flush & Apply Updates"]', + flushCache: base._button + '[title="Flush Cache Storage"]', + }, +} diff --git a/cypress/support/openmage/backend/system/config.js b/cypress/support/openmage/backend/system/config.js new file mode 100644 index 00000000000..04f53fbdaeb --- /dev/null +++ b/cypress/support/openmage/backend/system/config.js @@ -0,0 +1,54 @@ +const base = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemConfig = {}; + +cy.testBackendSystemConfig.config = { + _buttonSave: '.form-buttons button[title="Save Config"]', +} + +cy.testBackendSystemConfig.config.catalog = {}; +cy.testBackendSystemConfig.config.customers = {}; + +cy.testBackendSystemConfig.config.catalog.configswatches = { + _id: '#section-configswatches', + url: 'system_config/edit/section/configswatches', + h3: 'Configurable Swatches', + _h3: base._h3, +}; + +cy.testBackendSystemConfig.config.catalog.sitemap = { + _id: '#section-sitemap', + url: 'system_config/edit/section/sitemap', + h3: 'Google Sitemap', + _h3: base._h3, + __validation: { + priority: { + _input: { + category: '#sitemap_category_priority', + product: '#sitemap_product_priority', + page: '#sitemap_page_priority', + } + } + } +} + +cy.testBackendSystemConfig.config.customers.promo = { + _id: '#section-promo', + url: 'system_config/edit/section/promo', + h3: 'Promotions', + _h3: base._h3, + __validation: { + __groups: { + couponCodes: { + _id: '#promo_auto_generated_coupon_codes-head', + _input: { + length: '#promo_auto_generated_coupon_codes_length', + dashes: '#promo_auto_generated_coupon_codes_dash', + } + } + } + } +} diff --git a/cypress/support/openmage/backend/system/currency.js b/cypress/support/openmage/backend/system/currency.js new file mode 100644 index 00000000000..8cba7367cc2 --- /dev/null +++ b/cypress/support/openmage/backend/system/currency.js @@ -0,0 +1,27 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemCurrencyRates = {}; + +cy.testBackendSystemCurrencyRates.config = { + _id: '#nav-admin-system-currency-rates', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemCurrencyRates.config.index = { + title: 'Manage Currency Rates', + url: 'system_currency/index', + __buttons: { + save: base._button + '[title="Save Currency Rates"]', + import: base._button + '[title="Import"]', + reset: base._button + '[title="Reset"]', + }, + __validation: { + _input: { + from: 'input[name="rate[USD][EUR]"]', + } + } +} diff --git a/cypress/support/openmage/backend/system/design.js b/cypress/support/openmage/backend/system/design.js new file mode 100644 index 00000000000..0f3799ceafa --- /dev/null +++ b/cypress/support/openmage/backend/system/design.js @@ -0,0 +1,35 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemDesign = {}; + +cy.testBackendSystemDesign.config = { + _id: '#nav-admin-system-design', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemDesign.config.index = { + title: 'Design', + url: 'system_design/index', + _grid: '#designGrid_table', + __buttons: { + add: base._button + '[title="Add Design Change"]', + }, +} + +cy.testBackendSystemDesign.config.edit = { + title: 'Edit Design Change', + url: 'system_design/edit', +} + +cy.testBackendSystemDesign.config.new = { + title: 'New Design Change', + url: 'system_design/new', + __buttons: { + save: base._button + '[title="Save"]', + back: base._button + '[title="Back"]', + }, +} diff --git a/cypress/support/openmage/backend/system/emails.js b/cypress/support/openmage/backend/system/emails.js new file mode 100644 index 00000000000..1747dd05d36 --- /dev/null +++ b/cypress/support/openmage/backend/system/emails.js @@ -0,0 +1,38 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemEmailTemplate = {}; + +cy.testBackendSystemEmailTemplate.config = { + _id: '#nav-admin-system-email_template', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemEmailTemplate.config.index = { + title: 'Transactional Emails', + url: 'system_email_template/index', + _grid: '#systemEmailTemplateGrid_table', + __buttons: { + add: base._button + '[title="Add New Template"]', + }, +} + +cy.testBackendSystemEmailTemplate.config.edit = { + title: 'Edit Email Template', + url: 'system_email_template/edit', +} + +cy.testBackendSystemEmailTemplate.config.new = { + title: 'New Email Template', + url: 'system_email_template/new', + __buttons: { + save: base._button + '[title="Save Template"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + convert: base._button + '[title="Convert to Plain Text"]', + preview: base._button + '[title="Preview Template"]', + }, +} diff --git a/cypress/support/openmage/backend/system/indexer.js b/cypress/support/openmage/backend/system/indexer.js new file mode 100644 index 00000000000..6daef5d60b3 --- /dev/null +++ b/cypress/support/openmage/backend/system/indexer.js @@ -0,0 +1,13 @@ +cy.testBackendSystemIndex = {}; + +cy.testBackendSystemIndex.config = { + _id: '#nav-admin-system-index', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemIndex.config.index = { + title: 'Index Management', + url: 'process/list', + _grid: '#indexer_processes_grid_table', +} diff --git a/cypress/support/openmage/backend/system/my-account.js b/cypress/support/openmage/backend/system/my-account.js new file mode 100644 index 00000000000..3856c29da38 --- /dev/null +++ b/cypress/support/openmage/backend/system/my-account.js @@ -0,0 +1,30 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemMyAccount = {}; + +cy.testBackendSystemMyAccount.config = { + _id: '#nav-admin-system-myaccount', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemMyAccount.config.index = { + title: 'My Account', + url: 'system_account/index', + __buttons: { + save: base._button + '[title="Save Account"]', + reset: base._button + '[title="Reset"]', + }, + __validation: { + _input: { + username: '#username', + firstname: '#firstname', + lastname: '#lastname', + email: '#email', + current_password: '#current_password', + } + } +} diff --git a/cypress/support/openmage/backend/system/store.js b/cypress/support/openmage/backend/system/store.js new file mode 100644 index 00000000000..cf68eabd9ec --- /dev/null +++ b/cypress/support/openmage/backend/system/store.js @@ -0,0 +1,22 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemStore = {}; + +cy.testBackendSystemStore.config = { + _id: '#nav-admin-system-store', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemStore.config.index = { + title: 'Manage Stores', + url: 'system_store/index', + __buttons: { + addWebsite: base._button + '[title="Create Website"]', + addStore: base._button + '[title="Create Store"]', + addStoreView: base._button + '[title="Create Store View"]', + }, +} diff --git a/cypress/support/openmage/backend/system/variable.js b/cypress/support/openmage/backend/system/variable.js new file mode 100644 index 00000000000..05d67f1bf3d --- /dev/null +++ b/cypress/support/openmage/backend/system/variable.js @@ -0,0 +1,37 @@ +const base = { + _button: '.form-buttons button', +} + +cy.testBackendSystemVariable = {}; + +cy.testBackendSystemVariable.config = { + _id: '#nav-admin-system-variable', + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendSystemVariable.config.index = { + title: 'Custom Variables', + url: 'system_variable/index', + _grid: '#customVariablesGrid', + __buttons: { + add: base._button + '[title="Add New Variable"]', + }, +} + +cy.testBackendSystemVariable.config.edit = { + title: 'Custom Variable', + url: 'system_variable/edit', +} + +cy.testBackendSystemVariable.config.new = { + title: 'New Custom Variable', + url: 'system_variable/new', + __buttons: { + save: base._button + '[title="Save"]', + saveAndContinue: base._button + '[title="Save and Continue Edit"]', + back: base._button + '[title="Back"]', + reset: base._button + '[title="Reset"]', + }, +} diff --git a/cypress/support/openmage/config/paths.js b/cypress/support/openmage/config/paths.js deleted file mode 100644 index 2470f01ecf2..00000000000 --- a/cypress/support/openmage/config/paths.js +++ /dev/null @@ -1,346 +0,0 @@ -const adminNav = { - catalog: '#nav-admin-catalog', - cms: '#nav-admin-cms', - customer: '#nav-admin-customer', - newsletter: '#nav-admin-newsletter', - promo: '#nav-admin-promo', - sales: '#nav-admin-sales', - system: '#nav-admin-system', -} - -const adminPage = { - _h3: 'h3.icon-head', -} - -cy.testRoutes = { - api: {}, - backendLogin: {}, - backend: { - dashboard: { - _id: '#nav-admin-dashboard', - url: 'dashboard/index', - h3: 'Dashboard', - _h3: adminPage._h3, - }, - catalog: { - products: { - _id_parent: adminNav.catalog, - _id: '#nav-admin-catalog-products', - url: 'catalog_product/index', - h3: 'Manage Products', - _h3: adminPage._h3, - }, - categories: { - _id_parent: adminNav.catalog, - _id: '#nav-admin-catalog-categories', - url: 'catalog_category/index', - h3: 'New Root Category', - _h3: '#category-edit-container ' + adminPage._h3, - }, - search: { - _id_parent: adminNav.catalog, - _id: '#nav-admin-catalog-search', - url: 'catalog_search/index', - h3: 'Search', - _h3: adminPage._h3, - }, - sitemap: { - _id_parent: adminNav.catalog, - _id: '#nav-admin-catalog-sitemap', - url: 'sitemap/index', - h3: 'Google Sitemap', - _h3: adminPage._h3, - }, - urlrewrite: { - _id_parent: adminNav.catalog, - _id: '#nav-admin-catalog-urlrewrite', - url: 'urlrewrite/index', - h3: 'URL Rewrite Management', - _h3: adminPage._h3, - } - }, - cms: { - block: { - _id_parent: adminNav.cms, - _id: '#nav-admin-cms-block', - url: 'cms_block/index', - h3: 'Static Blocks', - _h3: adminPage._h3, - }, - page: { - _id_parent: adminNav.cms, - _id: '#nav-admin-cms-page', - url: 'cms_page/index', - h3: 'Manage Pages', - _h3: adminPage._h3, - }, - widget: { - _id_parent: adminNav.cms, - _id: '#nav-admin-cms-widget_instance', - url: 'widget_instance/index', - h3: 'Manage Widget Instances', - _h3: adminPage._h3, - } - }, - customers: { - manage: { - _id_parent: adminNav.customer, - _id: '#nav-admin-customer-manage', - url: 'customer/index', - h3: 'Manage Customers', - _h3: adminPage._h3, - }, - groups: { - _id_parent: adminNav.customer, - _id: '#nav-admin-customer-group', - url: 'customer_group/index', - h3: 'Customer Groups', - _h3: adminPage._h3, - }, - online: { - _id_parent: adminNav.customer, - _id: '#nav-admin-customer-online', - url: 'customer_online/index', - h3: 'Online Customers', - _h3: adminPage._h3, - } - }, - newsletter: { - templates: { - _id_parent: adminNav.newsletter, - _id: '#nav-admin-newsletter-template', - url: 'newsletter_template/index', - h3: 'Newsletter Templates', - _h3: adminPage._h3, - }, - queue: { - _id_parent: adminNav.newsletter, - _id: '#nav-admin-newsletter-queue', - url: 'newsletter_queue/index', - h3: 'Newsletter Queue', - _h3: adminPage._h3, - }, - subscriber: { - _id_parent: adminNav.newsletter, - _id: '#nav-admin-newsletter-subscriber', - url: 'newsletter_subscriber/index', - h3: 'Newsletter Subscribers', - _h3: adminPage._h3, - }, - report: { - _id_parent: adminNav.newsletter, - _id: '#nav-admin-newsletter-problem', - url: 'newsletter_problem/index', - h3: 'Newsletter Problem Reports', - _h3: adminPage._h3, - } - }, - promo: { - catalog: { - _id_parent: adminNav.promo, - _id: '#nav-admin-promo-catalog', - url: 'promo_catalog/index', - h3: 'Catalog Price Rules', - _h3: adminPage._h3, - }, - cart: { - _id_parent: adminNav.promo, - _id: '#nav-admin-promo-quote', - url: 'promo_quote/index', - h3: 'Shopping Cart Price Rules', - _h3: adminPage._h3, - } - }, - sales: { - creditmemo: { - _id_parent: adminNav.sales, - _id: '#nav-admin-sales-creditmemo', - url: 'sales_creditmemo/index', - h3: 'Credit Memos', - _h3: adminPage._h3, - }, - invoice: { - _id_parent: adminNav.sales, - _id: '#nav-admin-sales-invoice', - url: 'sales_invoice/index', - h3: 'Invoice', - _h3: adminPage._h3, - }, - order: { - _id_parent: adminNav.sales, - _id: '#nav-admin-sales-order', - url: 'sales_order/index', - h3: 'Orders', - _h3: adminPage._h3, - }, - shipment: { - _id_parent: adminNav.sales, - _id: '#nav-admin-sales-shipment', - url: 'sales_shipment/index', - h3: 'Shipments', - _h3: adminPage._h3, - }, - transactions: { - _id_parent: adminNav.sales, - _id: '#nav-admin-sales-transactions', - url: 'sales_transactions/index', - h3: 'Transactions', - _h3: adminPage._h3, - } - }, - system: { - cache: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-cache', - url: 'cache/index', - h3: 'Cache Storage Management', - _h3: adminPage._h3, - }, - design: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-design', - url: 'system_design/index', - h3: 'Design', - _h3: adminPage._h3, - }, - email: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-email_template', - url: 'system_email_template/index', - h3: 'Transactional Emails', - _h3: adminPage._h3, - }, - myaccount: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-myaccount', - url: 'system_account/index', - h3: 'My Account', - _h3: adminPage._h3, - _buttonSave: '.form-buttons button[title="Save Account"]', - __validation: { - _input: { - username: '#username', - firstname: '#firstname', - lastname: '#lastname', - email: '#email', - current_password: '#current_password', - } - } - }, - manage_curreny: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-currency-rates', - url: 'system_currency/index', - h3: 'Manage Currency Rates', - _h3: adminPage._h3, - _buttonSave: '.form-buttons button[title="Save Currency Rates"]', - __validation: { - _input: { - from: 'input[name="rate[USD][EUR]"]', - } - } - }, - notification: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-adminnotification', - url: 'notification/index', - h3: 'Messages Inbox', - _h3: adminPage._h3, - }, - indexes: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-index', - url: 'process/list', - h3: 'Index Management', - _h3: adminPage._h3, - }, - stores: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-store', - url: 'system_store/index', - h3: 'Manage Stores', - _h3: adminPage._h3, - }, - variables: { - _id_parent: adminNav.system, - _id: '#nav-admin-system-variable', - url: 'system_variable/index', - h3: 'Custom Variables', - _h3: adminPage._h3, - }, - config: { - _buttonSave: '.form-buttons button[title="Save Config"]', - catalog: { - configswatches: { - _id: '#section-configswatches', - url: 'system_config/edit/section/configswatches', - h3: 'Configurable Swatches', - _h3: adminPage._h3, - }, - sitemap: { - _id: '#section-sitemap', - url: 'system_config/edit/section/sitemap', - h3: 'Google Sitemap', - _h3: adminPage._h3, - __validation: { - priority: { - _input: { - category: '#sitemap_category_priority', - product: '#sitemap_product_priority', - page: '#sitemap_page_priority', - } - } - } - } - }, - customers: { - promo: { - _id: '#section-promo', - url: 'system_config/edit/section/promo', - h3: 'Promotions', - _h3: adminPage._h3, - __validation: { - __groups: { - couponCodes: { - _id: '#promo_auto_generated_coupon_codes-head', - _input: { - length: '#promo_auto_generated_coupon_codes_length', - dashes: '#promo_auto_generated_coupon_codes_dash', - } - } - } - } - }, - }, - } - } - }, - frontend: { - homepage: { - url: '/', - newsletter: { - _buttonSubmit: '#newsletter-validate-detail button[type="submit"]', - _id: '#newsletter' - } - }, - customer: { - account: { - create: { - url: '/customer/account/create', - _buttonSubmit: '#form-validate button[type="submit"]', - _h1: 'h1', - h1: 'Create an Account', - __validation: { - _input: { - firstname: '#firstname', - lastname: '#lastname', - email_address: '#email_address', - password: '#password', - confirmation: '#confirmation', - } - } - } - } - } - } -} diff --git a/cypress/support/openmage/frontend/paths.js b/cypress/support/openmage/frontend/paths.js new file mode 100644 index 00000000000..caa7f50254a --- /dev/null +++ b/cypress/support/openmage/frontend/paths.js @@ -0,0 +1,29 @@ +cy.testFrontend = {}; + +cy.testFrontend.homepage = { + url: '/', +}; + +cy.testFrontend.homepage.newsletter = { + _buttonSubmit: '#newsletter-validate-detail button[type="submit"]', + _id: '#newsletter' +} + +cy.testFrontend.customer = {} +cy.testFrontend.customer.account = {}; + +cy.testFrontend.customer.account.create = { + h1: 'Create an Account', + url: '/customer/account/create', + _h1: 'h1', + _buttonSubmit: '#form-validate button[type="submit"]', + __validation: { + _input: { + firstname: '#firstname', + lastname: '#lastname', + email_address: '#email_address', + password: '#password', + confirmation: '#confirmation', + } + } +}