From 534476e95cf5d3dbc535b51b9b616d618468e5e6 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 5 Oct 2025 21:43:58 +0200 Subject: [PATCH 01/29] Updated cypress test --- .../openmage/backend/catalog/categories.cy.js | 13 +- .../openmage/backend/catalog/products.cy.js | 24 +- .../e2e/openmage/backend/catalog/search.cy.js | 24 +- .../openmage/backend/catalog/sitemap.cy.js | 24 +- .../backend/catalog/urlrewrites.cy.js | 24 +- cypress/e2e/openmage/backend/cms/block.cy.js | 24 +- cypress/e2e/openmage/backend/cms/page.cy.js | 68 +++- cypress/e2e/openmage/backend/cms/widget.cy.js | 24 +- .../openmage/backend/customer/customer.cy.js | 24 ++ .../e2e/openmage/backend/customer/group.cy.js | 12 - .../openmage/backend/customer/groups.cy.js | 24 ++ .../openmage/backend/customer/manage.cy.js | 12 - .../openmage/backend/customer/online.cy.js | 14 +- cypress/e2e/openmage/backend/dashboard.cy.js | 13 + .../openmage/backend/newsletter/queue.cy.js | 14 +- .../openmage/backend/newsletter/report.cy.js | 14 +- .../backend/newsletter/subscriber.cy.js | 14 +- .../backend/newsletter/templates.cy.js | 24 +- cypress/e2e/openmage/backend/promo/cart.cy.js | 12 - .../e2e/openmage/backend/promo/catalog.cy.js | 24 +- .../e2e/openmage/backend/promo/quote.cy.js | 24 ++ .../openmage/backend/sales/creditmemo.cy.js | 19 +- .../e2e/openmage/backend/sales/invoice.cy.js | 19 +- .../e2e/openmage/backend/sales/order.cy.js | 19 +- .../e2e/openmage/backend/sales/shipment.cy.js | 19 +- .../openmage/backend/sales/transactions.cy.js | 14 +- .../e2e/openmage/backend/system/cache.cy.js | 19 +- .../config/catalog/configswatches.cy.js | 6 +- .../system/config/catalog/sitemap.cy.js | 21 +- .../system/config/customers/promo.cy.js | 13 +- .../e2e/openmage/backend/system/design.cy.js | 24 +- .../e2e/openmage/backend/system/emails.cy.js | 24 +- .../e2e/openmage/backend/system/indexes.cy.js | 13 +- .../backend/system/manage-currency.cy.js | 34 +- .../openmage/backend/system/myacount.cy.js | 22 +- .../backend/system/notifications.cy.js | 13 +- .../e2e/openmage/backend/system/stores.cy.js | 13 +- .../openmage/backend/system/variable.cy.js | 24 +- .../frontend/customer/account/create.cy.js | 19 +- .../frontend/newsletter-subscribe.cy.js | 26 +- cypress/fixtures/example.json | 5 + cypress/support/commands.js | 18 +- cypress/support/e2e.js | 11 +- cypress/support/openmage.js | 56 ++- cypress/support/openmage/backend/catalog.js | 100 +++++ cypress/support/openmage/backend/cms.js | 101 +++++ cypress/support/openmage/backend/customer.js | 58 +++ cypress/support/openmage/backend/dashboard.js | 16 + .../support/openmage/backend/newsletter.js | 58 +++ cypress/support/openmage/backend/promo.js | 49 +++ cypress/support/openmage/backend/sales.js | 76 ++++ cypress/support/openmage/backend/system.js | 202 ++++++++++ cypress/support/openmage/config/paths.js | 346 ------------------ cypress/support/openmage/frontend/paths.js | 28 ++ 54 files changed, 1321 insertions(+), 614 deletions(-) create mode 100644 cypress/e2e/openmage/backend/customer/customer.cy.js delete mode 100644 cypress/e2e/openmage/backend/customer/group.cy.js create mode 100644 cypress/e2e/openmage/backend/customer/groups.cy.js delete mode 100644 cypress/e2e/openmage/backend/customer/manage.cy.js create mode 100644 cypress/e2e/openmage/backend/dashboard.cy.js delete mode 100644 cypress/e2e/openmage/backend/promo/cart.cy.js create mode 100644 cypress/e2e/openmage/backend/promo/quote.cy.js create mode 100644 cypress/fixtures/example.json create mode 100644 cypress/support/openmage/backend/catalog.js create mode 100644 cypress/support/openmage/backend/cms.js create mode 100644 cypress/support/openmage/backend/customer.js create mode 100644 cypress/support/openmage/backend/dashboard.js create mode 100644 cypress/support/openmage/backend/newsletter.js create mode 100644 cypress/support/openmage/backend/promo.js create mode 100644 cypress/support/openmage/backend/sales.js create mode 100644 cypress/support/openmage/backend/system.js delete mode 100644 cypress/support/openmage/config/paths.js create mode 100644 cypress/support/openmage/frontend/paths.js diff --git a/cypress/e2e/openmage/backend/catalog/categories.cy.js b/cypress/e2e/openmage/backend/catalog/categories.cy.js index ea55f3629f2..8350075e205 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.testBackendCatalog.categories; +const check = cy.openmage.check; -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`, () => { + check.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..4866d3e8508 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.testBackendCatalog.products; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', '905'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..a915f62581f 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.testBackendCatalog.search; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'classic'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..69c39c37e65 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.testBackendCatalog.sitemap; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + //tools.clickGridRow(test.index._grid, 'td', 'test'); + check.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..b007fc423b5 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.testBackendCatalog.urlrewrite; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', '116238'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..3a315c96aea 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.testBackendCms.block; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'category-landingpage-home'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..cd51f605d33 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -1,12 +1,70 @@ -const route = cy.testRoutes.backend.cms.page; +const test = cy.testBackendCms.page; +const check = cy.openmage.check; +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`, () => { + check.pageElements(test, test.index); }); + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.pageElements(test, test.new); + }); + + it('tests to disable a CMS page that is used in config', () => { + tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + + test.edit.disablePage(); + + tools.clickAction(test.edit.__buttons.saveAndContinue); + 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}); + }); + + it('tests to delete a CMS page that is used in config', () => { + tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + + tools.clickAction(test.edit.__buttons.delete); + validation.hasErrorMessage('Cannot delete page'); + cy.get('#messages').screenshot('error-delete-active-page', { overwrite: true}); + }); + + it('tests to add a CMS page', () => { + tools.clickAction(test.index.__buttons.add); + tools.clickAction(test.edit.__buttons.saveAndContinue); + + // @todo add validation for required fields + }); + + it('tests to un-asign a CMS page that is used in config', () => { + tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + + cy.log('Asign another store to the CMS page'); + cy.get('#page_store_id') + .select(4); + + tools.clickAction(test.edit.__buttons.saveAndContinue); + + // @todo: fix needed - this test passes because of a Magento bug + validation.hasSuccessMessage('The page has been saved.'); + + test.edit.resetStores(); + + tools.clickAction(test.edit.__buttons.saveAndContinue); + 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..2b3a7f27ddf 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.testBackendCms.widget; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'Couponing Block'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..afc2a4bedd8 --- /dev/null +++ b/cypress/e2e/openmage/backend/customer/customer.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendCustomer.customer; +const check = cy.openmage.check; +const tools = cy.openmage.tools; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + check.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', '424-555-0000'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..f7be987ed07 --- /dev/null +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendCustomer.groups; +const check = cy.openmage.check; +const tools = cy.openmage.tools; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + check.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'General'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..15615f98e65 100644 --- a/cypress/e2e/openmage/backend/customer/online.cy.js +++ b/cypress/e2e/openmage/backend/customer/online.cy.js @@ -1,12 +1,14 @@ -const route = cy.testRoutes.backend.customers.online; +const test = cy.testBackendCustomer.online; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.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..d8628ada56b --- /dev/null +++ b/cypress/e2e/openmage/backend/dashboard.cy.js @@ -0,0 +1,13 @@ +const test = cy.testBackendDashboard.dashboard; +const check = cy.openmage.check; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + check.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..bc911bc5aa8 100644 --- a/cypress/e2e/openmage/backend/newsletter/queue.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/queue.cy.js @@ -1,12 +1,14 @@ -const route = cy.testRoutes.backend.newsletter.queue; +const test = cy.testBackendNewsletter.queue; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.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..e4e70ee9be8 100644 --- a/cypress/e2e/openmage/backend/newsletter/report.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/report.cy.js @@ -1,12 +1,14 @@ -const route = cy.testRoutes.backend.newsletter.report; +const test = cy.testBackendNewsletter.report; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.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..0b3b1a440fb 100644 --- a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js @@ -1,12 +1,14 @@ -const route = cy.testRoutes.backend.newsletter.subscriber; +const test = cy.testBackendNewsletter.subscriber; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.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..653069524d3 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.testBackendNewsletter.templates; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'Example'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..69598bfb00e 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.testBackendPromo.catalog; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', 'Candle'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..1add1d77263 --- /dev/null +++ b/cypress/e2e/openmage/backend/promo/quote.cy.js @@ -0,0 +1,24 @@ +const test = cy.testBackendPromo.quote; +const check = cy.openmage.check; +const tools = cy.openmage.tools; + +describe(`Checks admin system "${test.index.title}"`, () => { + beforeEach('Log in the user', () => { + cy.adminLogIn(); + cy.adminGoToTestRoute(test, test.index); + }); + + it(`tests index route`, () => { + check.pageElements(test, test.index); + }); + + it(`tests edit route`, () => { + tools.clickGridRow(test.index._grid, 'td', '$500'); + check.pageElements(test, test.edit); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..3f73be4237e 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.testBackendSales.creditmemo; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickGridRow(test.index._grid, 'td', '100000007'); + check.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..08e484c64cf 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.testBackendSales.invoice; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickGridRow(test.index._grid, 'td', '100000040'); + check.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..8d91cb5f958 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.testBackendSales.order; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickGridRow(test.index._grid, 'td', '145000004'); + check.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..ef99e1953a5 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.testBackendSales.shipment; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests view route`, () => { + tools.clickGridRow(test.index._grid, 'td', '100000032'); + check.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..b76f9675f9d 100644 --- a/cypress/e2e/openmage/backend/sales/transactions.cy.js +++ b/cypress/e2e/openmage/backend/sales/transactions.cy.js @@ -1,12 +1,14 @@ -const route = cy.testRoutes.backend.sales.transactions; +const test = cy.testBackendSales.transactions; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.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..5dfa753e6f6 100644 --- a/cypress/e2e/openmage/backend/system/cache.cy.js +++ b/cypress/e2e/openmage/backend/system/cache.cy.js @@ -1,12 +1,19 @@ -const route = cy.testRoutes.backend.system.cache; +const test = cy.testBackendSystem.cache; +const check = cy.openmage.check; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + //it(`tests edit route`, () => { + //}); + + //it(`tests new route`, () => { + //}); +}); 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..e8ee65db089 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.testBackendSystem.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..70baca2772f 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.testBackendSystem.config.catalog.sitemap; +const saveButton = cy.testBackendSystem.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.clickAction(saveButton); validation.validateFields(priority, validation.number); }); it(`tests invalid number priority`, () => { validation.fillFields(priority, validation.numberRange, validation.test.numberGreater1); - validation.saveAction(saveButton); + tools.clickAction(saveButton); validation.validateFields(priority, validation.numberRange); }); it(`tests empty priority`, () => { validation.fillFields(priority, validation.requiredEntry); - validation.saveAction(saveButton); + tools.clickAction(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.clickAction(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..5cd2d2204c3 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.testBackendSystem.config.customers.promo; +const saveButton = cy.testBackendSystem.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.clickAction(saveButton); validation.validateFields(fields, validate); }); }); diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index ac61162fba7..34923ee4ee9 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.testBackendSystem.design; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + //tools.clickGridRow(test.index._grid, 'td', 'teset'); + check.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..1a8e4d88345 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.testBackendSystem.email; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + //tools.clickGridRow(test.index._grid, 'td', 'test'); + check.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.pageElements(test, test.new); + }); +}); diff --git a/cypress/e2e/openmage/backend/system/indexes.cy.js b/cypress/e2e/openmage/backend/system/indexes.cy.js index b79338afa83..243ef5d96cb 100644 --- a/cypress/e2e/openmage/backend/system/indexes.cy.js +++ b/cypress/e2e/openmage/backend/system/indexes.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.system.indexes; +const test = cy.testBackendSystem.indexes; +const check = cy.openmage.check; -describe(`Checks admin system "${route.h3}"`, () => { +describe(`Checks admin system "${test.list.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(route); + cy.adminGoToTestRoute(test, test.list); }); - it(`tests classes and title`, () => { - cy.adminTestRoute(route); + it(`tests index route`, () => { + check.pageElements(test, test.list); }); -}); \ 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 index 8f57d0c6c27..7e735e778f2 100644 --- a/cypress/e2e/openmage/backend/system/manage-currency.cy.js +++ b/cypress/e2e/openmage/backend/system/manage-currency.cy.js @@ -1,14 +1,16 @@ -const route = cy.testRoutes.backend.system.manage_curreny; +const test = cy.testBackendSystem.manage_curreny; +const check = cy.openmage.check; +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`, () => { + check.pageElements(test, test.index); }); const warning = 'Invalid input data for USD => EUR rate'; @@ -16,23 +18,23 @@ describe(`Checks admin system "${route.h3}"`, () => { 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); + if ($body.find(test.index.__validation._input.from).length > 0) { + cy.get(test.index.__validation._input.from).clear(); + tools.clickAction(test.index.__buttons.save); + validation.hasWarningMessage(warning); + validation.hasSuccessMessage(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); + if ($body.find(test.index.__validation._input.from).length > 0) { + cy.get(test.index.__validation._input.from).clear().type('abc'); + tools.clickAction(test.index.__buttons.save); + validation.hasWarningMessage(warning); + validation.hasSuccessMessage(success); } }); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/system/myacount.cy.js b/cypress/e2e/openmage/backend/system/myacount.cy.js index 00488494fdf..a119986b400 100644 --- a/cypress/e2e/openmage/backend/system/myacount.cy.js +++ b/cypress/e2e/openmage/backend/system/myacount.cy.js @@ -1,20 +1,22 @@ -const route = cy.testRoutes.backend.system.myaccount; +const test = cy.testBackendSystem.myaccount; +const check = cy.openmage.check; +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`, () => { + check.pageElements(test, test.index); }); 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); + const validate = validation.requiredEntry; + validation.fillFields(test.index.__validation._input, validate); + tools.clickAction(test.index.__buttons.save); + validation.validateFields(test.index.__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..5cd227bfc5a 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.testBackendSystem.notification; +const check = cy.openmage.check; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file +}); diff --git a/cypress/e2e/openmage/backend/system/stores.cy.js b/cypress/e2e/openmage/backend/system/stores.cy.js index 8d50c26d242..86a56ffb100 100644 --- a/cypress/e2e/openmage/backend/system/stores.cy.js +++ b/cypress/e2e/openmage/backend/system/stores.cy.js @@ -1,12 +1,13 @@ -const route = cy.testRoutes.backend.system.stores; +const test = cy.testBackendSystem.stores; +const check = cy.openmage.check; -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`, () => { + check.pageElements(test, test.index); }); -}); \ 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..43d0708a681 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.testBackendSystem.variables; +const check = cy.openmage.check; +const tools = cy.openmage.tools; -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`, () => { + check.pageElements(test, test.index); }); -}); \ No newline at end of file + + it(`tests edit route`, () => { + //tools.clickGridRow(test.index._grid, 'td', ''); + check.pageElements(test, test.index); + }); + + it(`tests new route`, () => { + tools.clickAction(test.index.__buttons.add); + check.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..c40ecdd9334 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.clickAction(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.clickAction(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,7 +33,7 @@ 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.clickAction(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.'); }); @@ -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.clickAction(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..a37d253c461 100644 --- a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js +++ b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js @@ -1,27 +1,29 @@ -const route = cy.testRoutes.frontend.homepage; +const test = cy.testFrontend.homepage; +const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe('Check newsletter subribe', () => { 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.clickAction(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 = tools.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.clickAction(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.clickAction(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..5e3d34c40b5 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,28 @@ 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); + cy.url().should('include', path.url); }) -Cypress.Commands.add('adminTestRoute', (route) => { +/** + * @deprecated Use cy.openmage.check.pageElements(test, path) instead + */ +Cypress.Commands.add('adminTestRoute', (route, path) => { cy.log('Checking for title'); - cy.get(route._h3).should('include.text', route.h3); + cy.get(route._h3).should('include.text', path.title); 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.log('Checking for existing buttons'); + Object.keys(path.__buttons).forEach(button => { + cy.get(path.__buttons[button]).should('exist'); + }); }) Cypress.Commands.add('adminGetConfiguration', (route) => { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index d19ff07ec62..b2c7690fc99 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -16,4 +16,13 @@ // Import commands.js using ES2015 syntax: import './commands' import './openmage' -import './openmage/config/paths' +import './openmage/backend/catalog' +import './openmage/backend/cms' +import './openmage/backend/customer' +import './openmage/backend/dashboard' +import './openmage/backend/newsletter' +import './openmage/backend/promo' +import './openmage/backend/sales' +import './openmage/backend/system' + +import './openmage/frontend/paths' diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index e4c67926cc9..5bbdd9ac49e 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -14,7 +14,45 @@ cy.openmage = { } } }, + check: { + buttons: (path) => { + cy.log('Checking for existing buttons'); + Object.keys(path.__buttons).forEach(button => { + cy.get(path.__buttons[button]).should('exist'); + }); + }, + pageElements: (test, path) => { + cy.log('Checking for title'); + cy.get(test._h3).should('include.text', path.title); + + cy.log('Checking for active parent class'); + cy.get(test._id_parent).should('have.class', 'active'); + + cy.log('Checking for active class'); + cy.get(test._id).should('have.class', 'active'); + + cy.log('Checking for existing grid'); + if (path._grid !== undefined) { + cy.get(path._grid).should('exist'); + } + + cy.log('Checking for existing buttons'); + if (path.__buttons !== undefined) { + Object.keys(path.__buttons).forEach(button => { + cy.get(path.__buttons[button]).should('exist'); + }); + } + }, + }, tools: { + clickAction: (selector, log = 'Clicking on button') => { + cy.log(log); + cy.get(selector).first().click({force: true, multiple: false}); + }, + clickGridRow: (grid, selector, content, log = 'Clicking on grid') => { + cy.log(log); + cy.get(grid).contains(selector, content).first().click({force: true, multiple: false}); + }, generateRandomEmail: () => { const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; let email = ''; @@ -22,7 +60,7 @@ cy.openmage = { email += chars.charAt(Math.floor(Math.random() * chars.length)); } return email + '-cypress-test@example.com'; - } + }, }, validation: { test: { @@ -80,10 +118,6 @@ cy.openmage = { .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 => { @@ -91,5 +125,17 @@ cy.openmage = { cy.get(selector).should('include.text', validation.error); }); }, + hasErrorMessage: (message) =>{ + cy.log('Checking for error messages'); + cy.get('.error-msg').should('include.text', message); + }, + hasSuccessMessage: (message) =>{ + cy.log('Checking for success messages'); + cy.get('.success-msg').should('include.text', message); + }, + hasWarningMessage: (message) =>{ + cy.log('Checking for warning messages'); + cy.get('.warning-msg').should('include.text', message); + }, } } \ No newline at end of file diff --git a/cypress/support/openmage/backend/catalog.js b/cypress/support/openmage/backend/catalog.js new file mode 100644 index 00000000000..809a017349d --- /dev/null +++ b/cypress/support/openmage/backend/catalog.js @@ -0,0 +1,100 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendCatalog = { + products: { + _id: '#nav-admin-catalog-products', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Products', + url: 'catalog_product/index', + _grid: '#productGrid_table', + __buttons: { + add: 'button[title="Add Product"]', + }, + }, + edit: { + title: 'Plaid Cotton', + url: 'catalog_product/edit', + }, + new: { + title: 'New Product', + url: 'catalog_product/new', + }, + }, + categories: { + _id: '#nav-admin-catalog-categories', + _id_parent: defaultConfig._id_parent, + _h3: '#category-edit-container ' + defaultConfig._h3, + index: { + title: 'New Root Category', + url: 'catalog_category/index', + }, + }, + search: { + _id: '#nav-admin-catalog-search', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Search', + url: 'catalog_search/index', + _grid: '#catalog_search_grid_table', + __buttons: { + add: '.form-buttons button[title="Add New Search Term"]', + }, + }, + edit: { + title: 'Edit Search', + url: 'catalog_search/edit', + }, + new: { + title: 'New Search', + url: 'catalog_search/new', + }, + }, + sitemap: { + _id: '#nav-admin-catalog-sitemap', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Google Sitemap', + url: 'sitemap/index', + _grid: '#sitemapGrid_table', + __buttons: { + add: '.form-buttons button[title="Add Sitemap"]', + }, + }, + edit: { + title: 'Edit Sitemap', + url: 'sitemap/edit', + }, + new: { + title: 'New Sitemap', + url: 'sitemap/edit', + }, + }, + urlrewrite: { + _id: '#nav-admin-catalog-urlrewrite', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'URL Rewrite Management', + url: 'urlrewrite/index', + _grid: '#urlrewriteGrid_table', + __buttons: { + add: '.form-buttons button[title="Add URL Rewrite"]', + }, + }, + edit: { + title: 'Edit URL Rewrite', + url: 'urlrewrite/edit', + }, + new: { + title: 'Add New URL Rewrite', + url: 'urlrewrite/edit', + }, + }, +} diff --git a/cypress/support/openmage/backend/cms.js b/cypress/support/openmage/backend/cms.js new file mode 100644 index 00000000000..cc8f606739f --- /dev/null +++ b/cypress/support/openmage/backend/cms.js @@ -0,0 +1,101 @@ +const defaultConfig = { + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + block: { + __fields: { + block_title : { + selector: '#block_title', + }, + block_identifier : { + selector: '#block_identifier', + }, + }, + }, +} + +cy.testBackendCms = { + block: { + _id: '#nav-admin-cms-block', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Static Blocks', + url: 'cms_block/index', + _grid: '#cmsBlockGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Block"]', + }, + }, + edit: { + title: 'Edit Block', + url: 'cms_block/new', + }, + new: { + title: 'New Block', + url: 'cms_block/new', + }, + }, + page: { + _id: '#nav-admin-cms-page', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Pages', + url: 'cms_page/index', + _grid: '#cmsPageGrid', + __buttons: { + add: '.form-buttons button[title="Add New Page"]', + }, + }, + edit: { + title: 'Edit Page', + url: 'cms_page/edit', + __buttons: { + delete: '.form-buttons button[title="Delete Page"]', + save: '.form-buttons button[title="Save Page"]', + saveAndContinue: '.form-buttons button[title="Save and Continue Edit"]', + reset: '.form-buttons button[title="Reset"]', + }, + disablePage: () => { + cy.log('Disable the CMS page'); + cy.get('#page_is_active') + .select('Disabled'); + }, + resetStores: () => { + cy.log('Restore the default store to the CMS page'); + cy.get('#page_store_id') + .select([1, 2, 3]); + }, + }, + new: { + title: 'New Page', + url: 'cms_page/new', + __buttons: { + save: '.form-buttons button[title="Save Page"]', + saveAndContinue: '.form-buttons button[title="Save and Continue Edit"]', + reset: '.form-buttons button[title="Reset"]', + }, + }, + }, + widget: { + _id: '#nav-admin-cms-widget_instance', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Widget Instances', + url: 'widget_instance/index', + _grid: '#widgetInstanceGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Widget Instance"]', + }, + }, + edit: { + title: 'Widget', + url: 'widget_instance/new', + }, + new: { + title: 'New Widget Instance', + url: 'widget_instance/new', + }, + } +} diff --git a/cypress/support/openmage/backend/customer.js b/cypress/support/openmage/backend/customer.js new file mode 100644 index 00000000000..443bef131b8 --- /dev/null +++ b/cypress/support/openmage/backend/customer.js @@ -0,0 +1,58 @@ +const defaultConfig = { + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', +} + +cy.testBackendCustomer = { + customer: { + _id: '#nav-admin-customer-manage', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Customers', + url: 'customer/index', + _grid: '#customerGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Customer"]', + }, + }, + edit: { + title: 'John Smith', + url: 'customer/edit', + }, + new: { + title: 'New Customer', + url: 'customer/new', + }, + }, + groups: { + _id: '#nav-admin-customer-group', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Customer Groups', + url: 'customer_group/index', + _grid: '#customerGroupGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Customer Group"]', + }, + }, + edit: { + title: 'Edit Customer Group', + url: 'customer_group/edit', + }, + new: { + title: 'New Customer Group', + url: 'customer_group/new', + }, + }, + online: { + _id: '#nav-admin-customer-online', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + 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..362feb6b870 --- /dev/null +++ b/cypress/support/openmage/backend/dashboard.js @@ -0,0 +1,16 @@ +const defaulfConfig = { + _id_parent: '#nav-admin-dashboard', + _h3: 'h3.head-dashboard', +} + +cy.testBackendDashboard = { + dashboard: { + _id: '#nav-admin-dashboard', + _id_parent: defaulfConfig._id_parent, + _h3: defaulfConfig._h3, + index: { + title: 'Dashboard', + url: 'dashboard/index', + }, + }, +} diff --git a/cypress/support/openmage/backend/newsletter.js b/cypress/support/openmage/backend/newsletter.js new file mode 100644 index 00000000000..9b4aeaebdad --- /dev/null +++ b/cypress/support/openmage/backend/newsletter.js @@ -0,0 +1,58 @@ +const defaultConfig = { + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletter = { + templates: { + _id: '#nav-admin-newsletter-template', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Newsletter Templates', + url: 'newsletter_template/index', + _grid: '#newsletterTemplateGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Template"]', + }, + }, + edit: { + title: 'Edit Newsletter Template', + url: 'newsletter_template/edit', + }, + new: { + title: 'New Newsletter Template', + url: 'newsletter_template/new', + }, + }, + queue: { + _id: '#nav-admin-newsletter-queue', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Newsletter Queue', + url: 'newsletter_queue/index', + _grid: '#queueGrid_table', + }, + }, + subscriber: { + _id: '#nav-admin-newsletter-subscriber', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Newsletter Subscribers', + url: 'newsletter_subscriber/index', + _grid: '#subscriberGrid_table', + }, + }, + report: { + _id: '#nav-admin-newsletter-problem', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Newsletter Problem Reports', + url: 'newsletter_problem/index', + _grid: '#problemGrid_table', + }, + }, +} diff --git a/cypress/support/openmage/backend/promo.js b/cypress/support/openmage/backend/promo.js new file mode 100644 index 00000000000..9126a20bb37 --- /dev/null +++ b/cypress/support/openmage/backend/promo.js @@ -0,0 +1,49 @@ +const defaultConfig = { + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', +} + +cy.testBackendPromo = { + catalog: { + _id: '#nav-admin-promo-catalog', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Catalog Price Rules', + url: 'promo_catalog/index', + _grid: '#promo_catalog_grid', + __buttons: { + add: '.form-buttons button[title="Add New Rule"]', + }, + }, + edit: { + title: 'Edit Rule', + url: 'promo_catalog/edit', + }, + new: { + title: 'New Rule', + url: 'promo_catalog/new', + }, + }, + quote: { + _id: '#nav-admin-promo-quote', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Shopping Cart Price Rules', + url: 'promo_quote/index', + _grid: '#promo_quote_grid_table', + __buttons: { + add: '.form-buttons button[title="Add New Rule"]', + }, + }, + edit: { + title: 'Edit Rule', + url: 'promo_quote/edit', + }, + new: { + title: 'New Rule', + url: 'promo_quote/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/sales.js b/cypress/support/openmage/backend/sales.js new file mode 100644 index 00000000000..97f9cc3f336 --- /dev/null +++ b/cypress/support/openmage/backend/sales.js @@ -0,0 +1,76 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSales = { + creditmemo: { + _id: '#nav-admin-sales-creditmemo', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Credit Memos', + url: 'sales_creditmemo/index', + _grid: '#sales_creditmemo_grid_table', + }, + view: { + title: 'Credit Memo #', + url: 'sales_creditmemo/edit', + }, + }, + invoice: { + _id: '#nav-admin-sales-invoice', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Invoice', + url: 'sales_invoice/index', + _grid: '#sales_invoice_grid_table', + }, + view: { + title: 'Invoice #', + url: 'sales_invoice/view', + }, + }, + order: { + _id: '#nav-admin-sales-order', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Orders', + url: 'sales_order/index', + _grid: '#sales_order_grid_table', + __buttons: { + new: '.form-buttons button[title="Create New Order"]', + }, + }, + view: { + title: 'Order #', + url: 'sales_order/view', + }, + }, + shipment: { + _id: '#nav-admin-sales-shipment', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Shipments', + url: 'sales_shipment/index', + _grid: '#sales_shipment_grid_table', + }, + view: { + title: 'Shipment #', + url: 'sales_shipment/view', + }, + }, + transactions: { + _id: '#nav-admin-sales-transactions', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Transactions', + url: 'sales_transactions/index', + _grid: '#order_transactions_table', + }, + }, +} diff --git a/cypress/support/openmage/backend/system.js b/cypress/support/openmage/backend/system.js new file mode 100644 index 00000000000..0646b203528 --- /dev/null +++ b/cypress/support/openmage/backend/system.js @@ -0,0 +1,202 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystem = { + cache: { + _id: '#nav-admin-system-cache', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Cache Storage Management', + url: 'cache/index', + _grid: '#cache_grid_table', + __buttons: { + flushApply: '.form-buttons button[title="Flush & Apply Updates"]', + flushCache: '.form-buttons button[title="Flush Cache Storage"]', + }, + }, + }, + design: { + _id: '#nav-admin-system-design', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Design', + url: 'system_design/index', + _grid: '#designGrid_table', + __buttons: { + add: '.form-buttons button[title="Add Design Change"]', + }, + }, + edit: { + title: 'Edit Design Change', + url: 'system_design/edit', + }, + new: { + title: 'New Design Change', + url: 'system_design/new', + }, + }, + email: { + _id: '#nav-admin-system-email_template', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Transactional Emails', + url: 'system_email_template/index', + _grid: '#systemEmailTemplateGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Template"]', + }, + }, + edit: { + title: 'Edit Email Template', + url: 'system_email_template/edit', + }, + new: { + title: 'New Email Template', + url: 'system_email_template/new', + }, + }, + myaccount: { + _id: '#nav-admin-system-myaccount', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'My Account', + url: 'system_account/index', + __buttons: { + save: '.form-buttons button[title="Save Account"]', + }, + __validation: { + _input: { + username: '#username', + firstname: '#firstname', + lastname: '#lastname', + email: '#email', + current_password: '#current_password', + } + } + + }, + }, + manage_curreny: { + _id: '#nav-admin-system-currency-rates', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Currency Rates', + url: 'system_currency/index', + __buttons: { + save: '.form-buttons button[title="Save Currency Rates"]', + }, + __validation: { + _input: { + from: 'input[name="rate[USD][EUR]"]', + } + } + }, + }, + notification: { + _id: '#nav-admin-system-adminnotification', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Messages Inbox', + url: 'notification/index', + _grid: '#notificationGrid_table', + }, + }, + indexes: { + _id: '#nav-admin-system-index', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + list: { + title: 'Index Management', + url: 'process/list', + _grid: '#indexer_processes_grid_table', + }, + }, + stores: { + _id: '#nav-admin-system-store', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Stores', + url: 'system_store/index', + __buttons: { + addWebsite: '.form-buttons button[title="Create Website"]', + addStore: '.form-buttons button[title="Create Store"]', + addStoreView: '.form-buttons button[title="Create Store View"]', + }, + }, + }, + variables: { + _id: '#nav-admin-system-variable', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Custom Variables', + url: 'system_variable/index', + _grid: '#customVariablesGrid', + __buttons: { + add: '.form-buttons button[title="Add New Variable"]', + }, + }, + edit: { + title: 'Custom Variable', + url: 'system_variable/edit', + }, + new: { + title: 'New Custom Variable', + url: 'system_variable/new', + }, + }, + config: { + _buttonSave: '.form-buttons button[title="Save Config"]', + catalog: { + configswatches: { + _id: '#section-configswatches', + url: 'system_config/edit/section/configswatches', + h3: 'Configurable Swatches', + _h3: defaultConfig._h3, + }, + sitemap: { + _id: '#section-sitemap', + url: 'system_config/edit/section/sitemap', + h3: 'Google Sitemap', + _h3: defaultConfig._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: defaultConfig._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/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..3f3969f108c --- /dev/null +++ b/cypress/support/openmage/frontend/paths.js @@ -0,0 +1,28 @@ +cy.testFrontend = { + 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', + } + } + } + } + } +} From 7b8a044fd5838bbe42ca74ef2c82ef0e8f77577b Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 5 Oct 2025 22:16:48 +0200 Subject: [PATCH 02/29] typo --- cypress/e2e/openmage/backend/system/myacount.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/e2e/openmage/backend/system/myacount.cy.js b/cypress/e2e/openmage/backend/system/myacount.cy.js index a119986b400..cada0a74b08 100644 --- a/cypress/e2e/openmage/backend/system/myacount.cy.js +++ b/cypress/e2e/openmage/backend/system/myacount.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSystem.myaccount; const check = cy.openmage.check; -tools +const tools = cy.openmage.tools; const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { From d29866a17266e02b2489b1d60c51b10d5ae898a1 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 5 Oct 2025 22:19:38 +0200 Subject: [PATCH 03/29] template fix --- .../default/default/template/newsletter/template/list.phtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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'); ?> + From b58631aa3376f2f383cc4ae98b0a7004efa35b88 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 5 Oct 2025 22:22:26 +0200 Subject: [PATCH 04/29] disabled test - requires updated sample data --- cypress/e2e/openmage/backend/cms/page.cy.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/e2e/openmage/backend/cms/page.cy.js b/cypress/e2e/openmage/backend/cms/page.cy.js index cd51f605d33..56c772de476 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -52,14 +52,14 @@ describe(`Checks admin system "${test.index.title}"`, () => { it('tests to un-asign a CMS page that is used in config', () => { tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); - cy.log('Asign another store to the CMS page'); - cy.get('#page_store_id') - .select(4); + //cy.log('Asign another store to the CMS page'); + //cy.get('#page_store_id') + // .select(4); - tools.clickAction(test.edit.__buttons.saveAndContinue); + //tools.clickAction(test.edit.__buttons.saveAndContinue); // @todo: fix needed - this test passes because of a Magento bug - validation.hasSuccessMessage('The page has been saved.'); + //validation.hasSuccessMessage('The page has been saved.'); test.edit.resetStores(); From 7d400ec740055f6b5c321e24b09097627ca35d85 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 5 Oct 2025 23:15:14 +0200 Subject: [PATCH 05/29] fixes --- .../{myacount.cy.js => myaccount.cy.js} | 0 .../frontend/newsletter-subscribe.cy.js | 2 +- cypress/support/commands.js | 19 ------------------- cypress/support/openmage.js | 8 +++++--- cypress/support/openmage/backend/cms.js | 4 ++-- cypress/support/openmage/backend/dashboard.js | 6 +++--- 6 files changed, 11 insertions(+), 28 deletions(-) rename cypress/e2e/openmage/backend/system/{myacount.cy.js => myaccount.cy.js} (100%) diff --git a/cypress/e2e/openmage/backend/system/myacount.cy.js b/cypress/e2e/openmage/backend/system/myaccount.cy.js similarity index 100% rename from cypress/e2e/openmage/backend/system/myacount.cy.js rename to cypress/e2e/openmage/backend/system/myaccount.cy.js diff --git a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js index a37d253c461..a539da446ed 100644 --- a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js +++ b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js @@ -2,7 +2,7 @@ const test = cy.testFrontend.homepage; const tools = cy.openmage.tools; const validation = cy.openmage.validation; -describe('Check newsletter subribe', () => { +describe('Check newsletter subscribe', () => { beforeEach('Go to page', () => { cy.visit(test.url); }); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 5e3d34c40b5..61168436830 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -27,25 +27,6 @@ Cypress.Commands.add('adminGoToTestRoute', (route, path) => { cy.url().should('include', path.url); }) -/** - * @deprecated Use cy.openmage.check.pageElements(test, path) instead - */ -Cypress.Commands.add('adminTestRoute', (route, path) => { - cy.log('Checking for title'); - cy.get(route._h3).should('include.text', path.title); - - 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.log('Checking for existing buttons'); - Object.keys(path.__buttons).forEach(button => { - cy.get(path.__buttons[button]).should('exist'); - }); -}) - Cypress.Commands.add('adminGetConfiguration', (route) => { cy.get('#nav-admin-system-config').click({force: true}); cy.url().should('include', 'system_config/index'); diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 5bbdd9ac49e..0d6e042e28e 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -17,9 +17,11 @@ cy.openmage = { check: { buttons: (path) => { cy.log('Checking for existing buttons'); - Object.keys(path.__buttons).forEach(button => { - cy.get(path.__buttons[button]).should('exist'); - }); + if (path.__buttons !== undefined) { + Object.keys(path.__buttons).forEach(button => { + cy.get(path.__buttons[button]).should('exist'); + }); + } }, pageElements: (test, path) => { cy.log('Checking for title'); diff --git a/cypress/support/openmage/backend/cms.js b/cypress/support/openmage/backend/cms.js index cc8f606739f..42dfa9f1826 100644 --- a/cypress/support/openmage/backend/cms.js +++ b/cypress/support/openmage/backend/cms.js @@ -28,7 +28,7 @@ cy.testBackendCms = { }, edit: { title: 'Edit Block', - url: 'cms_block/new', + url: 'cms_block/edit', }, new: { title: 'New Block', @@ -91,7 +91,7 @@ cy.testBackendCms = { }, edit: { title: 'Widget', - url: 'widget_instance/new', + url: 'widget_instance/edit', }, new: { title: 'New Widget Instance', diff --git a/cypress/support/openmage/backend/dashboard.js b/cypress/support/openmage/backend/dashboard.js index 362feb6b870..2e1e4469e84 100644 --- a/cypress/support/openmage/backend/dashboard.js +++ b/cypress/support/openmage/backend/dashboard.js @@ -1,4 +1,4 @@ -const defaulfConfig = { +const defaultConfig = { _id_parent: '#nav-admin-dashboard', _h3: 'h3.head-dashboard', } @@ -6,8 +6,8 @@ const defaulfConfig = { cy.testBackendDashboard = { dashboard: { _id: '#nav-admin-dashboard', - _id_parent: defaulfConfig._id_parent, - _h3: defaulfConfig._h3, + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, index: { title: 'Dashboard', url: 'dashboard/index', From 73164cf9cdc9352b2aaf060e92e26f521a6060a0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 02:29:58 +0200 Subject: [PATCH 06/29] updated tests --- .../openmage/backend/catalog/categories.cy.js | 2 +- .../openmage/backend/catalog/products.cy.js | 2 +- .../e2e/openmage/backend/catalog/search.cy.js | 2 +- .../openmage/backend/catalog/sitemap.cy.js | 2 +- .../backend/catalog/urlrewrites.cy.js | 2 +- cypress/e2e/openmage/backend/cms/block.cy.js | 2 +- cypress/e2e/openmage/backend/cms/page.cy.js | 2 +- cypress/e2e/openmage/backend/cms/widget.cy.js | 2 +- .../openmage/backend/customer/customer.cy.js | 2 +- .../openmage/backend/customer/groups.cy.js | 2 +- .../openmage/backend/customer/online.cy.js | 2 +- .../openmage/backend/newsletter/queue.cy.js | 2 +- .../openmage/backend/newsletter/report.cy.js | 2 +- .../backend/newsletter/subscriber.cy.js | 2 +- .../backend/newsletter/templates.cy.js | 2 +- .../e2e/openmage/backend/promo/catalog.cy.js | 2 +- .../e2e/openmage/backend/promo/quote.cy.js | 2 +- .../openmage/backend/sales/creditmemo.cy.js | 2 +- .../e2e/openmage/backend/sales/invoice.cy.js | 2 +- .../e2e/openmage/backend/sales/order.cy.js | 2 +- .../e2e/openmage/backend/sales/shipment.cy.js | 2 +- .../openmage/backend/sales/transactions.cy.js | 2 +- .../e2e/openmage/backend/system/cache.cy.js | 8 +- .../config/catalog/configswatches.cy.js | 2 +- .../system/config/catalog/sitemap.cy.js | 4 +- .../{manage-currency.cy.js => currency.cy.js} | 2 +- .../e2e/openmage/backend/system/design.cy.js | 2 +- .../e2e/openmage/backend/system/emails.cy.js | 2 +- .../system/{indexes.cy.js => index.cy.js} | 2 +- .../{myaccount.cy.js => my-account.cy.js} | 2 +- .../backend/system/notifications.cy.js | 2 +- .../system/{stores.cy.js => store.cy.js} | 2 +- .../openmage/backend/system/variable.cy.js | 2 +- cypress/support/e2e.js | 22 +- cypress/support/openmage.js | 23 +- cypress/support/openmage/backend/catalog.js | 100 --------- .../openmage/backend/catalog/categories.js | 16 ++ .../openmage/backend/catalog/products.js | 28 +++ .../openmage/backend/catalog/search.js | 28 +++ .../openmage/backend/catalog/sitemap.js | 28 +++ .../openmage/backend/catalog/urlrewrite.js | 28 +++ cypress/support/openmage/backend/cms/block.js | 47 ++++ .../openmage/backend/{cms.js => cms/page.js} | 56 +---- .../support/openmage/backend/cms/widget.js | 28 +++ .../backend/{ => customer}/customer.js | 4 +- .../openmage/backend/customer/groups.js | 28 +++ .../openmage/backend/customer/online.js | 16 ++ .../support/openmage/backend/newsletter.js | 58 ----- .../openmage/backend/newsletter/queue.js | 17 ++ .../openmage/backend/newsletter/report.js | 17 ++ .../openmage/backend/newsletter/subscriber.js | 17 ++ .../openmage/backend/newsletter/templates.js | 28 +++ .../support/openmage/backend/promo/catalog.js | 28 +++ .../backend/{promo.js => promo/quote.js} | 25 +-- cypress/support/openmage/backend/sales.js | 76 ------- .../openmage/backend/sales/creditmemo.js | 21 ++ .../support/openmage/backend/sales/invoice.js | 21 ++ .../support/openmage/backend/sales/order.js | 24 +++ .../openmage/backend/sales/shipment.js | 21 ++ .../openmage/backend/sales/transactions.js | 17 ++ cypress/support/openmage/backend/system.js | 202 ------------------ .../backend/system/adminnotification.js | 17 ++ .../support/openmage/backend/system/cache.js | 21 ++ .../support/openmage/backend/system/config.js | 52 +++++ .../openmage/backend/system/currency.js | 24 +++ .../support/openmage/backend/system/design.js | 28 +++ .../support/openmage/backend/system/emails.js | 28 +++ .../support/openmage/backend/system/index.js | 17 ++ .../openmage/backend/system/my-account.js | 28 +++ .../support/openmage/backend/system/store.js | 21 ++ .../openmage/backend/system/variable.js | 28 +++ 71 files changed, 798 insertions(+), 564 deletions(-) rename cypress/e2e/openmage/backend/system/{manage-currency.cy.js => currency.cy.js} (96%) rename cypress/e2e/openmage/backend/system/{indexes.cy.js => index.cy.js} (86%) rename cypress/e2e/openmage/backend/system/{myaccount.cy.js => my-account.cy.js} (93%) rename cypress/e2e/openmage/backend/system/{stores.cy.js => store.cy.js} (87%) delete mode 100644 cypress/support/openmage/backend/catalog.js create mode 100644 cypress/support/openmage/backend/catalog/categories.js create mode 100644 cypress/support/openmage/backend/catalog/products.js create mode 100644 cypress/support/openmage/backend/catalog/search.js create mode 100644 cypress/support/openmage/backend/catalog/sitemap.js create mode 100644 cypress/support/openmage/backend/catalog/urlrewrite.js create mode 100644 cypress/support/openmage/backend/cms/block.js rename cypress/support/openmage/backend/{cms.js => cms/page.js} (51%) create mode 100644 cypress/support/openmage/backend/cms/widget.js rename cypress/support/openmage/backend/{ => customer}/customer.js (96%) create mode 100644 cypress/support/openmage/backend/customer/groups.js create mode 100644 cypress/support/openmage/backend/customer/online.js delete mode 100644 cypress/support/openmage/backend/newsletter.js create mode 100644 cypress/support/openmage/backend/newsletter/queue.js create mode 100644 cypress/support/openmage/backend/newsletter/report.js create mode 100644 cypress/support/openmage/backend/newsletter/subscriber.js create mode 100644 cypress/support/openmage/backend/newsletter/templates.js create mode 100644 cypress/support/openmage/backend/promo/catalog.js rename cypress/support/openmage/backend/{promo.js => promo/quote.js} (51%) delete mode 100644 cypress/support/openmage/backend/sales.js create mode 100644 cypress/support/openmage/backend/sales/creditmemo.js create mode 100644 cypress/support/openmage/backend/sales/invoice.js create mode 100644 cypress/support/openmage/backend/sales/order.js create mode 100644 cypress/support/openmage/backend/sales/shipment.js create mode 100644 cypress/support/openmage/backend/sales/transactions.js delete mode 100644 cypress/support/openmage/backend/system.js create mode 100644 cypress/support/openmage/backend/system/adminnotification.js create mode 100644 cypress/support/openmage/backend/system/cache.js create mode 100644 cypress/support/openmage/backend/system/config.js create mode 100644 cypress/support/openmage/backend/system/currency.js create mode 100644 cypress/support/openmage/backend/system/design.js create mode 100644 cypress/support/openmage/backend/system/emails.js create mode 100644 cypress/support/openmage/backend/system/index.js create mode 100644 cypress/support/openmage/backend/system/my-account.js create mode 100644 cypress/support/openmage/backend/system/store.js create mode 100644 cypress/support/openmage/backend/system/variable.js diff --git a/cypress/e2e/openmage/backend/catalog/categories.cy.js b/cypress/e2e/openmage/backend/catalog/categories.cy.js index 8350075e205..6e42c266b79 100644 --- a/cypress/e2e/openmage/backend/catalog/categories.cy.js +++ b/cypress/e2e/openmage/backend/catalog/categories.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCatalog.categories; +const test = cy.testBackendCatalogProductsCategories.config; const check = cy.openmage.check; describe(`Checks admin system "${test.index.title}"`, () => { diff --git a/cypress/e2e/openmage/backend/catalog/products.cy.js b/cypress/e2e/openmage/backend/catalog/products.cy.js index 4866d3e8508..88489ab12ad 100644 --- a/cypress/e2e/openmage/backend/catalog/products.cy.js +++ b/cypress/e2e/openmage/backend/catalog/products.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCatalog.products; +const test = cy.testBackendCatalogProducts.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/catalog/search.cy.js b/cypress/e2e/openmage/backend/catalog/search.cy.js index a915f62581f..5b6e7afaaee 100644 --- a/cypress/e2e/openmage/backend/catalog/search.cy.js +++ b/cypress/e2e/openmage/backend/catalog/search.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCatalog.search; +const test = cy.testBackendCatalogSearch.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index 69c39c37e65..0e9c32a9fa5 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCatalog.sitemap; +const test = cy.testBackendCatalogSitemap.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js index b007fc423b5..fbbe31e24f9 100644 --- a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js +++ b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCatalog.urlrewrite; +const test = cy.testBackendUrlrewrite.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/cms/block.cy.js b/cypress/e2e/openmage/backend/cms/block.cy.js index 3a315c96aea..2c1c6df83e2 100644 --- a/cypress/e2e/openmage/backend/cms/block.cy.js +++ b/cypress/e2e/openmage/backend/cms/block.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCms.block; +const test = cy.testBackendCmsBlock.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/cms/page.cy.js b/cypress/e2e/openmage/backend/cms/page.cy.js index 56c772de476..1f247e39a8d 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCms.page; +const test = cy.testBackendCmsPage.config; const check = cy.openmage.check; const tools = cy.openmage.tools; const validation = cy.openmage.validation; diff --git a/cypress/e2e/openmage/backend/cms/widget.cy.js b/cypress/e2e/openmage/backend/cms/widget.cy.js index 2b3a7f27ddf..d7a2dfcd88e 100644 --- a/cypress/e2e/openmage/backend/cms/widget.cy.js +++ b/cypress/e2e/openmage/backend/cms/widget.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCms.widget; +const test = cy.testBackendCmsWidget.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/customer/customer.cy.js b/cypress/e2e/openmage/backend/customer/customer.cy.js index afc2a4bedd8..2c220548005 100644 --- a/cypress/e2e/openmage/backend/customer/customer.cy.js +++ b/cypress/e2e/openmage/backend/customer/customer.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCustomer.customer; +const test = cy.testBackendCustomerCustomer.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js index f7be987ed07..dc6b8053338 100644 --- a/cypress/e2e/openmage/backend/customer/groups.cy.js +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCustomer.groups; +const test = cy.testBackendCustomerGroups.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/customer/online.cy.js b/cypress/e2e/openmage/backend/customer/online.cy.js index 15615f98e65..0225a24d19a 100644 --- a/cypress/e2e/openmage/backend/customer/online.cy.js +++ b/cypress/e2e/openmage/backend/customer/online.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendCustomer.online; +const test = cy.testBackendCustomerOnline.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/newsletter/queue.cy.js b/cypress/e2e/openmage/backend/newsletter/queue.cy.js index bc911bc5aa8..8f151d6d068 100644 --- a/cypress/e2e/openmage/backend/newsletter/queue.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/queue.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendNewsletter.queue; +const test = cy.testBackendNewsletterQueue.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/newsletter/report.cy.js b/cypress/e2e/openmage/backend/newsletter/report.cy.js index e4e70ee9be8..775ce3c416b 100644 --- a/cypress/e2e/openmage/backend/newsletter/report.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/report.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendNewsletter.report; +const test = cy.testBackendNewsletterReport.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js index 0b3b1a440fb..8f2c1edfb5d 100644 --- a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendNewsletter.subscriber; +const test = cy.testBackendNewsletterSubscriber.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/newsletter/templates.cy.js b/cypress/e2e/openmage/backend/newsletter/templates.cy.js index 653069524d3..95d5f08a071 100644 --- a/cypress/e2e/openmage/backend/newsletter/templates.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/templates.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendNewsletter.templates; +const test = cy.testBackendNewsletterTemplates.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/promo/catalog.cy.js b/cypress/e2e/openmage/backend/promo/catalog.cy.js index 69598bfb00e..c95590f8f4e 100644 --- a/cypress/e2e/openmage/backend/promo/catalog.cy.js +++ b/cypress/e2e/openmage/backend/promo/catalog.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendPromo.catalog; +const test = cy.testBackendPromoCatalog.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/promo/quote.cy.js b/cypress/e2e/openmage/backend/promo/quote.cy.js index 1add1d77263..f6605ca124c 100644 --- a/cypress/e2e/openmage/backend/promo/quote.cy.js +++ b/cypress/e2e/openmage/backend/promo/quote.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendPromo.quote; +const test = cy.testBackendPromoQuote.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js index 3f73be4237e..941698eab45 100644 --- a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js +++ b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSales.creditmemo; +const test = cy.testBackendSalesCreditmemo.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/sales/invoice.cy.js b/cypress/e2e/openmage/backend/sales/invoice.cy.js index 08e484c64cf..b056d8e87fa 100644 --- a/cypress/e2e/openmage/backend/sales/invoice.cy.js +++ b/cypress/e2e/openmage/backend/sales/invoice.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSales.invoice; +const test = cy.testBackendSalesInvoice.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/sales/order.cy.js b/cypress/e2e/openmage/backend/sales/order.cy.js index 8d91cb5f958..0970bc51e88 100644 --- a/cypress/e2e/openmage/backend/sales/order.cy.js +++ b/cypress/e2e/openmage/backend/sales/order.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSales.order; +const test = cy.testBackendSalesOrder.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/sales/shipment.cy.js b/cypress/e2e/openmage/backend/sales/shipment.cy.js index ef99e1953a5..fe06c89e0e9 100644 --- a/cypress/e2e/openmage/backend/sales/shipment.cy.js +++ b/cypress/e2e/openmage/backend/sales/shipment.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSales.shipment; +const test = cy.testBackendSalesOrderShipment.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/sales/transactions.cy.js b/cypress/e2e/openmage/backend/sales/transactions.cy.js index b76f9675f9d..7ea28355387 100644 --- a/cypress/e2e/openmage/backend/sales/transactions.cy.js +++ b/cypress/e2e/openmage/backend/sales/transactions.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSales.transactions; +const test = cy.testBackendSalesTransactions.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/system/cache.cy.js b/cypress/e2e/openmage/backend/system/cache.cy.js index 5dfa753e6f6..78e7d935e20 100644 --- a/cypress/e2e/openmage/backend/system/cache.cy.js +++ b/cypress/e2e/openmage/backend/system/cache.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.cache; +const test = cy.testBackendSystemCache.config; const check = cy.openmage.check; describe(`Checks admin system "${test.index.title}"`, () => { @@ -10,10 +10,4 @@ describe(`Checks admin system "${test.index.title}"`, () => { it(`tests index route`, () => { check.pageElements(test, test.index); }); - - //it(`tests edit route`, () => { - //}); - - //it(`tests new route`, () => { - //}); }); 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 e8ee65db089..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 test = cy.testBackendSystem.config.catalog.configswatches; +const test = cy.testBackendSystemConfig.config.catalog.configswatches; const validate = { dimension: { _input: { 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 70baca2772f..a69064e117a 100644 --- a/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js @@ -1,5 +1,5 @@ -const test = cy.testBackendSystem.config.catalog.sitemap; -const saveButton = cy.testBackendSystem.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; diff --git a/cypress/e2e/openmage/backend/system/manage-currency.cy.js b/cypress/e2e/openmage/backend/system/currency.cy.js similarity index 96% rename from cypress/e2e/openmage/backend/system/manage-currency.cy.js rename to cypress/e2e/openmage/backend/system/currency.cy.js index 7e735e778f2..a3c1a84f068 100644 --- a/cypress/e2e/openmage/backend/system/manage-currency.cy.js +++ b/cypress/e2e/openmage/backend/system/currency.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.manage_curreny; +const test = cy.testBackendSystemCurrencyRates.config; const check = cy.openmage.check; const tools = cy.openmage.tools; const validation = cy.openmage.validation; diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index 34923ee4ee9..0a75be0f4e2 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.design; +const test = cy.testBackendSystemDesign.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 1a8e4d88345..279f6e245da 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.email; +const test = cy.testBackendSystemEmailTemplate.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/e2e/openmage/backend/system/indexes.cy.js b/cypress/e2e/openmage/backend/system/index.cy.js similarity index 86% rename from cypress/e2e/openmage/backend/system/indexes.cy.js rename to cypress/e2e/openmage/backend/system/index.cy.js index 243ef5d96cb..28e7641ba79 100644 --- a/cypress/e2e/openmage/backend/system/indexes.cy.js +++ b/cypress/e2e/openmage/backend/system/index.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.indexes; +const test = cy.testBackendSystemIndex.config; const check = cy.openmage.check; describe(`Checks admin system "${test.list.title}"`, () => { diff --git a/cypress/e2e/openmage/backend/system/myaccount.cy.js b/cypress/e2e/openmage/backend/system/my-account.cy.js similarity index 93% rename from cypress/e2e/openmage/backend/system/myaccount.cy.js rename to cypress/e2e/openmage/backend/system/my-account.cy.js index cada0a74b08..982af5e1327 100644 --- a/cypress/e2e/openmage/backend/system/myaccount.cy.js +++ b/cypress/e2e/openmage/backend/system/my-account.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.myaccount; +const test = cy.testBackendSystemMyAccount.config; const check = cy.openmage.check; const tools = cy.openmage.tools; const validation = cy.openmage.validation; diff --git a/cypress/e2e/openmage/backend/system/notifications.cy.js b/cypress/e2e/openmage/backend/system/notifications.cy.js index 5cd227bfc5a..315ca293951 100644 --- a/cypress/e2e/openmage/backend/system/notifications.cy.js +++ b/cypress/e2e/openmage/backend/system/notifications.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.notification; +const test = cy.testBackendSystemAdminnotification.config; const check = cy.openmage.check; describe(`Checks admin system "${test.index.title}"`, () => { diff --git a/cypress/e2e/openmage/backend/system/stores.cy.js b/cypress/e2e/openmage/backend/system/store.cy.js similarity index 87% rename from cypress/e2e/openmage/backend/system/stores.cy.js rename to cypress/e2e/openmage/backend/system/store.cy.js index 86a56ffb100..f7e8dd48cfb 100644 --- a/cypress/e2e/openmage/backend/system/stores.cy.js +++ b/cypress/e2e/openmage/backend/system/store.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.stores; +const test = cy.testBackendSystemStore.config; const check = cy.openmage.check; describe(`Checks admin system "${test.index.title}"`, () => { diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 43d0708a681..480f09e00d6 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendSystem.variables; +const test = cy.testBackendSystemVariable.config; const check = cy.openmage.check; const tools = cy.openmage.tools; diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index b2c7690fc99..ec6d3289171 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -17,12 +17,24 @@ import './commands' import './openmage' import './openmage/backend/catalog' -import './openmage/backend/cms' -import './openmage/backend/customer' +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' -import './openmage/backend/promo' -import './openmage/backend/sales' +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' import './openmage/frontend/paths' diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 0d6e042e28e..b3d305d7864 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -15,14 +15,22 @@ cy.openmage = { } }, check: { - buttons: (path) => { - cy.log('Checking for existing buttons'); + buttons: (path, log = 'Checking for existing buttons') => { + cy.log(log); if (path.__buttons !== undefined) { Object.keys(path.__buttons).forEach(button => { cy.get(path.__buttons[button]).should('exist'); }); } }, + fields: (path, log = 'Checking for existing fields') => { + cy.log(log); + if (path.__fields !== undefined) { + Object.keys(path.__fields).forEach(field => { + cy.get(path.__fields[field]).should('exist'); + }); + } + }, pageElements: (test, path) => { cy.log('Checking for title'); cy.get(test._h3).should('include.text', path.title); @@ -33,17 +41,24 @@ cy.openmage = { cy.log('Checking for active class'); cy.get(test._id).should('have.class', 'active'); - cy.log('Checking for existing grid'); if (path._grid !== undefined) { + cy.log('Checking for existing grid'); cy.get(path._grid).should('exist'); } - cy.log('Checking for existing buttons'); if (path.__buttons !== undefined) { + cy.log('Checking for existing buttons'); Object.keys(path.__buttons).forEach(button => { cy.get(path.__buttons[button]).should('exist'); }); } + + if (path.__fields !== undefined) { + cy.log('Checking for existing fields'); + Object.keys(path.__fields).forEach(field => { + cy.get(path.__fields[field].selector).should('exist'); + }); + } }, }, tools: { diff --git a/cypress/support/openmage/backend/catalog.js b/cypress/support/openmage/backend/catalog.js deleted file mode 100644 index 809a017349d..00000000000 --- a/cypress/support/openmage/backend/catalog.js +++ /dev/null @@ -1,100 +0,0 @@ -const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', -} - -cy.testBackendCatalog = { - products: { - _id: '#nav-admin-catalog-products', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Manage Products', - url: 'catalog_product/index', - _grid: '#productGrid_table', - __buttons: { - add: 'button[title="Add Product"]', - }, - }, - edit: { - title: 'Plaid Cotton', - url: 'catalog_product/edit', - }, - new: { - title: 'New Product', - url: 'catalog_product/new', - }, - }, - categories: { - _id: '#nav-admin-catalog-categories', - _id_parent: defaultConfig._id_parent, - _h3: '#category-edit-container ' + defaultConfig._h3, - index: { - title: 'New Root Category', - url: 'catalog_category/index', - }, - }, - search: { - _id: '#nav-admin-catalog-search', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Search', - url: 'catalog_search/index', - _grid: '#catalog_search_grid_table', - __buttons: { - add: '.form-buttons button[title="Add New Search Term"]', - }, - }, - edit: { - title: 'Edit Search', - url: 'catalog_search/edit', - }, - new: { - title: 'New Search', - url: 'catalog_search/new', - }, - }, - sitemap: { - _id: '#nav-admin-catalog-sitemap', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Google Sitemap', - url: 'sitemap/index', - _grid: '#sitemapGrid_table', - __buttons: { - add: '.form-buttons button[title="Add Sitemap"]', - }, - }, - edit: { - title: 'Edit Sitemap', - url: 'sitemap/edit', - }, - new: { - title: 'New Sitemap', - url: 'sitemap/edit', - }, - }, - urlrewrite: { - _id: '#nav-admin-catalog-urlrewrite', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'URL Rewrite Management', - url: 'urlrewrite/index', - _grid: '#urlrewriteGrid_table', - __buttons: { - add: '.form-buttons button[title="Add URL Rewrite"]', - }, - }, - edit: { - title: 'Edit URL Rewrite', - url: 'urlrewrite/edit', - }, - new: { - title: 'Add New URL Rewrite', - url: 'urlrewrite/edit', - }, - }, -} diff --git a/cypress/support/openmage/backend/catalog/categories.js b/cypress/support/openmage/backend/catalog/categories.js new file mode 100644 index 00000000000..458a70fbb1e --- /dev/null +++ b/cypress/support/openmage/backend/catalog/categories.js @@ -0,0 +1,16 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendCatalogProductsCategories = { + config: { + _id: '#nav-admin-catalog-categories', + _id_parent: defaultConfig._id_parent, + _h3: '#category-edit-container ' + defaultConfig._h3, + index: { + title: 'New Root Category', + url: 'catalog_category/index', + }, + }, +} diff --git a/cypress/support/openmage/backend/catalog/products.js b/cypress/support/openmage/backend/catalog/products.js new file mode 100644 index 00000000000..9b2404c5b90 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/products.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendCatalogProducts = { + config: { + _id: '#nav-admin-catalog-products', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Products', + url: 'catalog_product/index', + _grid: '#productGrid_table', + __buttons: { + add: 'button[title="Add Product"]', + }, + }, + edit: { + title: 'Plaid Cotton', + url: 'catalog_product/edit', + }, + 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..1b6c5c20f7c --- /dev/null +++ b/cypress/support/openmage/backend/catalog/search.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendCatalogSearch = { + config: { + _id: '#nav-admin-catalog-search', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Search', + url: 'catalog_search/index', + _grid: '#catalog_search_grid_table', + __buttons: { + add: '.form-buttons button[title="Add New Search Term"]', + }, + }, + edit: { + title: 'Edit Search', + url: 'catalog_search/edit', + }, + new: { + title: 'New Search', + url: 'catalog_search/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/catalog/sitemap.js b/cypress/support/openmage/backend/catalog/sitemap.js new file mode 100644 index 00000000000..50ddca86c0d --- /dev/null +++ b/cypress/support/openmage/backend/catalog/sitemap.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendCatalogSitemap = { + config: { + _id: '#nav-admin-catalog-sitemap', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Google Sitemap', + url: 'sitemap/index', + _grid: '#sitemapGrid_table', + __buttons: { + add: '.form-buttons button[title="Add Sitemap"]', + }, + }, + edit: { + title: 'Edit Sitemap', + url: 'sitemap/edit', + }, + new: { + title: 'New Sitemap', + url: 'sitemap/edit', + }, + }, +} diff --git a/cypress/support/openmage/backend/catalog/urlrewrite.js b/cypress/support/openmage/backend/catalog/urlrewrite.js new file mode 100644 index 00000000000..0be50dc4091 --- /dev/null +++ b/cypress/support/openmage/backend/catalog/urlrewrite.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', +} + +cy.testBackendUrlrewrite = { + config: { + _id: '#nav-admin-catalog-urlrewrite', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'URL Rewrite Management', + url: 'urlrewrite/index', + _grid: '#urlrewriteGrid_table', + __buttons: { + add: '.form-buttons button[title="Add URL Rewrite"]', + }, + }, + edit: { + title: 'Edit URL Rewrite', + url: 'urlrewrite/edit', + }, + new: { + title: 'Add New URL Rewrite', + url: 'urlrewrite/edit', + }, + }, +} diff --git a/cypress/support/openmage/backend/cms/block.js b/cypress/support/openmage/backend/cms/block.js new file mode 100644 index 00000000000..e55583d78a9 --- /dev/null +++ b/cypress/support/openmage/backend/cms/block.js @@ -0,0 +1,47 @@ +const defaultConfig = { + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + __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_is_active : { + selector: '#block_is_active', + }, + }, +} + +cy.testBackendCmsBlock = { + config: { + _id: '#nav-admin-cms-block', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Static Blocks', + url: 'cms_block/index', + _grid: '#cmsBlockGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Block"]', + }, + }, + edit: { + title: 'Edit Block', + url: 'cms_block/edit', + __fields: defaultConfig.__fields, + }, + new: { + title: 'New Block', + url: 'cms_block/new', + __fields: defaultConfig.__fields, + }, + }, +} diff --git a/cypress/support/openmage/backend/cms.js b/cypress/support/openmage/backend/cms/page.js similarity index 51% rename from cypress/support/openmage/backend/cms.js rename to cypress/support/openmage/backend/cms/page.js index 42dfa9f1826..8ea8f8a93ac 100644 --- a/cypress/support/openmage/backend/cms.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -1,41 +1,10 @@ const defaultConfig = { _id_parent: '#nav-admin-cms', _h3: 'h3.icon-head', - block: { - __fields: { - block_title : { - selector: '#block_title', - }, - block_identifier : { - selector: '#block_identifier', - }, - }, - }, } -cy.testBackendCms = { - block: { - _id: '#nav-admin-cms-block', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Static Blocks', - url: 'cms_block/index', - _grid: '#cmsBlockGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Block"]', - }, - }, - edit: { - title: 'Edit Block', - url: 'cms_block/edit', - }, - new: { - title: 'New Block', - url: 'cms_block/new', - }, - }, - page: { +cy.testBackendCmsPage = { + config: { _id: '#nav-admin-cms-page', _id_parent: defaultConfig._id_parent, _h3: defaultConfig._h3, @@ -77,25 +46,4 @@ cy.testBackendCms = { }, }, }, - widget: { - _id: '#nav-admin-cms-widget_instance', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Manage Widget Instances', - url: 'widget_instance/index', - _grid: '#widgetInstanceGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Widget Instance"]', - }, - }, - edit: { - title: 'Widget', - url: 'widget_instance/edit', - }, - new: { - title: 'New Widget Instance', - url: 'widget_instance/new', - }, - } } diff --git a/cypress/support/openmage/backend/cms/widget.js b/cypress/support/openmage/backend/cms/widget.js new file mode 100644 index 00000000000..ab2e3aff319 --- /dev/null +++ b/cypress/support/openmage/backend/cms/widget.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', +} + +cy.testBackendCmsWidget = { + config: { + _id: '#nav-admin-cms-widget_instance', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Widget Instances', + url: 'widget_instance/index', + _grid: '#widgetInstanceGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Widget Instance"]', + }, + }, + edit: { + title: 'Widget', + url: 'widget_instance/edit', + }, + new: { + title: 'New Widget Instance', + url: 'widget_instance/new', + }, + } +} diff --git a/cypress/support/openmage/backend/customer.js b/cypress/support/openmage/backend/customer/customer.js similarity index 96% rename from cypress/support/openmage/backend/customer.js rename to cypress/support/openmage/backend/customer/customer.js index 443bef131b8..dd1917ea0ff 100644 --- a/cypress/support/openmage/backend/customer.js +++ b/cypress/support/openmage/backend/customer/customer.js @@ -3,8 +3,8 @@ const defaultConfig = { _h3: 'h3.icon-head', } -cy.testBackendCustomer = { - customer: { +cy.testBackendCustomerCustomer = { + config: { _id: '#nav-admin-customer-manage', _id_parent: defaultConfig._id_parent, _h3: defaultConfig._h3, diff --git a/cypress/support/openmage/backend/customer/groups.js b/cypress/support/openmage/backend/customer/groups.js new file mode 100644 index 00000000000..d753e3e8331 --- /dev/null +++ b/cypress/support/openmage/backend/customer/groups.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', +} + +cy.testBackendCustomerGroups = { + config: { + _id: '#nav-admin-customer-group', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Customer Groups', + url: 'customer_group/index', + _grid: '#customerGroupGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Customer Group"]', + }, + }, + edit: { + title: 'Edit Customer Group', + url: 'customer_group/edit', + }, + new: { + title: 'New Customer Group', + url: 'customer_group/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/customer/online.js b/cypress/support/openmage/backend/customer/online.js new file mode 100644 index 00000000000..834a4f1d204 --- /dev/null +++ b/cypress/support/openmage/backend/customer/online.js @@ -0,0 +1,16 @@ +const defaultConfig = { + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', +} + +cy.testBackendCustomerOnline = { + config: { + _id: '#nav-admin-customer-online', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Online Customers', + url: 'customer_online/index', + }, + }, +} diff --git a/cypress/support/openmage/backend/newsletter.js b/cypress/support/openmage/backend/newsletter.js deleted file mode 100644 index 9b4aeaebdad..00000000000 --- a/cypress/support/openmage/backend/newsletter.js +++ /dev/null @@ -1,58 +0,0 @@ -const defaultConfig = { - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', -} - -cy.testBackendNewsletter = { - templates: { - _id: '#nav-admin-newsletter-template', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Newsletter Templates', - url: 'newsletter_template/index', - _grid: '#newsletterTemplateGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Template"]', - }, - }, - edit: { - title: 'Edit Newsletter Template', - url: 'newsletter_template/edit', - }, - new: { - title: 'New Newsletter Template', - url: 'newsletter_template/new', - }, - }, - queue: { - _id: '#nav-admin-newsletter-queue', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Newsletter Queue', - url: 'newsletter_queue/index', - _grid: '#queueGrid_table', - }, - }, - subscriber: { - _id: '#nav-admin-newsletter-subscriber', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Newsletter Subscribers', - url: 'newsletter_subscriber/index', - _grid: '#subscriberGrid_table', - }, - }, - report: { - _id: '#nav-admin-newsletter-problem', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Newsletter Problem Reports', - url: 'newsletter_problem/index', - _grid: '#problemGrid_table', - }, - }, -} diff --git a/cypress/support/openmage/backend/newsletter/queue.js b/cypress/support/openmage/backend/newsletter/queue.js new file mode 100644 index 00000000000..3ddb4573f3f --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/queue.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterQueue = { + config: { + _id: '#nav-admin-newsletter-queue', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + 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..94f86cb2ac9 --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/report.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterReport = { + config: { + _id: '#nav-admin-newsletter-problem', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + 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..c6ac32ea9f2 --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/subscriber.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterSubscriber = { + config: { + _id: '#nav-admin-newsletter-subscriber', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + 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..a773d00facf --- /dev/null +++ b/cypress/support/openmage/backend/newsletter/templates.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', +} + +cy.testBackendNewsletterTemplates = { + config: { + _id: '#nav-admin-newsletter-template', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Newsletter Templates', + url: 'newsletter_template/index', + _grid: '#newsletterTemplateGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Template"]', + }, + }, + edit: { + title: 'Edit Newsletter Template', + url: 'newsletter_template/edit', + }, + new: { + title: 'New Newsletter Template', + url: 'newsletter_template/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/promo/catalog.js b/cypress/support/openmage/backend/promo/catalog.js new file mode 100644 index 00000000000..9897a271039 --- /dev/null +++ b/cypress/support/openmage/backend/promo/catalog.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', +} + +cy.testBackendPromoCatalog = { + config: { + _id: '#nav-admin-promo-catalog', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Catalog Price Rules', + url: 'promo_catalog/index', + _grid: '#promo_catalog_grid', + __buttons: { + add: '.form-buttons button[title="Add New Rule"]', + }, + }, + edit: { + title: 'Edit Rule', + url: 'promo_catalog/edit', + }, + new: { + title: 'New Rule', + url: 'promo_catalog/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/promo.js b/cypress/support/openmage/backend/promo/quote.js similarity index 51% rename from cypress/support/openmage/backend/promo.js rename to cypress/support/openmage/backend/promo/quote.js index 9126a20bb37..03f59af4fe2 100644 --- a/cypress/support/openmage/backend/promo.js +++ b/cypress/support/openmage/backend/promo/quote.js @@ -3,29 +3,8 @@ const defaultConfig = { _h3: 'h3.icon-head', } -cy.testBackendPromo = { - catalog: { - _id: '#nav-admin-promo-catalog', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Catalog Price Rules', - url: 'promo_catalog/index', - _grid: '#promo_catalog_grid', - __buttons: { - add: '.form-buttons button[title="Add New Rule"]', - }, - }, - edit: { - title: 'Edit Rule', - url: 'promo_catalog/edit', - }, - new: { - title: 'New Rule', - url: 'promo_catalog/new', - }, - }, - quote: { +cy.testBackendPromoQuote = { + config: { _id: '#nav-admin-promo-quote', _id_parent: defaultConfig._id_parent, _h3: defaultConfig._h3, diff --git a/cypress/support/openmage/backend/sales.js b/cypress/support/openmage/backend/sales.js deleted file mode 100644 index 97f9cc3f336..00000000000 --- a/cypress/support/openmage/backend/sales.js +++ /dev/null @@ -1,76 +0,0 @@ -const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', -} - -cy.testBackendSales = { - creditmemo: { - _id: '#nav-admin-sales-creditmemo', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Credit Memos', - url: 'sales_creditmemo/index', - _grid: '#sales_creditmemo_grid_table', - }, - view: { - title: 'Credit Memo #', - url: 'sales_creditmemo/edit', - }, - }, - invoice: { - _id: '#nav-admin-sales-invoice', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Invoice', - url: 'sales_invoice/index', - _grid: '#sales_invoice_grid_table', - }, - view: { - title: 'Invoice #', - url: 'sales_invoice/view', - }, - }, - order: { - _id: '#nav-admin-sales-order', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Orders', - url: 'sales_order/index', - _grid: '#sales_order_grid_table', - __buttons: { - new: '.form-buttons button[title="Create New Order"]', - }, - }, - view: { - title: 'Order #', - url: 'sales_order/view', - }, - }, - shipment: { - _id: '#nav-admin-sales-shipment', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Shipments', - url: 'sales_shipment/index', - _grid: '#sales_shipment_grid_table', - }, - view: { - title: 'Shipment #', - url: 'sales_shipment/view', - }, - }, - transactions: { - _id: '#nav-admin-sales-transactions', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Transactions', - url: 'sales_transactions/index', - _grid: '#order_transactions_table', - }, - }, -} diff --git a/cypress/support/openmage/backend/sales/creditmemo.js b/cypress/support/openmage/backend/sales/creditmemo.js new file mode 100644 index 00000000000..7c2441f78d9 --- /dev/null +++ b/cypress/support/openmage/backend/sales/creditmemo.js @@ -0,0 +1,21 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSalesCreditmemo = { + config: { + _id: '#nav-admin-sales-creditmemo', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Credit Memos', + url: 'sales_creditmemo/index', + _grid: '#sales_creditmemo_grid_table', + }, + view: { + title: 'Credit Memo #', + url: 'sales_creditmemo/edit', + }, + }, +} diff --git a/cypress/support/openmage/backend/sales/invoice.js b/cypress/support/openmage/backend/sales/invoice.js new file mode 100644 index 00000000000..3da74b84adf --- /dev/null +++ b/cypress/support/openmage/backend/sales/invoice.js @@ -0,0 +1,21 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSalesInvoice = { + config: { + _id: '#nav-admin-sales-invoice', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Invoice', + url: 'sales_invoice/index', + _grid: '#sales_invoice_grid_table', + }, + view: { + title: 'Invoice #', + url: 'sales_invoice/view', + }, + }, +} diff --git a/cypress/support/openmage/backend/sales/order.js b/cypress/support/openmage/backend/sales/order.js new file mode 100644 index 00000000000..0b150b38910 --- /dev/null +++ b/cypress/support/openmage/backend/sales/order.js @@ -0,0 +1,24 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSalesOrder = { + config: { + _id: '#nav-admin-sales-order', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Orders', + url: 'sales_order/index', + _grid: '#sales_order_grid_table', + __buttons: { + new: '.form-buttons button[title="Create New Order"]', + }, + }, + view: { + title: 'Order #', + url: 'sales_order/view', + }, + }, +} diff --git a/cypress/support/openmage/backend/sales/shipment.js b/cypress/support/openmage/backend/sales/shipment.js new file mode 100644 index 00000000000..7dd6b5baed8 --- /dev/null +++ b/cypress/support/openmage/backend/sales/shipment.js @@ -0,0 +1,21 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSalesOrderShipment = { + config: { + _id: '#nav-admin-sales-shipment', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Shipments', + url: 'sales_shipment/index', + _grid: '#sales_shipment_grid_table', + }, + view: { + title: 'Shipment #', + url: 'sales_shipment/view', + }, + }, +} diff --git a/cypress/support/openmage/backend/sales/transactions.js b/cypress/support/openmage/backend/sales/transactions.js new file mode 100644 index 00000000000..7194bfa963d --- /dev/null +++ b/cypress/support/openmage/backend/sales/transactions.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', +} + +cy.testBackendSalesTransactions = { + config: { + _id: '#nav-admin-sales-transactions', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Transactions', + url: 'sales_transactions/index', + _grid: '#order_transactions_table', + }, + }, +} diff --git a/cypress/support/openmage/backend/system.js b/cypress/support/openmage/backend/system.js deleted file mode 100644 index 0646b203528..00000000000 --- a/cypress/support/openmage/backend/system.js +++ /dev/null @@ -1,202 +0,0 @@ -const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', -} - -cy.testBackendSystem = { - cache: { - _id: '#nav-admin-system-cache', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Cache Storage Management', - url: 'cache/index', - _grid: '#cache_grid_table', - __buttons: { - flushApply: '.form-buttons button[title="Flush & Apply Updates"]', - flushCache: '.form-buttons button[title="Flush Cache Storage"]', - }, - }, - }, - design: { - _id: '#nav-admin-system-design', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Design', - url: 'system_design/index', - _grid: '#designGrid_table', - __buttons: { - add: '.form-buttons button[title="Add Design Change"]', - }, - }, - edit: { - title: 'Edit Design Change', - url: 'system_design/edit', - }, - new: { - title: 'New Design Change', - url: 'system_design/new', - }, - }, - email: { - _id: '#nav-admin-system-email_template', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Transactional Emails', - url: 'system_email_template/index', - _grid: '#systemEmailTemplateGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Template"]', - }, - }, - edit: { - title: 'Edit Email Template', - url: 'system_email_template/edit', - }, - new: { - title: 'New Email Template', - url: 'system_email_template/new', - }, - }, - myaccount: { - _id: '#nav-admin-system-myaccount', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'My Account', - url: 'system_account/index', - __buttons: { - save: '.form-buttons button[title="Save Account"]', - }, - __validation: { - _input: { - username: '#username', - firstname: '#firstname', - lastname: '#lastname', - email: '#email', - current_password: '#current_password', - } - } - - }, - }, - manage_curreny: { - _id: '#nav-admin-system-currency-rates', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Manage Currency Rates', - url: 'system_currency/index', - __buttons: { - save: '.form-buttons button[title="Save Currency Rates"]', - }, - __validation: { - _input: { - from: 'input[name="rate[USD][EUR]"]', - } - } - }, - }, - notification: { - _id: '#nav-admin-system-adminnotification', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Messages Inbox', - url: 'notification/index', - _grid: '#notificationGrid_table', - }, - }, - indexes: { - _id: '#nav-admin-system-index', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - list: { - title: 'Index Management', - url: 'process/list', - _grid: '#indexer_processes_grid_table', - }, - }, - stores: { - _id: '#nav-admin-system-store', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Manage Stores', - url: 'system_store/index', - __buttons: { - addWebsite: '.form-buttons button[title="Create Website"]', - addStore: '.form-buttons button[title="Create Store"]', - addStoreView: '.form-buttons button[title="Create Store View"]', - }, - }, - }, - variables: { - _id: '#nav-admin-system-variable', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Custom Variables', - url: 'system_variable/index', - _grid: '#customVariablesGrid', - __buttons: { - add: '.form-buttons button[title="Add New Variable"]', - }, - }, - edit: { - title: 'Custom Variable', - url: 'system_variable/edit', - }, - new: { - title: 'New Custom Variable', - url: 'system_variable/new', - }, - }, - config: { - _buttonSave: '.form-buttons button[title="Save Config"]', - catalog: { - configswatches: { - _id: '#section-configswatches', - url: 'system_config/edit/section/configswatches', - h3: 'Configurable Swatches', - _h3: defaultConfig._h3, - }, - sitemap: { - _id: '#section-sitemap', - url: 'system_config/edit/section/sitemap', - h3: 'Google Sitemap', - _h3: defaultConfig._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: defaultConfig._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/adminnotification.js b/cypress/support/openmage/backend/system/adminnotification.js new file mode 100644 index 00000000000..b8da7b629ce --- /dev/null +++ b/cypress/support/openmage/backend/system/adminnotification.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemAdminnotification = { + config: { + _id: '#nav-admin-system-adminnotification', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + 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..223ed4c82f0 --- /dev/null +++ b/cypress/support/openmage/backend/system/cache.js @@ -0,0 +1,21 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemCache = { + config: { + _id: '#nav-admin-system-cache', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Cache Storage Management', + url: 'cache/index', + _grid: '#cache_grid_table', + __buttons: { + flushApply: '.form-buttons button[title="Flush & Apply Updates"]', + flushCache: '.form-buttons 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..8ed8e03065a --- /dev/null +++ b/cypress/support/openmage/backend/system/config.js @@ -0,0 +1,52 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemConfig = { + config: { + _buttonSave: '.form-buttons button[title="Save Config"]', + catalog: { + configswatches: { + _id: '#section-configswatches', + url: 'system_config/edit/section/configswatches', + h3: 'Configurable Swatches', + _h3: defaultConfig._h3, + }, + sitemap: { + _id: '#section-sitemap', + url: 'system_config/edit/section/sitemap', + h3: 'Google Sitemap', + _h3: defaultConfig._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: defaultConfig._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..b7083adbf11 --- /dev/null +++ b/cypress/support/openmage/backend/system/currency.js @@ -0,0 +1,24 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemCurrencyRates = { + config: { + _id: '#nav-admin-system-currency-rates', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Currency Rates', + url: 'system_currency/index', + __buttons: { + save: '.form-buttons button[title="Save Currency Rates"]', + }, + __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..f787139671a --- /dev/null +++ b/cypress/support/openmage/backend/system/design.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemDesign = { + config: { + _id: '#nav-admin-system-design', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Design', + url: 'system_design/index', + _grid: '#designGrid_table', + __buttons: { + add: '.form-buttons button[title="Add Design Change"]', + }, + }, + edit: { + title: 'Edit Design Change', + url: 'system_design/edit', + }, + new: { + title: 'New Design Change', + url: 'system_design/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/system/emails.js b/cypress/support/openmage/backend/system/emails.js new file mode 100644 index 00000000000..2c25baebadd --- /dev/null +++ b/cypress/support/openmage/backend/system/emails.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemEmailTemplate = { + config: { + _id: '#nav-admin-system-email_template', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Transactional Emails', + url: 'system_email_template/index', + _grid: '#systemEmailTemplateGrid_table', + __buttons: { + add: '.form-buttons button[title="Add New Template"]', + }, + }, + edit: { + title: 'Edit Email Template', + url: 'system_email_template/edit', + }, + new: { + title: 'New Email Template', + url: 'system_email_template/new', + }, + }, +} diff --git a/cypress/support/openmage/backend/system/index.js b/cypress/support/openmage/backend/system/index.js new file mode 100644 index 00000000000..46ab6f07bf6 --- /dev/null +++ b/cypress/support/openmage/backend/system/index.js @@ -0,0 +1,17 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemIndex = { + config: { + _id: '#nav-admin-system-index', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + list: { + 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..32ab266a3d8 --- /dev/null +++ b/cypress/support/openmage/backend/system/my-account.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemMyAccount = { + config: { + _id: '#nav-admin-system-myaccount', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'My Account', + url: 'system_account/index', + __buttons: { + save: '.form-buttons button[title="Save Account"]', + }, + __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..ccbebc7e99f --- /dev/null +++ b/cypress/support/openmage/backend/system/store.js @@ -0,0 +1,21 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemStore = { + config: { + _id: '#nav-admin-system-store', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Manage Stores', + url: 'system_store/index', + __buttons: { + addWebsite: '.form-buttons button[title="Create Website"]', + addStore: '.form-buttons button[title="Create Store"]', + addStoreView: '.form-buttons 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..13f16924a76 --- /dev/null +++ b/cypress/support/openmage/backend/system/variable.js @@ -0,0 +1,28 @@ +const defaultConfig = { + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', +} + +cy.testBackendSystemVariable = { + config: { + _id: '#nav-admin-system-variable', + _id_parent: defaultConfig._id_parent, + _h3: defaultConfig._h3, + index: { + title: 'Custom Variables', + url: 'system_variable/index', + _grid: '#customVariablesGrid', + __buttons: { + add: '.form-buttons button[title="Add New Variable"]', + }, + }, + edit: { + title: 'Custom Variable', + url: 'system_variable/edit', + }, + new: { + title: 'New Custom Variable', + url: 'system_variable/new', + }, + }, +} From b76b7dd7cc6708a859314e00e57f8032be21dc6c Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 02:42:14 +0200 Subject: [PATCH 07/29] fixed imports --- cypress/support/e2e.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index ec6d3289171..066e8957e7a 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -35,6 +35,15 @@ import './openmage/backend/sales/invoice' import './openmage/backend/sales/order' import './openmage/backend/sales/shipment' import './openmage/backend/sales/transactions' -import './openmage/backend/system' +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/index' +import './openmage/backend/system/my-account' +import './openmage/backend/system/store' +import './openmage/backend/system/variable' import './openmage/frontend/paths' From 14fe941131cbbf2ad0f469ecad9ab9ed37636d56 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 02:47:16 +0200 Subject: [PATCH 08/29] fixed imports --- cypress/support/e2e.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 066e8957e7a..117d1837acc 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -16,7 +16,11 @@ // Import commands.js using ES2015 syntax: import './commands' import './openmage' -import './openmage/backend/catalog' +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' From 49834ac24c58b2ab82485cbc9dfd9697b17ea835 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 06:27:15 +0200 Subject: [PATCH 09/29] updated tests --- .../openmage/backend/customer/groups.cy.js | 2 +- .../system/{index.cy.js => indexer.cy.js} | 0 cypress/support/openmage.js | 5 ++ .../openmage/backend/catalog/categories.js | 12 +++-- .../openmage/backend/catalog/products.js | 18 +++++-- .../openmage/backend/catalog/search.js | 21 ++++++-- .../openmage/backend/catalog/sitemap.js | 12 ++--- .../openmage/backend/catalog/urlrewrite.js | 19 +++++-- cypress/support/openmage/backend/cms/block.js | 23 +++++++-- cypress/support/openmage/backend/cms/page.js | 26 +++++----- .../support/openmage/backend/cms/widget.js | 21 ++++++-- .../openmage/backend/customer/customer.js | 50 +++++++------------ .../openmage/backend/customer/groups.js | 20 ++++++-- .../openmage/backend/customer/online.js | 9 +--- cypress/support/openmage/backend/dashboard.js | 9 +--- .../openmage/backend/newsletter/queue.js | 9 +--- .../openmage/backend/newsletter/report.js | 9 +--- .../openmage/backend/newsletter/subscriber.js | 9 +--- .../openmage/backend/newsletter/templates.js | 24 +++++++-- .../support/openmage/backend/promo/catalog.js | 26 ++++++++-- .../support/openmage/backend/promo/quote.js | 21 ++++++-- .../openmage/backend/sales/creditmemo.js | 15 ++++-- .../support/openmage/backend/sales/invoice.js | 13 +++-- .../support/openmage/backend/sales/order.js | 12 +++-- .../openmage/backend/sales/shipment.js | 13 +++-- .../openmage/backend/sales/transactions.js | 9 +--- .../backend/system/adminnotification.js | 9 +--- .../support/openmage/backend/system/cache.js | 12 ++--- .../openmage/backend/system/currency.js | 12 +++-- .../support/openmage/backend/system/design.js | 14 ++++-- .../support/openmage/backend/system/emails.js | 15 ++++-- .../backend/system/{index.js => indexer.js} | 9 +--- .../openmage/backend/system/my-account.js | 11 ++-- .../support/openmage/backend/system/store.js | 14 +++--- .../openmage/backend/system/variable.js | 14 ++++-- 35 files changed, 309 insertions(+), 208 deletions(-) rename cypress/e2e/openmage/backend/system/{index.cy.js => indexer.cy.js} (100%) rename cypress/support/openmage/backend/system/{index.js => indexer.js} (59%) diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js index dc6b8053338..affeeaea8f6 100644 --- a/cypress/e2e/openmage/backend/customer/groups.cy.js +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.clickAction(test.index.__buttons.save); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/system/index.cy.js b/cypress/e2e/openmage/backend/system/indexer.cy.js similarity index 100% rename from cypress/e2e/openmage/backend/system/index.cy.js rename to cypress/e2e/openmage/backend/system/indexer.cy.js diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index b3d305d7864..2f5cc47b2bd 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -35,6 +35,9 @@ cy.openmage = { cy.log('Checking for title'); cy.get(test._h3).should('include.text', path.title); + cy.log('Checkinng for URL') + cy.url().should('include', path.url); + cy.log('Checking for active parent class'); cy.get(test._id_parent).should('have.class', 'active'); @@ -47,6 +50,8 @@ cy.openmage = { } if (path.__buttons !== undefined) { + cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); + cy.log('Checking for existing buttons'); Object.keys(path.__buttons).forEach(button => { cy.get(path.__buttons[button]).should('exist'); diff --git a/cypress/support/openmage/backend/catalog/categories.js b/cypress/support/openmage/backend/catalog/categories.js index 458a70fbb1e..4fe04b3ee75 100644 --- a/cypress/support/openmage/backend/catalog/categories.js +++ b/cypress/support/openmage/backend/catalog/categories.js @@ -1,16 +1,20 @@ const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', + _button: '.form-buttons button' } cy.testBackendCatalogProductsCategories = { config: { _id: '#nav-admin-catalog-categories', - _id_parent: defaultConfig._id_parent, - _h3: '#category-edit-container ' + defaultConfig._h3, + _id_parent: '#nav-admin-catalog', + _h3: '#category-edit-container h3.icon-head', + _button: defaultConfig._button, index: { title: 'New Root Category', url: 'catalog_category/index', + __buttons: { + save: defaultConfig._button + '[title="Save Category"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/catalog/products.js b/cypress/support/openmage/backend/catalog/products.js index 9b2404c5b90..9bdc64152e5 100644 --- a/cypress/support/openmage/backend/catalog/products.js +++ b/cypress/support/openmage/backend/catalog/products.js @@ -1,24 +1,32 @@ const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', + _button: '.content-header button' } cy.testBackendCatalogProducts = { config: { _id: '#nav-admin-catalog-products', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Products', url: 'catalog_product/index', _grid: '#productGrid_table', __buttons: { - add: 'button[title="Add Product"]', + add: defaultConfig._button + '[title="Add Product"]', }, }, edit: { title: 'Plaid Cotton', url: 'catalog_product/edit', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete"]', + duplicate: defaultConfig._button + '[title="Duplicate"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Product', diff --git a/cypress/support/openmage/backend/catalog/search.js b/cypress/support/openmage/backend/catalog/search.js index 1b6c5c20f7c..7fe0ae03129 100644 --- a/cypress/support/openmage/backend/catalog/search.js +++ b/cypress/support/openmage/backend/catalog/search.js @@ -1,28 +1,39 @@ const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendCatalogSearch = { config: { _id: '#nav-admin-catalog-search', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Search', url: 'catalog_search/index', _grid: '#catalog_search_grid_table', __buttons: { - add: '.form-buttons button[title="Add New Search Term"]', + add: defaultConfig._button + '[title="Add New Search Term"]', }, }, edit: { title: 'Edit Search', url: 'catalog_search/edit', + __buttons: { + save: defaultConfig._button + '[title="Save Search"]', + delete: defaultConfig._button + '[title="Delete Search"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Search', url: 'catalog_search/new', + __buttons: { + save: defaultConfig._button + '[title="Save Search"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/catalog/sitemap.js b/cypress/support/openmage/backend/catalog/sitemap.js index 50ddca86c0d..a00dd5049b8 100644 --- a/cypress/support/openmage/backend/catalog/sitemap.js +++ b/cypress/support/openmage/backend/catalog/sitemap.js @@ -1,19 +1,19 @@ const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', + _button: '.form-buttons button' } cy.testBackendCatalogSitemap = { config: { _id: '#nav-admin-catalog-sitemap', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Google Sitemap', url: 'sitemap/index', _grid: '#sitemapGrid_table', __buttons: { - add: '.form-buttons button[title="Add Sitemap"]', + add: defaultConfig._button + '[title="Add Sitemap"]', }, }, edit: { @@ -22,7 +22,7 @@ cy.testBackendCatalogSitemap = { }, new: { title: 'New Sitemap', - url: 'sitemap/edit', + url: 'sitemap/new', }, }, } diff --git a/cypress/support/openmage/backend/catalog/urlrewrite.js b/cypress/support/openmage/backend/catalog/urlrewrite.js index 0be50dc4091..030bc33c321 100644 --- a/cypress/support/openmage/backend/catalog/urlrewrite.js +++ b/cypress/support/openmage/backend/catalog/urlrewrite.js @@ -1,28 +1,37 @@ const defaultConfig = { - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendUrlrewrite = { config: { _id: '#nav-admin-catalog-urlrewrite', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-catalog', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'URL Rewrite Management', url: 'urlrewrite/index', _grid: '#urlrewriteGrid_table', __buttons: { - add: '.form-buttons button[title="Add URL Rewrite"]', + add: defaultConfig._button + '[title="Add URL Rewrite"]', }, }, edit: { title: 'Edit URL Rewrite', url: 'urlrewrite/edit', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + delete: defaultConfig._button + '[title="Delete"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'Add New URL Rewrite', url: 'urlrewrite/edit', + __buttons: { + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/cms/block.js b/cypress/support/openmage/backend/cms/block.js index e55583d78a9..1cd75f495a2 100644 --- a/cypress/support/openmage/backend/cms/block.js +++ b/cypress/support/openmage/backend/cms/block.js @@ -1,6 +1,5 @@ const defaultConfig = { - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', + _button: '.form-buttons button', __fields: { block_title : { selector: '#block_title', @@ -23,24 +22,38 @@ const defaultConfig = { cy.testBackendCmsBlock = { config: { _id: '#nav-admin-cms-block', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Static Blocks', url: 'cms_block/index', _grid: '#cmsBlockGrid_table', __buttons: { - add: '.form-buttons button[title="Add New Block"]', + add: defaultConfig._button + '[title="Add New Block"]', }, }, edit: { title: 'Edit Block', url: 'cms_block/edit', + __buttons: { + save: defaultConfig._button + '[title="Save Block"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete Block"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, __fields: defaultConfig.__fields, }, new: { title: 'New Block', url: 'cms_block/new', + __buttons: { + save: defaultConfig._button + '[title="Save Block"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, __fields: defaultConfig.__fields, }, }, diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index 8ea8f8a93ac..ff7ec1c9885 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -1,29 +1,30 @@ const defaultConfig = { - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendCmsPage = { config: { _id: '#nav-admin-cms-page', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Pages', url: 'cms_page/index', _grid: '#cmsPageGrid', __buttons: { - add: '.form-buttons button[title="Add New Page"]', + add: defaultConfig._button + '[title="Add New Page"]', }, }, edit: { title: 'Edit Page', url: 'cms_page/edit', __buttons: { - delete: '.form-buttons button[title="Delete Page"]', - save: '.form-buttons button[title="Save Page"]', - saveAndContinue: '.form-buttons button[title="Save and Continue Edit"]', - reset: '.form-buttons button[title="Reset"]', + save: defaultConfig._button + '[title="Save Page"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete Page"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', }, disablePage: () => { cy.log('Disable the CMS page'); @@ -40,9 +41,10 @@ cy.testBackendCmsPage = { title: 'New Page', url: 'cms_page/new', __buttons: { - save: '.form-buttons button[title="Save Page"]', - saveAndContinue: '.form-buttons button[title="Save and Continue Edit"]', - reset: '.form-buttons button[title="Reset"]', + save: defaultConfig._button + '[title="Save Page"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', }, }, }, diff --git a/cypress/support/openmage/backend/cms/widget.js b/cypress/support/openmage/backend/cms/widget.js index ab2e3aff319..b7c20ad88e2 100644 --- a/cypress/support/openmage/backend/cms/widget.js +++ b/cypress/support/openmage/backend/cms/widget.js @@ -1,28 +1,39 @@ const defaultConfig = { - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendCmsWidget = { config: { _id: '#nav-admin-cms-widget_instance', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Widget Instances', url: 'widget_instance/index', _grid: '#widgetInstanceGrid_table', __buttons: { - add: '.form-buttons button[title="Add New Widget Instance"]', + add: defaultConfig._button + '[title="Add New Widget Instance"]', }, }, edit: { title: 'Widget', url: 'widget_instance/edit', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Widget Instance', url: 'widget_instance/new', + __buttons: { + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, } } diff --git a/cypress/support/openmage/backend/customer/customer.js b/cypress/support/openmage/backend/customer/customer.js index dd1917ea0ff..9fa4f2fe4b2 100644 --- a/cypress/support/openmage/backend/customer/customer.js +++ b/cypress/support/openmage/backend/customer/customer.js @@ -1,58 +1,42 @@ const defaultConfig = { - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', + _button: '.form-buttons button' } cy.testBackendCustomerCustomer = { config: { _id: '#nav-admin-customer-manage', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Customers', url: 'customer/index', _grid: '#customerGrid_table', __buttons: { - add: '.form-buttons button[title="Add New Customer"]', + add: defaultConfig._button + '[title="Add New Customer"]', }, }, edit: { title: 'John Smith', url: 'customer/edit', + __buttons: { + save: defaultConfig._button + '[title="Save Customer"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete Customer"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + createOrder: defaultConfig._button + '[title="Create Order"]', + }, }, new: { title: 'New Customer', url: 'customer/new', - }, - }, - groups: { - _id: '#nav-admin-customer-group', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Customer Groups', - url: 'customer_group/index', - _grid: '#customerGroupGrid_table', __buttons: { - add: '.form-buttons button[title="Add New Customer Group"]', + save: defaultConfig._button + '[title="Save Customer"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', }, }, - edit: { - title: 'Edit Customer Group', - url: 'customer_group/edit', - }, - new: { - title: 'New Customer Group', - url: 'customer_group/new', - }, - }, - online: { - _id: '#nav-admin-customer-online', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, - index: { - title: 'Online Customers', - url: 'customer_online/index', - }, }, } diff --git a/cypress/support/openmage/backend/customer/groups.js b/cypress/support/openmage/backend/customer/groups.js index d753e3e8331..17d3f9cda11 100644 --- a/cypress/support/openmage/backend/customer/groups.js +++ b/cypress/support/openmage/backend/customer/groups.js @@ -1,28 +1,38 @@ const defaultConfig = { - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', + _button: '.form-buttons button' } cy.testBackendCustomerGroups = { config: { _id: '#nav-admin-customer-group', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Customer Groups', url: 'customer_group/index', _grid: '#customerGroupGrid_table', __buttons: { - add: '.form-buttons button[title="Add New Customer Group"]', + save: defaultConfig._button + '[title="Add New Customer Group"]', }, }, edit: { title: 'Edit Customer Group', url: 'customer_group/edit', + __buttons: { + save: defaultConfig._button + '[title="Save Customer Group"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Customer Group', url: 'customer_group/new', + __buttons: { + save: defaultConfig._button + '[title="Save Customer Group"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/customer/online.js b/cypress/support/openmage/backend/customer/online.js index 834a4f1d204..7b47515ba4a 100644 --- a/cypress/support/openmage/backend/customer/online.js +++ b/cypress/support/openmage/backend/customer/online.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', -} - cy.testBackendCustomerOnline = { config: { _id: '#nav-admin-customer-online', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-customer', + _h3: 'h3.icon-head', index: { title: 'Online Customers', url: 'customer_online/index', diff --git a/cypress/support/openmage/backend/dashboard.js b/cypress/support/openmage/backend/dashboard.js index 2e1e4469e84..bac6b522298 100644 --- a/cypress/support/openmage/backend/dashboard.js +++ b/cypress/support/openmage/backend/dashboard.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-dashboard', - _h3: 'h3.head-dashboard', -} - cy.testBackendDashboard = { dashboard: { _id: '#nav-admin-dashboard', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-dashboard', + _h3: 'h3.head-dashboard', index: { title: 'Dashboard', url: 'dashboard/index', diff --git a/cypress/support/openmage/backend/newsletter/queue.js b/cypress/support/openmage/backend/newsletter/queue.js index 3ddb4573f3f..a4eaa30af1c 100644 --- a/cypress/support/openmage/backend/newsletter/queue.js +++ b/cypress/support/openmage/backend/newsletter/queue.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', -} - cy.testBackendNewsletterQueue = { config: { _id: '#nav-admin-newsletter-queue', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', index: { title: 'Newsletter Queue', url: 'newsletter_queue/index', diff --git a/cypress/support/openmage/backend/newsletter/report.js b/cypress/support/openmage/backend/newsletter/report.js index 94f86cb2ac9..3fcef90d0ed 100644 --- a/cypress/support/openmage/backend/newsletter/report.js +++ b/cypress/support/openmage/backend/newsletter/report.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', -} - cy.testBackendNewsletterReport = { config: { _id: '#nav-admin-newsletter-problem', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', index: { title: 'Newsletter Problem Reports', url: 'newsletter_problem/index', diff --git a/cypress/support/openmage/backend/newsletter/subscriber.js b/cypress/support/openmage/backend/newsletter/subscriber.js index c6ac32ea9f2..dc0a94868cc 100644 --- a/cypress/support/openmage/backend/newsletter/subscriber.js +++ b/cypress/support/openmage/backend/newsletter/subscriber.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', -} - cy.testBackendNewsletterSubscriber = { config: { _id: '#nav-admin-newsletter-subscriber', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', index: { title: 'Newsletter Subscribers', url: 'newsletter_subscriber/index', diff --git a/cypress/support/openmage/backend/newsletter/templates.js b/cypress/support/openmage/backend/newsletter/templates.js index a773d00facf..f1a29790412 100644 --- a/cypress/support/openmage/backend/newsletter/templates.js +++ b/cypress/support/openmage/backend/newsletter/templates.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendNewsletterTemplates = { config: { _id: '#nav-admin-newsletter-template', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-newsletter', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Newsletter Templates', url: 'newsletter_template/index', @@ -19,10 +19,26 @@ cy.testBackendNewsletterTemplates = { edit: { title: 'Edit Newsletter Template', url: 'newsletter_template/edit', + __buttons: { + save: defaultConfig._button + '[title="Save Template"]', + saveAs: defaultConfig._button + '[title="Save As"]', + delete: defaultConfig._button + '[title="Delete Template"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + convert: defaultConfig._button + '[title="Convert to Plain Text"]', + preview: defaultConfig._button + '[title="Preview Template"]', + }, }, new: { title: 'New Newsletter Template', url: 'newsletter_template/new', + __buttons: { + save: defaultConfig._button + '[title="Save Template"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + convert: defaultConfig._button + '[title="Convert to Plain Text"]', + preview: defaultConfig._button + '[title="Preview Template"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/promo/catalog.js b/cypress/support/openmage/backend/promo/catalog.js index 9897a271039..494a66e8e25 100644 --- a/cypress/support/openmage/backend/promo/catalog.js +++ b/cypress/support/openmage/backend/promo/catalog.js @@ -1,28 +1,44 @@ const defaultConfig = { - _id_parent: '#nav-admin-promo', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendPromoCatalog = { config: { _id: '#nav-admin-promo-catalog', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Catalog Price Rules', url: 'promo_catalog/index', _grid: '#promo_catalog_grid', __buttons: { - add: '.form-buttons button[title="Add New Rule"]', + add: defaultConfig._button + '[title="Add New Rule"]', + apply: defaultConfig._button + '[title="Apply Rules"]', }, }, edit: { title: 'Edit Rule', url: 'promo_catalog/edit', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + saveAndApply: defaultConfig._button + '[title="Save and Apply"]', + delete: defaultConfig._button + '[title="Delete"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Rule', url: 'promo_catalog/new', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + saveAndApply: defaultConfig._button + '[title="Save and Apply"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/promo/quote.js b/cypress/support/openmage/backend/promo/quote.js index 03f59af4fe2..0ea8219a8b8 100644 --- a/cypress/support/openmage/backend/promo/quote.js +++ b/cypress/support/openmage/backend/promo/quote.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-promo', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendPromoQuote = { config: { _id: '#nav-admin-promo-quote', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-promo', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Shopping Cart Price Rules', url: 'promo_quote/index', @@ -19,10 +19,23 @@ cy.testBackendPromoQuote = { edit: { title: 'Edit Rule', url: 'promo_quote/edit', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + delete: defaultConfig._button + '[title="Delete"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, new: { title: 'New Rule', url: 'promo_quote/new', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/sales/creditmemo.js b/cypress/support/openmage/backend/sales/creditmemo.js index 7c2441f78d9..5485b4484c9 100644 --- a/cypress/support/openmage/backend/sales/creditmemo.js +++ b/cypress/support/openmage/backend/sales/creditmemo.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSalesCreditmemo = { config: { _id: '#nav-admin-sales-creditmemo', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Credit Memos', url: 'sales_creditmemo/index', @@ -15,7 +15,12 @@ cy.testBackendSalesCreditmemo = { }, view: { title: 'Credit Memo #', - url: 'sales_creditmemo/edit', + url: 'sales_creditmemo/view', + __buttons: { + print: defaultConfig._button + '[title="Print"]', + email: defaultConfig._button + '[title="Send Email"]', + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/sales/invoice.js b/cypress/support/openmage/backend/sales/invoice.js index 3da74b84adf..bb8385c4366 100644 --- a/cypress/support/openmage/backend/sales/invoice.js +++ b/cypress/support/openmage/backend/sales/invoice.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSalesInvoice = { config: { _id: '#nav-admin-sales-invoice', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Invoice', url: 'sales_invoice/index', @@ -16,6 +16,11 @@ cy.testBackendSalesInvoice = { view: { title: 'Invoice #', url: 'sales_invoice/view', + __buttons: { + print: defaultConfig._button + '[title="Print"]', + email: defaultConfig._button + '[title="Send Email"]', + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/sales/order.js b/cypress/support/openmage/backend/sales/order.js index 0b150b38910..b0d4a92daa7 100644 --- a/cypress/support/openmage/backend/sales/order.js +++ b/cypress/support/openmage/backend/sales/order.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSalesOrder = { config: { _id: '#nav-admin-sales-order', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Orders', url: 'sales_order/index', @@ -19,6 +19,10 @@ cy.testBackendSalesOrder = { view: { title: 'Order #', url: 'sales_order/view', + __buttons: { + reorder: defaultConfig._button + '[title="Reorder"]', + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/sales/shipment.js b/cypress/support/openmage/backend/sales/shipment.js index 7dd6b5baed8..614f051b911 100644 --- a/cypress/support/openmage/backend/sales/shipment.js +++ b/cypress/support/openmage/backend/sales/shipment.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSalesOrderShipment = { config: { _id: '#nav-admin-sales-shipment', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Shipments', url: 'sales_shipment/index', @@ -16,6 +16,11 @@ cy.testBackendSalesOrderShipment = { view: { title: 'Shipment #', url: 'sales_shipment/view', + __buttons: { + print: defaultConfig._button + '[title="Print"]', + tracking: defaultConfig._button + '[title="Send Tracking Information"]', + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/sales/transactions.js b/cypress/support/openmage/backend/sales/transactions.js index 7194bfa963d..1d86254e7e5 100644 --- a/cypress/support/openmage/backend/sales/transactions.js +++ b/cypress/support/openmage/backend/sales/transactions.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', -} - cy.testBackendSalesTransactions = { config: { _id: '#nav-admin-sales-transactions', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-sales', + _h3: 'h3.icon-head', index: { title: 'Transactions', url: 'sales_transactions/index', diff --git a/cypress/support/openmage/backend/system/adminnotification.js b/cypress/support/openmage/backend/system/adminnotification.js index b8da7b629ce..5cabe1dfb05 100644 --- a/cypress/support/openmage/backend/system/adminnotification.js +++ b/cypress/support/openmage/backend/system/adminnotification.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', -} - cy.testBackendSystemAdminnotification = { config: { _id: '#nav-admin-system-adminnotification', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', index: { title: 'Messages Inbox', url: 'notification/index', diff --git a/cypress/support/openmage/backend/system/cache.js b/cypress/support/openmage/backend/system/cache.js index 223ed4c82f0..113fee304d0 100644 --- a/cypress/support/openmage/backend/system/cache.js +++ b/cypress/support/openmage/backend/system/cache.js @@ -1,20 +1,20 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemCache = { config: { _id: '#nav-admin-system-cache', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Cache Storage Management', url: 'cache/index', _grid: '#cache_grid_table', __buttons: { - flushApply: '.form-buttons button[title="Flush & Apply Updates"]', - flushCache: '.form-buttons button[title="Flush Cache Storage"]', + flushApply: defaultConfig._button + '[title="Flush & Apply Updates"]', + flushCache: defaultConfig._button + '[title="Flush Cache Storage"]', }, }, }, diff --git a/cypress/support/openmage/backend/system/currency.js b/cypress/support/openmage/backend/system/currency.js index b7083adbf11..65e097518a2 100644 --- a/cypress/support/openmage/backend/system/currency.js +++ b/cypress/support/openmage/backend/system/currency.js @@ -1,18 +1,20 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemCurrencyRates = { config: { _id: '#nav-admin-system-currency-rates', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Currency Rates', url: 'system_currency/index', __buttons: { - save: '.form-buttons button[title="Save Currency Rates"]', + save: defaultConfig._button + '[title="Save Currency Rates"]', + import: defaultConfig._button + '[title="Import"]', + reset: defaultConfig._button + '[title="Reset"]', }, __validation: { _input: { diff --git a/cypress/support/openmage/backend/system/design.js b/cypress/support/openmage/backend/system/design.js index f787139671a..b0e07f754ef 100644 --- a/cypress/support/openmage/backend/system/design.js +++ b/cypress/support/openmage/backend/system/design.js @@ -1,19 +1,19 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemDesign = { config: { _id: '#nav-admin-system-design', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Design', url: 'system_design/index', _grid: '#designGrid_table', __buttons: { - add: '.form-buttons button[title="Add Design Change"]', + add: defaultConfig._button + '[title="Add Design Change"]', }, }, edit: { @@ -23,6 +23,10 @@ cy.testBackendSystemDesign = { new: { title: 'New Design Change', url: 'system_design/new', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + back: defaultConfig._button + '[title="Back"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/system/emails.js b/cypress/support/openmage/backend/system/emails.js index 2c25baebadd..c563d29aa19 100644 --- a/cypress/support/openmage/backend/system/emails.js +++ b/cypress/support/openmage/backend/system/emails.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemEmailTemplate = { config: { _id: '#nav-admin-system-email_template', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Transactional Emails', url: 'system_email_template/index', @@ -23,6 +23,13 @@ cy.testBackendSystemEmailTemplate = { new: { title: 'New Email Template', url: 'system_email_template/new', + __buttons: { + save: defaultConfig._button + '[title="Save Template"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + convert: defaultConfig._button + '[title="Convert to Plain Text"]', + preview: defaultConfig._button + '[title="Preview Template"]', + }, }, }, } diff --git a/cypress/support/openmage/backend/system/index.js b/cypress/support/openmage/backend/system/indexer.js similarity index 59% rename from cypress/support/openmage/backend/system/index.js rename to cypress/support/openmage/backend/system/indexer.js index 46ab6f07bf6..47e163a1028 100644 --- a/cypress/support/openmage/backend/system/index.js +++ b/cypress/support/openmage/backend/system/indexer.js @@ -1,13 +1,8 @@ -const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', -} - cy.testBackendSystemIndex = { config: { _id: '#nav-admin-system-index', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', list: { title: 'Index Management', url: 'process/list', diff --git a/cypress/support/openmage/backend/system/my-account.js b/cypress/support/openmage/backend/system/my-account.js index 32ab266a3d8..a9441aa4e3b 100644 --- a/cypress/support/openmage/backend/system/my-account.js +++ b/cypress/support/openmage/backend/system/my-account.js @@ -1,18 +1,19 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemMyAccount = { config: { _id: '#nav-admin-system-myaccount', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'My Account', url: 'system_account/index', __buttons: { - save: '.form-buttons button[title="Save Account"]', + save: defaultConfig._button + '[title="Save Account"]', + reset: defaultConfig._button + '[title="Reset"]', }, __validation: { _input: { diff --git a/cypress/support/openmage/backend/system/store.js b/cypress/support/openmage/backend/system/store.js index ccbebc7e99f..896d341396f 100644 --- a/cypress/support/openmage/backend/system/store.js +++ b/cypress/support/openmage/backend/system/store.js @@ -1,20 +1,20 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemStore = { config: { _id: '#nav-admin-system-store', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Manage Stores', url: 'system_store/index', __buttons: { - addWebsite: '.form-buttons button[title="Create Website"]', - addStore: '.form-buttons button[title="Create Store"]', - addStoreView: '.form-buttons button[title="Create Store View"]', + addWebsite: defaultConfig._button + '[title="Create Website"]', + addStore: defaultConfig._button + '[title="Create Store"]', + addStoreView: defaultConfig._button + '[title="Create Store View"]', }, }, }, diff --git a/cypress/support/openmage/backend/system/variable.js b/cypress/support/openmage/backend/system/variable.js index 13f16924a76..41dd82478a0 100644 --- a/cypress/support/openmage/backend/system/variable.js +++ b/cypress/support/openmage/backend/system/variable.js @@ -1,13 +1,13 @@ const defaultConfig = { - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', + _button: '.form-buttons button', } cy.testBackendSystemVariable = { config: { _id: '#nav-admin-system-variable', - _id_parent: defaultConfig._id_parent, - _h3: defaultConfig._h3, + _id_parent: '#nav-admin-system', + _h3: 'h3.icon-head', + _button: defaultConfig._button, index: { title: 'Custom Variables', url: 'system_variable/index', @@ -23,6 +23,12 @@ cy.testBackendSystemVariable = { new: { title: 'New Custom Variable', url: 'system_variable/new', + __buttons: { + save: defaultConfig._button + '[title="Save"]', + saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', + back: defaultConfig._button + '[title="Back"]', + reset: defaultConfig._button + '[title="Reset"]', + }, }, }, } From 393fac6d7265aed68fab8e02895544de3e73a342 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 06:33:18 +0200 Subject: [PATCH 10/29] typo --- cypress/e2e/openmage/backend/customer/groups.cy.js | 2 +- cypress/support/openmage/backend/customer/groups.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js index affeeaea8f6..dc6b8053338 100644 --- a/cypress/e2e/openmage/backend/customer/groups.cy.js +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.save); + tools.clickAction(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/support/openmage/backend/customer/groups.js b/cypress/support/openmage/backend/customer/groups.js index 17d3f9cda11..516f8cef43b 100644 --- a/cypress/support/openmage/backend/customer/groups.js +++ b/cypress/support/openmage/backend/customer/groups.js @@ -13,7 +13,7 @@ cy.testBackendCustomerGroups = { url: 'customer_group/index', _grid: '#customerGroupGrid_table', __buttons: { - save: defaultConfig._button + '[title="Add New Customer Group"]', + add: defaultConfig._button + '[title="Add New Customer Group"]', }, }, edit: { From 168024d43df2a330512415bc444e0a6c556ec1f0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 06:35:46 +0200 Subject: [PATCH 11/29] typo --- cypress/support/e2e.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 117d1837acc..74ec4cb4b9a 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -45,7 +45,7 @@ import './openmage/backend/system/config' import './openmage/backend/system/currency' import './openmage/backend/system/design' import './openmage/backend/system/emails' -import './openmage/backend/system/index' +import './openmage/backend/system/indexer' import './openmage/backend/system/my-account' import './openmage/backend/system/store' import './openmage/backend/system/variable' From 1b07150b3e42b93df21e04863054d92180179aa5 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 06:45:34 +0200 Subject: [PATCH 12/29] sonar --- cypress/support/openmage.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 2f5cc47b2bd..214c4aaadff 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -18,17 +18,17 @@ cy.openmage = { buttons: (path, log = 'Checking for existing buttons') => { cy.log(log); if (path.__buttons !== undefined) { - Object.keys(path.__buttons).forEach(button => { + for (const button of Object.keys(path.__buttons)) { cy.get(path.__buttons[button]).should('exist'); - }); + }; } }, fields: (path, log = 'Checking for existing fields') => { cy.log(log); if (path.__fields !== undefined) { - Object.keys(path.__fields).forEach(field => { + for (const field of Object.keys(path.__fields)) { cy.get(path.__fields[field]).should('exist'); - }); + }; } }, pageElements: (test, path) => { @@ -53,16 +53,16 @@ cy.openmage = { cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); cy.log('Checking for existing buttons'); - Object.keys(path.__buttons).forEach(button => { + for (const button of Object.keys(path.__buttons)) { cy.get(path.__buttons[button]).should('exist'); - }); + }; } if (path.__fields !== undefined) { cy.log('Checking for existing fields'); - Object.keys(path.__fields).forEach(field => { + for (const field of Object.keys(path.__fields)) { cy.get(path.__fields[field].selector).should('exist'); - }); + }; } }, }, From ade1959fce13bb1db1372c1a2ad6c4600fe49725 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 06:49:20 +0200 Subject: [PATCH 13/29] typo --- cypress/support/openmage/backend/cms/block.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/openmage/backend/cms/block.js b/cypress/support/openmage/backend/cms/block.js index 1cd75f495a2..31eb8a0e994 100644 --- a/cypress/support/openmage/backend/cms/block.js +++ b/cypress/support/openmage/backend/cms/block.js @@ -13,8 +13,8 @@ const defaultConfig = { block_is_active : { selector: '#block_is_active', }, - block_is_active : { - selector: '#block_is_active', + block_content : { + selector: '#block_content', }, }, } From 8ada203c20f59365bd502294deba6cd7901c0b75 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 23:22:00 +0200 Subject: [PATCH 14/29] typo --- .../e2e/openmage/backend/system/config/customers/promo.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 5cd2d2204c3..18bbe9f259d 100644 --- a/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js +++ b/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js @@ -1,5 +1,5 @@ -const test = cy.testBackendSystem.config.customers.promo; -const saveButton = cy.testBackendSystem.config._buttonSave; +const test = cy.testBackendSystemConfig.customers.promo; +const saveButton = cy.testBackendSystemConfig._buttonSave; const tools = cy.openmage.tools; const validation = cy.openmage.validation; From c032a11b57b55ebc17607e707987013c3ef589a3 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 6 Oct 2025 23:56:41 +0200 Subject: [PATCH 15/29] typo --- .../e2e/openmage/backend/system/config/customers/promo.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 18bbe9f259d..00e3ec08bcd 100644 --- a/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js +++ b/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js @@ -1,5 +1,5 @@ -const test = cy.testBackendSystemConfig.customers.promo; -const saveButton = cy.testBackendSystemConfig._buttonSave; +const test = cy.testBackendSystemConfig.config.customers.promo; +const saveButton = cy.testBackendSystemConfig.config._buttonSave; const tools = cy.openmage.tools; const validation = cy.openmage.validation; From 8d10aa8aabc65815e88a803eafe5bea0e06103ca Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 01:49:36 +0200 Subject: [PATCH 16/29] refactor --- .../openmage/backend/catalog/products.cy.js | 4 +- .../e2e/openmage/backend/catalog/search.cy.js | 4 +- .../openmage/backend/catalog/sitemap.cy.js | 2 +- .../backend/catalog/urlrewrites.cy.js | 4 +- cypress/e2e/openmage/backend/cms/block.cy.js | 4 +- cypress/e2e/openmage/backend/cms/page.cy.js | 20 +- cypress/e2e/openmage/backend/cms/widget.cy.js | 4 +- .../openmage/backend/customer/customer.cy.js | 4 +- .../openmage/backend/customer/groups.cy.js | 4 +- .../backend/newsletter/templates.cy.js | 4 +- .../e2e/openmage/backend/promo/catalog.cy.js | 4 +- .../e2e/openmage/backend/promo/quote.cy.js | 4 +- .../openmage/backend/sales/creditmemo.cy.js | 2 +- .../e2e/openmage/backend/sales/invoice.cy.js | 2 +- .../e2e/openmage/backend/sales/order.cy.js | 2 +- .../e2e/openmage/backend/sales/shipment.cy.js | 2 +- .../system/config/catalog/sitemap.cy.js | 8 +- .../system/config/customers/promo.cy.js | 2 +- .../openmage/backend/system/currency.cy.js | 4 +- .../e2e/openmage/backend/system/design.cy.js | 2 +- .../e2e/openmage/backend/system/emails.cy.js | 2 +- .../openmage/backend/system/my-account.cy.js | 2 +- .../openmage/backend/system/variable.cy.js | 2 +- .../frontend/customer/account/create.cy.js | 10 +- .../frontend/newsletter-subscribe.cy.js | 9 +- cypress/support/openmage.js | 302 +++++++++--------- 26 files changed, 210 insertions(+), 203 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/products.cy.js b/cypress/e2e/openmage/backend/catalog/products.cy.js index 88489ab12ad..99179baf602 100644 --- a/cypress/e2e/openmage/backend/catalog/products.cy.js +++ b/cypress/e2e/openmage/backend/catalog/products.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', '905'); + tools.clickContains(test.index._grid, 'td', '905'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); diff --git a/cypress/e2e/openmage/backend/catalog/search.cy.js b/cypress/e2e/openmage/backend/catalog/search.cy.js index 5b6e7afaaee..d0abf8db8c8 100644 --- a/cypress/e2e/openmage/backend/catalog/search.cy.js +++ b/cypress/e2e/openmage/backend/catalog/search.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'classic'); + tools.clickContains(test.index._grid, 'td', 'classic'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 0e9c32a9fa5..8485a11c757 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 fbbe31e24f9..d298a42d481 100644 --- a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js +++ b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', '116238'); + tools.clickContains(test.index._grid, 'td', '116238'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 2c1c6df83e2..2d8c3cd99eb 100644 --- a/cypress/e2e/openmage/backend/cms/block.cy.js +++ b/cypress/e2e/openmage/backend/cms/block.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'category-landingpage-home'); + tools.clickContains(test.index._grid, 'td', 'category-landingpage-home'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 1f247e39a8d..4eb76a0617e 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -14,43 +14,43 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); it('tests to disable a CMS page that is used in config', () => { - tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); test.edit.disablePage(); - tools.clickAction(test.edit.__buttons.saveAndContinue); + tools.click(test.edit.__buttons.saveAndContinue); 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}); }); it('tests to delete a CMS page that is used in config', () => { - tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); - tools.clickAction(test.edit.__buttons.delete); + tools.click(test.edit.__buttons.delete); validation.hasErrorMessage('Cannot delete page'); cy.get('#messages').screenshot('error-delete-active-page', { overwrite: true}); }); it('tests to add a CMS page', () => { - tools.clickAction(test.index.__buttons.add); - tools.clickAction(test.edit.__buttons.saveAndContinue); + tools.click(test.index.__buttons.add); + tools.click(test.edit.__buttons.saveAndContinue); // @todo add validation for required fields }); it('tests to un-asign a CMS page that is used in config', () => { - tools.clickGridRow(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); //cy.log('Asign another store to the CMS page'); //cy.get('#page_store_id') @@ -63,7 +63,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { test.edit.resetStores(); - tools.clickAction(test.edit.__buttons.saveAndContinue); + tools.click(test.edit.__buttons.saveAndContinue); validation.hasSuccessMessage('The page has been saved.'); }); diff --git a/cypress/e2e/openmage/backend/cms/widget.cy.js b/cypress/e2e/openmage/backend/cms/widget.cy.js index d7a2dfcd88e..d951ae9c09e 100644 --- a/cypress/e2e/openmage/backend/cms/widget.cy.js +++ b/cypress/e2e/openmage/backend/cms/widget.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'Couponing Block'); + tools.clickContains(test.index._grid, 'td', 'Couponing Block'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/customer/customer.cy.js b/cypress/e2e/openmage/backend/customer/customer.cy.js index 2c220548005..a7881790dd6 100644 --- a/cypress/e2e/openmage/backend/customer/customer.cy.js +++ b/cypress/e2e/openmage/backend/customer/customer.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', '424-555-0000'); + tools.clickContains(test.index._grid, 'td', '424-555-0000'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js index dc6b8053338..6b354f241e7 100644 --- a/cypress/e2e/openmage/backend/customer/groups.cy.js +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'General'); + tools.clickContains(test.index._grid, 'td', 'General'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/newsletter/templates.cy.js b/cypress/e2e/openmage/backend/newsletter/templates.cy.js index 95d5f08a071..a863769acb8 100644 --- a/cypress/e2e/openmage/backend/newsletter/templates.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/templates.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'Example'); + tools.clickContains(test.index._grid, 'td', 'Example'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/promo/catalog.cy.js b/cypress/e2e/openmage/backend/promo/catalog.cy.js index c95590f8f4e..fcb769ce857 100644 --- a/cypress/e2e/openmage/backend/promo/catalog.cy.js +++ b/cypress/e2e/openmage/backend/promo/catalog.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', 'Candle'); + tools.clickContains(test.index._grid, 'td', 'Candle'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/promo/quote.cy.js b/cypress/e2e/openmage/backend/promo/quote.cy.js index f6605ca124c..7d230163c36 100644 --- a/cypress/e2e/openmage/backend/promo/quote.cy.js +++ b/cypress/e2e/openmage/backend/promo/quote.cy.js @@ -13,12 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - tools.clickGridRow(test.index._grid, 'td', '$500'); + tools.clickContains(test.index._grid, 'td', '$500'); check.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 941698eab45..b0c9f978ce0 100644 --- a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js +++ b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests view route`, () => { - tools.clickGridRow(test.index._grid, 'td', '100000007'); + tools.clickContains(test.index._grid, 'td', '100000007'); check.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 b056d8e87fa..d3f440bc497 100644 --- a/cypress/e2e/openmage/backend/sales/invoice.cy.js +++ b/cypress/e2e/openmage/backend/sales/invoice.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests view route`, () => { - tools.clickGridRow(test.index._grid, 'td', '100000040'); + tools.clickContains(test.index._grid, 'td', '100000040'); check.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 0970bc51e88..97390f70209 100644 --- a/cypress/e2e/openmage/backend/sales/order.cy.js +++ b/cypress/e2e/openmage/backend/sales/order.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests view route`, () => { - tools.clickGridRow(test.index._grid, 'td', '145000004'); + tools.clickContains(test.index._grid, 'td', '145000004'); check.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 fe06c89e0e9..ba19ad7e36c 100644 --- a/cypress/e2e/openmage/backend/sales/shipment.cy.js +++ b/cypress/e2e/openmage/backend/sales/shipment.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests view route`, () => { - tools.clickGridRow(test.index._grid, 'td', '100000032'); + tools.clickContains(test.index._grid, 'td', '100000032'); check.pageElements(test, test.view); }); }); 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 a69064e117a..8c041f5aaaf 100644 --- a/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/system/config/catalog/sitemap.cy.js @@ -13,19 +13,19 @@ describe(`Checks admin system "${test.h3}" settings`, () => { it(`tests invalid string priority`, () => { validation.fillFields(priority, validation.number, validation.test.string); - tools.clickAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.number); }); it(`tests invalid number priority`, () => { validation.fillFields(priority, validation.numberRange, validation.test.numberGreater1); - tools.clickAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.numberRange); }); it(`tests empty priority`, () => { validation.fillFields(priority, validation.requiredEntry); - tools.clickAction(saveButton); + tools.click(saveButton); validation.validateFields(priority, validation.requiredEntry); }); @@ -33,7 +33,7 @@ describe(`Checks admin system "${test.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); - tools.clickAction(saveButton); + 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 00e3ec08bcd..39aefee6f52 100644 --- a/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js +++ b/cypress/e2e/openmage/backend/system/config/customers/promo.cy.js @@ -20,7 +20,7 @@ describe(`Checks admin system "${test.h3}" settings`, () => { const fields = fieldset._input; const validate = validation.digits; validation.fillFields(fields, validate, validation.test.string); - tools.clickAction(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 index a3c1a84f068..0defba10b8d 100644 --- a/cypress/e2e/openmage/backend/system/currency.cy.js +++ b/cypress/e2e/openmage/backend/system/currency.cy.js @@ -20,7 +20,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { cy.get('body').then($body => { if ($body.find(test.index.__validation._input.from).length > 0) { cy.get(test.index.__validation._input.from).clear(); - tools.clickAction(test.index.__buttons.save); + tools.click(test.index.__buttons.save); validation.hasWarningMessage(warning); validation.hasSuccessMessage(success); } @@ -31,7 +31,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { 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.clickAction(test.index.__buttons.save); + 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 0a75be0f4e2..01dc045dff5 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 279f6e245da..6a42053aa71 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/system/my-account.cy.js b/cypress/e2e/openmage/backend/system/my-account.cy.js index 982af5e1327..354842e845e 100644 --- a/cypress/e2e/openmage/backend/system/my-account.cy.js +++ b/cypress/e2e/openmage/backend/system/my-account.cy.js @@ -16,7 +16,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { it(`tests empty input`, () => { const validate = validation.requiredEntry; validation.fillFields(test.index.__validation._input, validate); - tools.clickAction(test.index.__buttons.save); + tools.click(test.index.__buttons.save); validation.validateFields(test.index.__validation._input, validate); }); }); diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 480f09e00d6..48752bd50b0 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -18,7 +18,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests new route`, () => { - tools.clickAction(test.index.__buttons.add); + tools.click(test.index.__buttons.add); check.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 c40ecdd9334..9e81c05352d 100644 --- a/cypress/e2e/openmage/frontend/customer/account/create.cy.js +++ b/cypress/e2e/openmage/frontend/customer/account/create.cy.js @@ -14,14 +14,14 @@ describe('Checks customer account create', () => { it('Submits empty form', () => { validation.fillFields(fields, validation.requiredEntry); - tools.clickAction(test._buttonSubmit); + tools.click(test._buttonSubmit); validation.validateFields(fields, validation.requiredEntry); }); it('Submits empty form, no js', () => { validation.fillFields(fields, validation.requiredEntry); validation.removeClasses(fields); - tools.clickAction(test._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.') @@ -33,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'); - tools.clickAction(test._buttonSubmit); + 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'; @@ -49,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); - tools.clickAction(test._buttonSubmit); + 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 a539da446ed..1b4b46fbfba 100644 --- a/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js +++ b/cypress/e2e/openmage/frontend/newsletter-subscribe.cy.js @@ -1,5 +1,6 @@ const test = cy.testFrontend.homepage; const tools = cy.openmage.tools; +const utils = cy.openmage.utils; const validation = cy.openmage.validation; describe('Check newsletter subscribe', () => { @@ -10,20 +11,20 @@ describe('Check newsletter subscribe', () => { it('tests empty input', () => { const error = validation.requiredEntry.error; cy.get(test.newsletter._id).should('have.value', ''); - tools.clickAction(test.newsletter._buttonSubmit); + tools.click(test.newsletter._buttonSubmit); cy.get('#advice-required-entry-newsletter').should('include.text', error); }) it('Test valid input twice', () => { - const email = tools.generateRandomEmail(); + const email = utils.generateRandomEmail(); cy.log('Test first valid input'); cy.get(test.newsletter._id).type(email).should('have.value', email); - tools.clickAction(test.newsletter._buttonSubmit); + tools.click(test.newsletter._buttonSubmit); validation.hasSuccessMessage('Thank you for your subscription.'); cy.log('Test second valid input'); cy.get(test.newsletter._id).type(email).should('have.value', email); - tools.clickAction(test.newsletter._buttonSubmit); + tools.click(test.newsletter._buttonSubmit); validation.hasErrorMessage('There was a problem with the subscription: This email address is already registered.'); }) }) diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 214c4aaadff..7dcfec64228 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -1,163 +1,169 @@ -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: (path, log = 'Checking for existing buttons') => { + cy.log(log); + if (path.__buttons !== undefined) { + for (const button of Object.keys(path.__buttons)) { + cy.get(path.__buttons[button]).should('exist'); + }; } }, - check: { - buttons: (path, log = 'Checking for existing buttons') => { - cy.log(log); - if (path.__buttons !== undefined) { - for (const button of Object.keys(path.__buttons)) { - cy.get(path.__buttons[button]).should('exist'); - }; - } - }, - 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]).should('exist'); - }; - } - }, - pageElements: (test, path) => { - cy.log('Checking for title'); - cy.get(test._h3).should('include.text', path.title); + 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]).should('exist'); + }; + } + }, + pageElements: (test, path) => { + cy.log('Checking for title'); + cy.get(test._h3).should('include.text', path.title); - cy.log('Checkinng for URL') - cy.url().should('include', path.url); + cy.log('Checkinng for URL') + cy.url().should('include', path.url); - cy.log('Checking for active parent class'); - cy.get(test._id_parent).should('have.class', 'active'); + cy.log('Checking for active parent class'); + cy.get(test._id_parent).should('have.class', 'active'); - cy.log('Checking for active class'); - cy.get(test._id).should('have.class', 'active'); + cy.log('Checking for active class'); + cy.get(test._id).should('have.class', 'active'); - if (path._grid !== undefined) { - cy.log('Checking for existing grid'); - cy.get(path._grid).should('exist'); - } + if (path._grid !== undefined) { + cy.log('Checking for existing grid'); + cy.get(path._grid).should('exist'); + } - if (path.__buttons !== undefined) { - cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); + if (path.__buttons !== undefined) { + cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); - cy.log('Checking for existing buttons'); - for (const button of Object.keys(path.__buttons)) { - cy.get(path.__buttons[button]).should('exist'); - }; - } + cy.log('Checking for existing buttons'); + for (const button of Object.keys(path.__buttons)) { + cy.get(path.__buttons[button]).should('exist'); + }; + } - if (path.__fields !== undefined) { - cy.log('Checking for existing fields'); - for (const field of Object.keys(path.__fields)) { - cy.get(path.__fields[field].selector).should('exist'); - }; - } - }, + if (path.__fields !== undefined) { + cy.log('Checking for existing fields'); + for (const field of Object.keys(path.__fields)) { + cy.get(path.__fields[field].selector).should('exist'); + }; + } }, - tools: { - clickAction: (selector, log = 'Clicking on button') => { - cy.log(log); - cy.get(selector).first().click({force: true, multiple: false}); - }, - clickGridRow: (grid, selector, content, log = 'Clicking on grid') => { - cy.log(log); - cy.get(grid).contains(selector, content).first().click({force: true, multiple: false}); - }, - 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.tools = { + click: (selector, log = 'Clicking on something') => { + cy.log(log); + cy.get(selector).first().click({force: true, multiple: false}); }, - 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); + clickContains: (element, selector, content, log = 'Clicking on some content') => { + cy.log(log); + cy.get(element).contains(selector, content).first().click({force: true, multiple: false}); + }, +}, - 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.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'); - }); - }, - 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('.error-msg').should('include.text', message); - }, - hasSuccessMessage: (message) =>{ - cy.log('Checking for success messages'); - cy.get('.success-msg').should('include.text', message); - }, - hasWarningMessage: (message) =>{ - cy.log('Checking for warning messages'); - cy.get('.warning-msg').should('include.text', message); - }, - } + .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'); + }); + }, + 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('.error-msg').should('include.text', message); + }, + hasSuccessMessage: (message) =>{ + cy.log('Checking for success messages'); + cy.get('.success-msg').should('include.text', message); + }, + hasWarningMessage: (message) =>{ + cy.log('Checking for warning messages'); + cy.get('.warning-msg').should('include.text', message); + }, } \ No newline at end of file From 988c29b93af5ddaeb4f94b6d5a6396170041e9fe Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 04:18:44 +0200 Subject: [PATCH 17/29] refactor --- cypress/e2e/openmage/backend/dashboard.cy.js | 2 +- .../e2e/openmage/backend/system/indexer.cy.js | 6 +- .../openmage/backend/catalog/categories.js | 31 +++--- .../openmage/backend/catalog/products.js | 65 +++++++------ .../openmage/backend/catalog/search.js | 71 +++++++------- .../openmage/backend/catalog/sitemap.js | 49 +++++----- .../openmage/backend/catalog/urlrewrite.js | 67 ++++++------- cypress/support/openmage/backend/cms/block.js | 79 +++++++-------- cypress/support/openmage/backend/cms/page.js | 95 ++++++++++--------- .../support/openmage/backend/cms/widget.js | 73 +++++++------- .../openmage/backend/customer/customer.js | 77 +++++++-------- .../openmage/backend/customer/groups.js | 69 +++++++------- .../openmage/backend/customer/online.js | 21 ++-- cypress/support/openmage/backend/dashboard.js | 21 ++-- .../openmage/backend/newsletter/queue.js | 23 ++--- .../openmage/backend/newsletter/report.js | 23 ++--- .../openmage/backend/newsletter/subscriber.js | 23 ++--- .../openmage/backend/newsletter/templates.js | 81 ++++++++-------- .../support/openmage/backend/promo/catalog.js | 81 ++++++++-------- .../support/openmage/backend/promo/quote.js | 75 ++++++++------- .../openmage/backend/sales/creditmemo.js | 44 +++++---- .../support/openmage/backend/sales/invoice.js | 44 +++++---- .../support/openmage/backend/sales/order.js | 48 +++++----- .../openmage/backend/sales/shipment.js | 44 +++++---- .../openmage/backend/sales/transactions.js | 23 ++--- .../backend/system/adminnotification.js | 23 ++--- .../support/openmage/backend/system/cache.js | 33 +++---- .../support/openmage/backend/system/config.js | 90 +++++++++--------- .../openmage/backend/system/currency.js | 43 +++++---- .../support/openmage/backend/system/design.js | 57 +++++------ .../support/openmage/backend/system/emails.js | 63 ++++++------ .../openmage/backend/system/indexer.js | 23 ++--- .../openmage/backend/system/my-account.js | 49 +++++----- .../support/openmage/backend/system/store.js | 33 +++---- .../openmage/backend/system/variable.js | 61 ++++++------ cypress/support/openmage/frontend/paths.js | 51 +++++----- 36 files changed, 915 insertions(+), 846 deletions(-) diff --git a/cypress/e2e/openmage/backend/dashboard.cy.js b/cypress/e2e/openmage/backend/dashboard.cy.js index d8628ada56b..097a6096e76 100644 --- a/cypress/e2e/openmage/backend/dashboard.cy.js +++ b/cypress/e2e/openmage/backend/dashboard.cy.js @@ -1,4 +1,4 @@ -const test = cy.testBackendDashboard.dashboard; +const test = cy.testBackendDashboard.config; const check = cy.openmage.check; describe(`Checks admin system "${test.index.title}"`, () => { diff --git a/cypress/e2e/openmage/backend/system/indexer.cy.js b/cypress/e2e/openmage/backend/system/indexer.cy.js index 28e7641ba79..cfdd74f7a65 100644 --- a/cypress/e2e/openmage/backend/system/indexer.cy.js +++ b/cypress/e2e/openmage/backend/system/indexer.cy.js @@ -1,13 +1,13 @@ const test = cy.testBackendSystemIndex.config; const check = cy.openmage.check; -describe(`Checks admin system "${test.list.title}"`, () => { +describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { cy.adminLogIn(); - cy.adminGoToTestRoute(test, test.list); + cy.adminGoToTestRoute(test, test.index); }); it(`tests index route`, () => { - check.pageElements(test, test.list); + check.pageElements(test, test.index); }); }); diff --git a/cypress/support/openmage/backend/catalog/categories.js b/cypress/support/openmage/backend/catalog/categories.js index 4fe04b3ee75..e5b953311f2 100644 --- a/cypress/support/openmage/backend/catalog/categories.js +++ b/cypress/support/openmage/backend/catalog/categories.js @@ -1,20 +1,21 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button' } -cy.testBackendCatalogProductsCategories = { - config: { - _id: '#nav-admin-catalog-categories', - _id_parent: '#nav-admin-catalog', - _h3: '#category-edit-container h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'New Root Category', - url: 'catalog_category/index', - __buttons: { - save: defaultConfig._button + '[title="Save Category"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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 index 9bdc64152e5..6f3872af790 100644 --- a/cypress/support/openmage/backend/catalog/products.js +++ b/cypress/support/openmage/backend/catalog/products.js @@ -1,36 +1,39 @@ -const defaultConfig = { +const base = { _button: '.content-header button' } -cy.testBackendCatalogProducts = { - config: { - _id: '#nav-admin-catalog-products', - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Products', - url: 'catalog_product/index', - _grid: '#productGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add Product"]', - }, - }, - edit: { - title: 'Plaid Cotton', - url: 'catalog_product/edit', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete"]', - duplicate: defaultConfig._button + '[title="Duplicate"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Product', - url: 'catalog_product/new', - }, +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 index 7fe0ae03129..0016e13b7e5 100644 --- a/cypress/support/openmage/backend/catalog/search.js +++ b/cypress/support/openmage/backend/catalog/search.js @@ -1,39 +1,42 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendCatalogSearch = { - config: { - _id: '#nav-admin-catalog-search', - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Search', - url: 'catalog_search/index', - _grid: '#catalog_search_grid_table', - __buttons: { - add: defaultConfig._button + '[title="Add New Search Term"]', - }, - }, - edit: { - title: 'Edit Search', - url: 'catalog_search/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Search"]', - delete: defaultConfig._button + '[title="Delete Search"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Search', - url: 'catalog_search/new', - __buttons: { - save: defaultConfig._button + '[title="Save Search"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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 index a00dd5049b8..84fb5596da8 100644 --- a/cypress/support/openmage/backend/catalog/sitemap.js +++ b/cypress/support/openmage/backend/catalog/sitemap.js @@ -1,28 +1,31 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button' } -cy.testBackendCatalogSitemap = { - config: { - _id: '#nav-admin-catalog-sitemap', - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Google Sitemap', - url: 'sitemap/index', - _grid: '#sitemapGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add Sitemap"]', - }, - }, - edit: { - title: 'Edit Sitemap', - url: 'sitemap/edit', - }, - new: { - title: 'New Sitemap', - url: 'sitemap/new', - }, +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 index 030bc33c321..99c4c76dd6b 100644 --- a/cypress/support/openmage/backend/catalog/urlrewrite.js +++ b/cypress/support/openmage/backend/catalog/urlrewrite.js @@ -1,37 +1,40 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendUrlrewrite = { - config: { - _id: '#nav-admin-catalog-urlrewrite', - _id_parent: '#nav-admin-catalog', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'URL Rewrite Management', - url: 'urlrewrite/index', - _grid: '#urlrewriteGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add URL Rewrite"]', - }, - }, - edit: { - title: 'Edit URL Rewrite', - url: 'urlrewrite/edit', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - delete: defaultConfig._button + '[title="Delete"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'Add New URL Rewrite', - url: 'urlrewrite/edit', - __buttons: { - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index 31eb8a0e994..654f683fb94 100644 --- a/cypress/support/openmage/backend/cms/block.js +++ b/cypress/support/openmage/backend/cms/block.js @@ -1,4 +1,4 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', __fields: { block_title : { @@ -19,42 +19,45 @@ const defaultConfig = { }, } -cy.testBackendCmsBlock = { - config: { - _id: '#nav-admin-cms-block', - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Static Blocks', - url: 'cms_block/index', - _grid: '#cmsBlockGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add New Block"]', - }, - }, - edit: { - title: 'Edit Block', - url: 'cms_block/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Block"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete Block"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - __fields: defaultConfig.__fields, - }, - new: { - title: 'New Block', - url: 'cms_block/new', - __buttons: { - save: defaultConfig._button + '[title="Save Block"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - __fields: defaultConfig.__fields, - }, +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 index ff7ec1c9885..e64201f4344 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -1,51 +1,54 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendCmsPage = { - config: { - _id: '#nav-admin-cms-page', - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Pages', - url: 'cms_page/index', - _grid: '#cmsPageGrid', - __buttons: { - add: defaultConfig._button + '[title="Add New Page"]', - }, - }, - edit: { - title: 'Edit Page', - url: 'cms_page/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Page"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete Page"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - disablePage: () => { - cy.log('Disable the CMS page'); - cy.get('#page_is_active') - .select('Disabled'); - }, - resetStores: () => { - cy.log('Restore the default store to the CMS page'); - cy.get('#page_store_id') - .select([1, 2, 3]); - }, - }, - new: { - title: 'New Page', - url: 'cms_page/new', - __buttons: { - save: defaultConfig._button + '[title="Save Page"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +cy.testBackendCmsPage = {}; + +cy.testBackendCmsPage.config = { + _id: '#nav-admin-cms-page', + _id_parent: '#nav-admin-cms', + _h3: 'h3.icon-head', + _button: base._button, +} + +cy.testBackendCmsPage.config.index = { + title: 'Manage Pages', + url: 'cms_page/index', + _grid: '#cmsPageGrid', + __buttons: { + add: base._button + '[title="Add New 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"]', + }, + disablePage: () => { + cy.log('Disable the CMS page'); + cy.get('#page_is_active') + .select('Disabled'); + }, + resetStores: () => { + cy.log('Restore the default store to the CMS page'); + cy.get('#page_store_id') + .select([1, 2, 3]); + }, +} + +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"]', }, } diff --git a/cypress/support/openmage/backend/cms/widget.js b/cypress/support/openmage/backend/cms/widget.js index b7c20ad88e2..7a2cf4ec784 100644 --- a/cypress/support/openmage/backend/cms/widget.js +++ b/cypress/support/openmage/backend/cms/widget.js @@ -1,39 +1,42 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendCmsWidget = { - config: { - _id: '#nav-admin-cms-widget_instance', - _id_parent: '#nav-admin-cms', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Widget Instances', - url: 'widget_instance/index', - _grid: '#widgetInstanceGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add New Widget Instance"]', - }, - }, - edit: { - title: 'Widget', - url: 'widget_instance/edit', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Widget Instance', - url: 'widget_instance/new', - __buttons: { - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - } +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 index 9fa4f2fe4b2..229939797a2 100644 --- a/cypress/support/openmage/backend/customer/customer.js +++ b/cypress/support/openmage/backend/customer/customer.js @@ -1,42 +1,45 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button' } -cy.testBackendCustomerCustomer = { - config: { - _id: '#nav-admin-customer-manage', - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Customers', - url: 'customer/index', - _grid: '#customerGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add New Customer"]', - }, - }, - edit: { - title: 'John Smith', - url: 'customer/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Customer"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete Customer"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - createOrder: defaultConfig._button + '[title="Create Order"]', - }, - }, - new: { - title: 'New Customer', - url: 'customer/new', - __buttons: { - save: defaultConfig._button + '[title="Save Customer"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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 index 516f8cef43b..982b435795c 100644 --- a/cypress/support/openmage/backend/customer/groups.js +++ b/cypress/support/openmage/backend/customer/groups.js @@ -1,38 +1,41 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button' } -cy.testBackendCustomerGroups = { - config: { - _id: '#nav-admin-customer-group', - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Customer Groups', - url: 'customer_group/index', - _grid: '#customerGroupGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add New Customer Group"]', - }, - }, - edit: { - title: 'Edit Customer Group', - url: 'customer_group/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Customer Group"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Customer Group', - url: 'customer_group/new', - __buttons: { - save: defaultConfig._button + '[title="Save Customer Group"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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 index 7b47515ba4a..1b3b4e7bc10 100644 --- a/cypress/support/openmage/backend/customer/online.js +++ b/cypress/support/openmage/backend/customer/online.js @@ -1,11 +1,12 @@ -cy.testBackendCustomerOnline = { - config: { - _id: '#nav-admin-customer-online', - _id_parent: '#nav-admin-customer', - _h3: 'h3.icon-head', - index: { - title: 'Online Customers', - url: 'customer_online/index', - }, - }, +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 index bac6b522298..0f1e0d643be 100644 --- a/cypress/support/openmage/backend/dashboard.js +++ b/cypress/support/openmage/backend/dashboard.js @@ -1,11 +1,12 @@ -cy.testBackendDashboard = { - dashboard: { - _id: '#nav-admin-dashboard', - _id_parent: '#nav-admin-dashboard', - _h3: 'h3.head-dashboard', - index: { - title: 'Dashboard', - url: 'dashboard/index', - }, - }, +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 index a4eaa30af1c..cb4484df9a0 100644 --- a/cypress/support/openmage/backend/newsletter/queue.js +++ b/cypress/support/openmage/backend/newsletter/queue.js @@ -1,12 +1,13 @@ -cy.testBackendNewsletterQueue = { - config: { - _id: '#nav-admin-newsletter-queue', - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', - index: { - title: 'Newsletter Queue', - url: 'newsletter_queue/index', - _grid: '#queueGrid_table', - }, - }, +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 index 3fcef90d0ed..a9220db6cf8 100644 --- a/cypress/support/openmage/backend/newsletter/report.js +++ b/cypress/support/openmage/backend/newsletter/report.js @@ -1,12 +1,13 @@ -cy.testBackendNewsletterReport = { - config: { - _id: '#nav-admin-newsletter-problem', - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', - index: { - title: 'Newsletter Problem Reports', - url: 'newsletter_problem/index', - _grid: '#problemGrid_table', - }, - }, +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 index dc0a94868cc..622b0ca618c 100644 --- a/cypress/support/openmage/backend/newsletter/subscriber.js +++ b/cypress/support/openmage/backend/newsletter/subscriber.js @@ -1,12 +1,13 @@ -cy.testBackendNewsletterSubscriber = { - config: { - _id: '#nav-admin-newsletter-subscriber', - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', - index: { - title: 'Newsletter Subscribers', - url: 'newsletter_subscriber/index', - _grid: '#subscriberGrid_table', - }, - }, +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 index f1a29790412..b5e81bdf8ae 100644 --- a/cypress/support/openmage/backend/newsletter/templates.js +++ b/cypress/support/openmage/backend/newsletter/templates.js @@ -1,44 +1,47 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendNewsletterTemplates = { - config: { - _id: '#nav-admin-newsletter-template', - _id_parent: '#nav-admin-newsletter', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Newsletter Templates', - url: 'newsletter_template/index', - _grid: '#newsletterTemplateGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Template"]', - }, - }, - edit: { - title: 'Edit Newsletter Template', - url: 'newsletter_template/edit', - __buttons: { - save: defaultConfig._button + '[title="Save Template"]', - saveAs: defaultConfig._button + '[title="Save As"]', - delete: defaultConfig._button + '[title="Delete Template"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - convert: defaultConfig._button + '[title="Convert to Plain Text"]', - preview: defaultConfig._button + '[title="Preview Template"]', - }, - }, - new: { - title: 'New Newsletter Template', - url: 'newsletter_template/new', - __buttons: { - save: defaultConfig._button + '[title="Save Template"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - convert: defaultConfig._button + '[title="Convert to Plain Text"]', - preview: defaultConfig._button + '[title="Preview Template"]', - }, - }, +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 index 494a66e8e25..7ac0695679e 100644 --- a/cypress/support/openmage/backend/promo/catalog.js +++ b/cypress/support/openmage/backend/promo/catalog.js @@ -1,44 +1,47 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendPromoCatalog = { - config: { - _id: '#nav-admin-promo-catalog', - _id_parent: '#nav-admin-promo', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Catalog Price Rules', - url: 'promo_catalog/index', - _grid: '#promo_catalog_grid', - __buttons: { - add: defaultConfig._button + '[title="Add New Rule"]', - apply: defaultConfig._button + '[title="Apply Rules"]', - }, - }, - edit: { - title: 'Edit Rule', - url: 'promo_catalog/edit', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - saveAndApply: defaultConfig._button + '[title="Save and Apply"]', - delete: defaultConfig._button + '[title="Delete"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Rule', - url: 'promo_catalog/new', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - saveAndApply: defaultConfig._button + '[title="Save and Apply"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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', + __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 index 0ea8219a8b8..891e8337232 100644 --- a/cypress/support/openmage/backend/promo/quote.js +++ b/cypress/support/openmage/backend/promo/quote.js @@ -1,41 +1,44 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendPromoQuote = { - config: { - _id: '#nav-admin-promo-quote', - _id_parent: '#nav-admin-promo', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Shopping Cart Price Rules', - url: 'promo_quote/index', - _grid: '#promo_quote_grid_table', - __buttons: { - add: '.form-buttons button[title="Add New Rule"]', - }, - }, - edit: { - title: 'Edit Rule', - url: 'promo_quote/edit', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - delete: defaultConfig._button + '[title="Delete"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, - new: { - title: 'New Rule', - url: 'promo_quote/new', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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 index 5485b4484c9..a5ce8292d73 100644 --- a/cypress/support/openmage/backend/sales/creditmemo.js +++ b/cypress/support/openmage/backend/sales/creditmemo.js @@ -1,26 +1,28 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSalesCreditmemo = { - config: { - _id: '#nav-admin-sales-creditmemo', - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Credit Memos', - url: 'sales_creditmemo/index', - _grid: '#sales_creditmemo_grid_table', - }, - view: { - title: 'Credit Memo #', - url: 'sales_creditmemo/view', - __buttons: { - print: defaultConfig._button + '[title="Print"]', - email: defaultConfig._button + '[title="Send Email"]', - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index bb8385c4366..9b8dcab70dc 100644 --- a/cypress/support/openmage/backend/sales/invoice.js +++ b/cypress/support/openmage/backend/sales/invoice.js @@ -1,26 +1,28 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSalesInvoice = { - config: { - _id: '#nav-admin-sales-invoice', - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Invoice', - url: 'sales_invoice/index', - _grid: '#sales_invoice_grid_table', - }, - view: { - title: 'Invoice #', - url: 'sales_invoice/view', - __buttons: { - print: defaultConfig._button + '[title="Print"]', - email: defaultConfig._button + '[title="Send Email"]', - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index b0d4a92daa7..7ec40bea13f 100644 --- a/cypress/support/openmage/backend/sales/order.js +++ b/cypress/support/openmage/backend/sales/order.js @@ -1,28 +1,30 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSalesOrder = { - config: { - _id: '#nav-admin-sales-order', - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Orders', - url: 'sales_order/index', - _grid: '#sales_order_grid_table', - __buttons: { - new: '.form-buttons button[title="Create New Order"]', - }, - }, - view: { - title: 'Order #', - url: 'sales_order/view', - __buttons: { - reorder: defaultConfig._button + '[title="Reorder"]', - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index 614f051b911..73a441fc487 100644 --- a/cypress/support/openmage/backend/sales/shipment.js +++ b/cypress/support/openmage/backend/sales/shipment.js @@ -1,26 +1,28 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSalesOrderShipment = { - config: { - _id: '#nav-admin-sales-shipment', - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Shipments', - url: 'sales_shipment/index', - _grid: '#sales_shipment_grid_table', - }, - view: { - title: 'Shipment #', - url: 'sales_shipment/view', - __buttons: { - print: defaultConfig._button + '[title="Print"]', - tracking: defaultConfig._button + '[title="Send Tracking Information"]', - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index 1d86254e7e5..67ceb3f9c89 100644 --- a/cypress/support/openmage/backend/sales/transactions.js +++ b/cypress/support/openmage/backend/sales/transactions.js @@ -1,12 +1,13 @@ -cy.testBackendSalesTransactions = { - config: { - _id: '#nav-admin-sales-transactions', - _id_parent: '#nav-admin-sales', - _h3: 'h3.icon-head', - index: { - title: 'Transactions', - url: 'sales_transactions/index', - _grid: '#order_transactions_table', - }, - }, +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 index 5cabe1dfb05..1fff5c8c056 100644 --- a/cypress/support/openmage/backend/system/adminnotification.js +++ b/cypress/support/openmage/backend/system/adminnotification.js @@ -1,12 +1,13 @@ -cy.testBackendSystemAdminnotification = { - config: { - _id: '#nav-admin-system-adminnotification', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - index: { - title: 'Messages Inbox', - url: 'notification/index', - _grid: '#notificationGrid_table', - }, - }, +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 index 113fee304d0..070579c503e 100644 --- a/cypress/support/openmage/backend/system/cache.js +++ b/cypress/support/openmage/backend/system/cache.js @@ -1,21 +1,22 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemCache = { - config: { - _id: '#nav-admin-system-cache', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Cache Storage Management', - url: 'cache/index', - _grid: '#cache_grid_table', - __buttons: { - flushApply: defaultConfig._button + '[title="Flush & Apply Updates"]', - flushCache: defaultConfig._button + '[title="Flush Cache Storage"]', - }, - }, +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 index 8ed8e03065a..04f53fbdaeb 100644 --- a/cypress/support/openmage/backend/system/config.js +++ b/cypress/support/openmage/backend/system/config.js @@ -1,52 +1,54 @@ -const defaultConfig = { +const base = { _id_parent: '#nav-admin-system', _h3: 'h3.icon-head', } -cy.testBackendSystemConfig = { - config: { - _buttonSave: '.form-buttons button[title="Save Config"]', - catalog: { - configswatches: { - _id: '#section-configswatches', - url: 'system_config/edit/section/configswatches', - h3: 'Configurable Swatches', - _h3: defaultConfig._h3, - }, - sitemap: { - _id: '#section-sitemap', - url: 'system_config/edit/section/sitemap', - h3: 'Google Sitemap', - _h3: defaultConfig._h3, - __validation: { - priority: { - _input: { - category: '#sitemap_category_priority', - product: '#sitemap_product_priority', - page: '#sitemap_page_priority', - } - } - } +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', } - }, - customers: { - promo: { - _id: '#section-promo', - url: 'system_config/edit/section/promo', - h3: 'Promotions', - _h3: defaultConfig._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', - } - } - } + } + } +} + +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 index 65e097518a2..8cba7367cc2 100644 --- a/cypress/support/openmage/backend/system/currency.js +++ b/cypress/support/openmage/backend/system/currency.js @@ -1,26 +1,27 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemCurrencyRates = { - config: { - _id: '#nav-admin-system-currency-rates', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Currency Rates', - url: 'system_currency/index', - __buttons: { - save: defaultConfig._button + '[title="Save Currency Rates"]', - import: defaultConfig._button + '[title="Import"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - __validation: { - _input: { - from: 'input[name="rate[USD][EUR]"]', - } - } - }, +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 index b0e07f754ef..0f3799ceafa 100644 --- a/cypress/support/openmage/backend/system/design.js +++ b/cypress/support/openmage/backend/system/design.js @@ -1,32 +1,35 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemDesign = { - config: { - _id: '#nav-admin-system-design', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Design', - url: 'system_design/index', - _grid: '#designGrid_table', - __buttons: { - add: defaultConfig._button + '[title="Add Design Change"]', - }, - }, - edit: { - title: 'Edit Design Change', - url: 'system_design/edit', - }, - new: { - title: 'New Design Change', - url: 'system_design/new', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - back: defaultConfig._button + '[title="Back"]', - }, - }, +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 index c563d29aa19..1747dd05d36 100644 --- a/cypress/support/openmage/backend/system/emails.js +++ b/cypress/support/openmage/backend/system/emails.js @@ -1,35 +1,38 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemEmailTemplate = { - config: { - _id: '#nav-admin-system-email_template', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Transactional Emails', - url: 'system_email_template/index', - _grid: '#systemEmailTemplateGrid_table', - __buttons: { - add: '.form-buttons button[title="Add New Template"]', - }, - }, - edit: { - title: 'Edit Email Template', - url: 'system_email_template/edit', - }, - new: { - title: 'New Email Template', - url: 'system_email_template/new', - __buttons: { - save: defaultConfig._button + '[title="Save Template"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - convert: defaultConfig._button + '[title="Convert to Plain Text"]', - preview: defaultConfig._button + '[title="Preview Template"]', - }, - }, +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 index 47e163a1028..6daef5d60b3 100644 --- a/cypress/support/openmage/backend/system/indexer.js +++ b/cypress/support/openmage/backend/system/indexer.js @@ -1,12 +1,13 @@ -cy.testBackendSystemIndex = { - config: { - _id: '#nav-admin-system-index', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - list: { - title: 'Index Management', - url: 'process/list', - _grid: '#indexer_processes_grid_table', - }, - }, +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 index a9441aa4e3b..3856c29da38 100644 --- a/cypress/support/openmage/backend/system/my-account.js +++ b/cypress/support/openmage/backend/system/my-account.js @@ -1,29 +1,30 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemMyAccount = { - config: { - _id: '#nav-admin-system-myaccount', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'My Account', - url: 'system_account/index', - __buttons: { - save: defaultConfig._button + '[title="Save Account"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - __validation: { - _input: { - username: '#username', - firstname: '#firstname', - lastname: '#lastname', - email: '#email', - current_password: '#current_password', - } - } - }, +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 index 896d341396f..cf68eabd9ec 100644 --- a/cypress/support/openmage/backend/system/store.js +++ b/cypress/support/openmage/backend/system/store.js @@ -1,21 +1,22 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemStore = { - config: { - _id: '#nav-admin-system-store', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Manage Stores', - url: 'system_store/index', - __buttons: { - addWebsite: defaultConfig._button + '[title="Create Website"]', - addStore: defaultConfig._button + '[title="Create Store"]', - addStoreView: defaultConfig._button + '[title="Create Store View"]', - }, - }, +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 index 41dd82478a0..a279aa9b28b 100644 --- a/cypress/support/openmage/backend/system/variable.js +++ b/cypress/support/openmage/backend/system/variable.js @@ -1,34 +1,37 @@ -const defaultConfig = { +const base = { _button: '.form-buttons button', } -cy.testBackendSystemVariable = { - config: { - _id: '#nav-admin-system-variable', - _id_parent: '#nav-admin-system', - _h3: 'h3.icon-head', - _button: defaultConfig._button, - index: { - title: 'Custom Variables', - url: 'system_variable/index', - _grid: '#customVariablesGrid', - __buttons: { - add: '.form-buttons button[title="Add New Variable"]', - }, - }, - edit: { - title: 'Custom Variable', - url: 'system_variable/edit', - }, - new: { - title: 'New Custom Variable', - url: 'system_variable/new', - __buttons: { - save: defaultConfig._button + '[title="Save"]', - saveAndContinue: defaultConfig._button + '[title="Save and Continue Edit"]', - back: defaultConfig._button + '[title="Back"]', - reset: defaultConfig._button + '[title="Reset"]', - }, - }, +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: '.form-buttons 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/frontend/paths.js b/cypress/support/openmage/frontend/paths.js index 3f3969f108c..caa7f50254a 100644 --- a/cypress/support/openmage/frontend/paths.js +++ b/cypress/support/openmage/frontend/paths.js @@ -1,28 +1,29 @@ -cy.testFrontend = { - 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', - } - } - } +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', } } } From cb819db9051a3f76ea28b550c5ca2e0dd771cf4c Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 04:55:04 +0200 Subject: [PATCH 18/29] minor fixes --- cypress/e2e/openmage/backend/catalog/sitemap.cy.js | 8 ++++++-- cypress/e2e/openmage/backend/system/design.cy.js | 8 ++++++-- cypress/e2e/openmage/backend/system/emails.cy.js | 8 ++++++-- cypress/e2e/openmage/backend/system/variable.cy.js | 8 ++++++-- cypress/support/openmage.js | 8 +++++++- 5 files changed, 31 insertions(+), 9 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index 8485a11c757..9e921aeb23d 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -13,8 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', 'test'); - check.pageElements(test, test.index); + if (check.grid.hasRecords(test.index._grid,)) { + tools.clickContains(test.index._grid, 'td', 'test'); + check.pageElements(test, test.edit); + } else { + check.pageElements(test, test.index); + } }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index 01dc045dff5..64478b2f6a6 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -13,8 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', 'teset'); - check.pageElements(test, test.index); + if (check.grid.hasRecords(test.index._grid,)) { + tools.clickContains(test.index._grid, 'td', 'test'); + check.pageElements(test, test.edit); + } else { + check.pageElements(test, test.index); + } }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 6a42053aa71..7668a37a0fa 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -13,8 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', 'test'); - check.pageElements(test, test.index); + if (check.grid.hasRecords(test.index._grid,)) { + tools.clickContains(test.index._grid, 'td', 'test'); + check.pageElements(test, test.edit); + } else { + check.pageElements(test, test.index); + } }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 48752bd50b0..ae92057e220 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -13,8 +13,12 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', ''); - check.pageElements(test, test.index); + if (check.grid.hasRecords(test.index._grid,)) { + tools.clickContains(test.index._grid, 'td', 'test'); + check.pageElements(test, test.edit); + } else { + check.pageElements(test, test.index); + } }); it(`tests new route`, () => { diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 7dcfec64228..2940b6663ec 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -14,7 +14,7 @@ cy.openmage.login = { __selector: '.form-button', } } -}, +} cy.openmage.check = { buttons: (path, log = 'Checking for existing buttons') => { @@ -67,6 +67,12 @@ cy.openmage.check = { }; } }, + grid: { + hasRecords: (element, log = 'Checking for existing records in grid') => { + cy.log(log); + return cy.get(element).find('td').innerText !== 'No records found.'; + } + }, }, cy.openmage.tools = { From 1a4417d7ab3e19236ffa795b1f2feac680327977 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 06:01:19 +0200 Subject: [PATCH 19/29] minor fixes --- cypress/e2e/openmage/backend/catalog/sitemap.cy.js | 8 ++------ cypress/e2e/openmage/backend/system/design.cy.js | 7 +------ cypress/e2e/openmage/backend/system/emails.cy.js | 8 ++------ cypress/e2e/openmage/backend/system/variable.cy.js | 7 +------ cypress/support/openmage.js | 6 ------ 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index 9e921aeb23d..8485a11c757 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -13,12 +13,8 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - if (check.grid.hasRecords(test.index._grid,)) { - tools.clickContains(test.index._grid, 'td', 'test'); - check.pageElements(test, test.edit); - } else { - check.pageElements(test, test.index); - } + //tools.clickGridRow(test.index._grid, 'td', 'test'); + check.pageElements(test, test.index); }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index 64478b2f6a6..7b4b7acb64e 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -13,12 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - if (check.grid.hasRecords(test.index._grid,)) { - tools.clickContains(test.index._grid, 'td', 'test'); - check.pageElements(test, test.edit); - } else { - check.pageElements(test, test.index); - } + check.pageElements(test, test.index); }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 7668a37a0fa..6a42053aa71 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -13,12 +13,8 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - if (check.grid.hasRecords(test.index._grid,)) { - tools.clickContains(test.index._grid, 'td', 'test'); - check.pageElements(test, test.edit); - } else { - check.pageElements(test, test.index); - } + //tools.clickGridRow(test.index._grid, 'td', 'test'); + check.pageElements(test, test.index); }); it(`tests new route`, () => { diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index ae92057e220..02955a0dc27 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -13,12 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - if (check.grid.hasRecords(test.index._grid,)) { - tools.clickContains(test.index._grid, 'td', 'test'); - check.pageElements(test, test.edit); - } else { - check.pageElements(test, test.index); - } + check.pageElements(test, test.index); }); it(`tests new route`, () => { diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 2940b6663ec..d65dc1edb0c 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -67,12 +67,6 @@ cy.openmage.check = { }; } }, - grid: { - hasRecords: (element, log = 'Checking for existing records in grid') => { - cy.log(log); - return cy.get(element).find('td').innerText !== 'No records found.'; - } - }, }, cy.openmage.tools = { From ba5611f9c1549cf8b78315b93839dd8127248de0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 06:08:07 +0200 Subject: [PATCH 20/29] minor --- cypress/e2e/openmage/backend/catalog/sitemap.cy.js | 2 +- cypress/e2e/openmage/backend/system/design.cy.js | 1 + cypress/e2e/openmage/backend/system/emails.cy.js | 2 +- cypress/e2e/openmage/backend/system/variable.cy.js | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index 8485a11c757..12fa1395138 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', 'test'); + // TODO: There is no edit route for system variables check.pageElements(test, test.index); }); diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index 7b4b7acb64e..575aae7bca5 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -13,6 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { + // TODO: There is no edit route for system variables check.pageElements(test, test.index); }); diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 6a42053aa71..705094a5721 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - //tools.clickGridRow(test.index._grid, 'td', 'test'); + // TODO: There is no edit route for system variables check.pageElements(test, test.index); }); diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 02955a0dc27..155ab97edcd 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -13,6 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { + // TODO: There is no edit route for system variables check.pageElements(test, test.index); }); From 82ecc36ad3bbdca6208211d7eefc74ba99a4e623 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 08:05:18 +0200 Subject: [PATCH 21/29] refactor --- .../openmage/backend/catalog/categories.cy.js | 4 +- .../openmage/backend/catalog/products.cy.js | 8 +-- .../e2e/openmage/backend/catalog/search.cy.js | 8 +-- .../openmage/backend/catalog/sitemap.cy.js | 8 +-- .../backend/catalog/urlrewrites.cy.js | 8 +-- cypress/e2e/openmage/backend/cms/block.cy.js | 8 +-- cypress/e2e/openmage/backend/cms/page.cy.js | 35 +++++----- cypress/e2e/openmage/backend/cms/widget.cy.js | 8 +-- .../openmage/backend/customer/customer.cy.js | 8 +-- .../openmage/backend/customer/groups.cy.js | 8 +-- .../openmage/backend/customer/online.cy.js | 4 +- cypress/e2e/openmage/backend/dashboard.cy.js | 4 +- .../openmage/backend/newsletter/queue.cy.js | 5 +- .../openmage/backend/newsletter/report.cy.js | 5 +- .../backend/newsletter/subscriber.cy.js | 5 +- .../backend/newsletter/templates.cy.js | 8 +-- .../e2e/openmage/backend/promo/catalog.cy.js | 8 +-- .../e2e/openmage/backend/promo/quote.cy.js | 8 +-- .../openmage/backend/sales/creditmemo.cy.js | 6 +- .../e2e/openmage/backend/sales/invoice.cy.js | 6 +- .../e2e/openmage/backend/sales/order.cy.js | 6 +- .../e2e/openmage/backend/sales/shipment.cy.js | 6 +- .../openmage/backend/sales/transactions.cy.js | 5 +- .../e2e/openmage/backend/system/cache.cy.js | 4 +- .../openmage/backend/system/currency.cy.js | 3 +- .../e2e/openmage/backend/system/design.cy.js | 8 +-- .../e2e/openmage/backend/system/emails.cy.js | 8 +-- .../e2e/openmage/backend/system/indexer.cy.js | 4 +- .../openmage/backend/system/my-account.cy.js | 3 +- .../backend/system/notifications.cy.js | 4 +- .../e2e/openmage/backend/system/store.cy.js | 4 +- .../openmage/backend/system/variable.cy.js | 8 +-- cypress/support/openmage.js | 65 +++++++++---------- cypress/support/openmage/backend/cms/page.js | 35 ++++++++++ 34 files changed, 175 insertions(+), 150 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/categories.cy.js b/cypress/e2e/openmage/backend/catalog/categories.cy.js index 6e42c266b79..11bc15e95b3 100644 --- a/cypress/e2e/openmage/backend/catalog/categories.cy.js +++ b/cypress/e2e/openmage/backend/catalog/categories.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendCatalogProductsCategories.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/catalog/products.cy.js b/cypress/e2e/openmage/backend/catalog/products.cy.js index 99179baf602..3cb9896d016 100644 --- a/cypress/e2e/openmage/backend/catalog/products.cy.js +++ b/cypress/e2e/openmage/backend/catalog/products.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCatalogProducts.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,17 +9,17 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', '905'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + validation.pageElements(test, test.new); }); it(`tests filter options`, () => { diff --git a/cypress/e2e/openmage/backend/catalog/search.cy.js b/cypress/e2e/openmage/backend/catalog/search.cy.js index d0abf8db8c8..70eca7227ab 100644 --- a/cypress/e2e/openmage/backend/catalog/search.cy.js +++ b/cypress/e2e/openmage/backend/catalog/search.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCatalogSearch.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'classic'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 12fa1395138..556b30e2b74 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCatalogSitemap.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { // TODO: There is no edit route for system variables - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 d298a42d481..16b24a3eb46 100644 --- a/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js +++ b/cypress/e2e/openmage/backend/catalog/urlrewrites.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendUrlrewrite.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', '116238'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 2d8c3cd99eb..bf130244b4b 100644 --- a/cypress/e2e/openmage/backend/cms/block.cy.js +++ b/cypress/e2e/openmage/backend/cms/block.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCmsBlock.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'category-landingpage-home'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 4eb76a0617e..613a6ef68aa 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -1,6 +1,4 @@ const test = cy.testBackendCmsPage.config; -const check = cy.openmage.check; -const tools = cy.openmage.tools; const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { @@ -10,47 +8,49 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { - tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); - check.pageElements(test, test.edit); + test.index.clickGridRow(); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { - tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + test.index.clickAdd(); + validation.pageElements(test, test.new); }); it('tests to disable a CMS page that is used in config', () => { - tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + test.index.clickGridRow(); test.edit.disablePage(); + test.edit.clickSaveAndContinue(); - tools.click(test.edit.__buttons.saveAndContinue); 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}); + + cy.get('#messages').screenshot('error-disable-active-page', { overwrite: true, padding: 10 }); }); it('tests to delete a CMS page that is used in config', () => { - tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + test.index.clickGridRow(); + test.edit.clickDelete(); - tools.click(test.edit.__buttons.delete); validation.hasErrorMessage('Cannot delete page'); - cy.get('#messages').screenshot('error-delete-active-page', { overwrite: true}); + + cy.get('#messages').screenshot('error-delete-active-page', { overwrite: true, padding: 10 }); }); it('tests to add a CMS page', () => { - tools.click(test.index.__buttons.add); - tools.click(test.edit.__buttons.saveAndContinue); + test.index.clickAdd(); + test.edit.clickSaveAndContinue(); // @todo add validation for required fields }); it('tests to un-asign a CMS page that is used in config', () => { - tools.clickContains(test.index._grid, 'td', 'no-route', 'Select a CMS page'); + test.index.clickGridRow(); //cy.log('Asign another store to the CMS page'); //cy.get('#page_store_id') @@ -62,9 +62,8 @@ describe(`Checks admin system "${test.index.title}"`, () => { //validation.hasSuccessMessage('The page has been saved.'); test.edit.resetStores(); + test.edit.clickSaveAndContinue(); - tools.click(test.edit.__buttons.saveAndContinue); 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 d951ae9c09e..1897d469446 100644 --- a/cypress/e2e/openmage/backend/cms/widget.cy.js +++ b/cypress/e2e/openmage/backend/cms/widget.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCmsWidget.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'Couponing Block'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 index a7881790dd6..3c280606faf 100644 --- a/cypress/e2e/openmage/backend/customer/customer.cy.js +++ b/cypress/e2e/openmage/backend/customer/customer.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCustomerCustomer.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', '424-555-0000'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + validation.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/customer/groups.cy.js b/cypress/e2e/openmage/backend/customer/groups.cy.js index 6b354f241e7..8605cd5cef2 100644 --- a/cypress/e2e/openmage/backend/customer/groups.cy.js +++ b/cypress/e2e/openmage/backend/customer/groups.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCustomerGroups.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'General'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + validation.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/customer/online.cy.js b/cypress/e2e/openmage/backend/customer/online.cy.js index 0225a24d19a..7852045ce26 100644 --- a/cypress/e2e/openmage/backend/customer/online.cy.js +++ b/cypress/e2e/openmage/backend/customer/online.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendCustomerOnline.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,6 +9,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/dashboard.cy.js b/cypress/e2e/openmage/backend/dashboard.cy.js index 097a6096e76..aa75fb0ebfc 100644 --- a/cypress/e2e/openmage/backend/dashboard.cy.js +++ b/cypress/e2e/openmage/backend/dashboard.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendDashboard.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + 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 8f151d6d068..abd17e49f15 100644 --- a/cypress/e2e/openmage/backend/newsletter/queue.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/queue.cy.js @@ -1,6 +1,5 @@ const test = cy.testBackendNewsletterQueue.config; -const check = cy.openmage.check; -const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/newsletter/report.cy.js b/cypress/e2e/openmage/backend/newsletter/report.cy.js index 775ce3c416b..5b12b2c56ff 100644 --- a/cypress/e2e/openmage/backend/newsletter/report.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/report.cy.js @@ -1,6 +1,5 @@ const test = cy.testBackendNewsletterReport.config; -const check = cy.openmage.check; -const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js index 8f2c1edfb5d..3784b28fc50 100644 --- a/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/subscriber.cy.js @@ -1,6 +1,5 @@ const test = cy.testBackendNewsletterSubscriber.config; -const check = cy.openmage.check; -const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/newsletter/templates.cy.js b/cypress/e2e/openmage/backend/newsletter/templates.cy.js index a863769acb8..2e88208753d 100644 --- a/cypress/e2e/openmage/backend/newsletter/templates.cy.js +++ b/cypress/e2e/openmage/backend/newsletter/templates.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendNewsletterTemplates.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'Example'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + validation.pageElements(test, test.new); }); }); diff --git a/cypress/e2e/openmage/backend/promo/catalog.cy.js b/cypress/e2e/openmage/backend/promo/catalog.cy.js index fcb769ce857..1ce59e28ddd 100644 --- a/cypress/e2e/openmage/backend/promo/catalog.cy.js +++ b/cypress/e2e/openmage/backend/promo/catalog.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendPromoCatalog.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', 'Candle'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 index 7d230163c36..96f166abfb4 100644 --- a/cypress/e2e/openmage/backend/promo/quote.cy.js +++ b/cypress/e2e/openmage/backend/promo/quote.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendPromoQuote.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { tools.clickContains(test.index._grid, 'td', '$500'); - check.pageElements(test, test.edit); + validation.pageElements(test, test.edit); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 b0c9f978ce0..ae56203f3c9 100644 --- a/cypress/e2e/openmage/backend/sales/creditmemo.cy.js +++ b/cypress/e2e/openmage/backend/sales/creditmemo.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSalesCreditmemo.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,11 +9,11 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests view route`, () => { tools.clickContains(test.index._grid, 'td', '100000007'); - check.pageElements(test, test.view); + 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 d3f440bc497..618b38e58cf 100644 --- a/cypress/e2e/openmage/backend/sales/invoice.cy.js +++ b/cypress/e2e/openmage/backend/sales/invoice.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSalesInvoice.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,11 +9,11 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests view route`, () => { tools.clickContains(test.index._grid, 'td', '100000040'); - check.pageElements(test, test.view); + 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 97390f70209..37f74538892 100644 --- a/cypress/e2e/openmage/backend/sales/order.cy.js +++ b/cypress/e2e/openmage/backend/sales/order.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSalesOrder.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,11 +9,11 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests view route`, () => { tools.clickContains(test.index._grid, 'td', '145000004'); - check.pageElements(test, test.view); + 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 ba19ad7e36c..668a86c53bc 100644 --- a/cypress/e2e/openmage/backend/sales/shipment.cy.js +++ b/cypress/e2e/openmage/backend/sales/shipment.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSalesOrderShipment.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,11 +9,11 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests view route`, () => { tools.clickContains(test.index._grid, 'td', '100000032'); - check.pageElements(test, test.view); + 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 7ea28355387..b1e622c6581 100644 --- a/cypress/e2e/openmage/backend/sales/transactions.cy.js +++ b/cypress/e2e/openmage/backend/sales/transactions.cy.js @@ -1,6 +1,5 @@ const test = cy.testBackendSalesTransactions.config; -const check = cy.openmage.check; -const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/system/cache.cy.js b/cypress/e2e/openmage/backend/system/cache.cy.js index 78e7d935e20..2efa1685cb3 100644 --- a/cypress/e2e/openmage/backend/system/cache.cy.js +++ b/cypress/e2e/openmage/backend/system/cache.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendSystemCache.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/system/currency.cy.js b/cypress/e2e/openmage/backend/system/currency.cy.js index 0defba10b8d..79df868ee4a 100644 --- a/cypress/e2e/openmage/backend/system/currency.cy.js +++ b/cypress/e2e/openmage/backend/system/currency.cy.js @@ -1,5 +1,4 @@ const test = cy.testBackendSystemCurrencyRates.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; const validation = cy.openmage.validation; @@ -10,7 +9,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); const warning = 'Invalid input data for USD => EUR rate'; diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index 575aae7bca5..a96e00fedf5 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSystemDesign.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { // TODO: There is no edit route for system variables - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 705094a5721..6b25092842c 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSystemEmailTemplate.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { // TODO: There is no edit route for system variables - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + 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 index cfdd74f7a65..ab22b3ca9fc 100644 --- a/cypress/e2e/openmage/backend/system/indexer.cy.js +++ b/cypress/e2e/openmage/backend/system/indexer.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendSystemIndex.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/system/my-account.cy.js b/cypress/e2e/openmage/backend/system/my-account.cy.js index 354842e845e..8525019629c 100644 --- a/cypress/e2e/openmage/backend/system/my-account.cy.js +++ b/cypress/e2e/openmage/backend/system/my-account.cy.js @@ -1,5 +1,4 @@ const test = cy.testBackendSystemMyAccount.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; const validation = cy.openmage.validation; @@ -10,7 +9,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests empty input`, () => { diff --git a/cypress/e2e/openmage/backend/system/notifications.cy.js b/cypress/e2e/openmage/backend/system/notifications.cy.js index 315ca293951..3de3e22a4da 100644 --- a/cypress/e2e/openmage/backend/system/notifications.cy.js +++ b/cypress/e2e/openmage/backend/system/notifications.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendSystemAdminnotification.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/system/store.cy.js b/cypress/e2e/openmage/backend/system/store.cy.js index f7e8dd48cfb..60ec2df3a55 100644 --- a/cypress/e2e/openmage/backend/system/store.cy.js +++ b/cypress/e2e/openmage/backend/system/store.cy.js @@ -1,5 +1,5 @@ const test = cy.testBackendSystemStore.config; -const check = cy.openmage.check; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -8,6 +8,6 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); }); diff --git a/cypress/e2e/openmage/backend/system/variable.cy.js b/cypress/e2e/openmage/backend/system/variable.cy.js index 155ab97edcd..1dba28aa2e8 100644 --- a/cypress/e2e/openmage/backend/system/variable.cy.js +++ b/cypress/e2e/openmage/backend/system/variable.cy.js @@ -1,6 +1,6 @@ const test = cy.testBackendSystemVariable.config; -const check = cy.openmage.check; const tools = cy.openmage.tools; +const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { beforeEach('Log in the user', () => { @@ -9,16 +9,16 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests index route`, () => { - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests edit route`, () => { // TODO: There is no edit route for system variables - check.pageElements(test, test.index); + validation.pageElements(test, test.index); }); it(`tests new route`, () => { tools.click(test.index.__buttons.add); - check.pageElements(test, test.new); + validation.pageElements(test, test.new); }); }); diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index d65dc1edb0c..7307116273f 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -17,9 +17,11 @@ cy.openmage.login = { } cy.openmage.check = { - buttons: (path, log = 'Checking for existing buttons') => { + 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'); }; @@ -29,43 +31,30 @@ cy.openmage.check = { cy.log(log); if (path.__fields !== undefined) { for (const field of Object.keys(path.__fields)) { - cy.get(path.__fields[field]).should('exist'); + cy.get(path.__fields[field].selector).should('exist'); }; } }, - pageElements: (test, path) => { - cy.log('Checking for title'); - cy.get(test._h3).should('include.text', path.title); - - cy.log('Checkinng for URL') - cy.url().should('include', path.url); - - cy.log('Checking for active parent class'); - cy.get(test._id_parent).should('have.class', 'active'); - - cy.log('Checking for active class'); - cy.get(test._id).should('have.class', 'active'); - + grid: (path, log = 'Checking for existing grid') => { if (path._grid !== undefined) { - cy.log('Checking for existing grid'); + cy.log(log); cy.get(path._grid).should('exist'); } + }, + navigation: (test, log = 'Checkinng for URL') => { + cy.log('Checking for active class'); + cy.get(test._id).should('have.class', 'active'); - if (path.__buttons !== undefined) { - cy.get(test._button).filter(':visible').should('have.length', Object.keys(path.__buttons).length); - - cy.log('Checking for existing buttons'); - for (const button of Object.keys(path.__buttons)) { - cy.get(path.__buttons[button]).should('exist'); - }; - } - - if (path.__fields !== undefined) { - cy.log('Checking for existing fields'); - for (const field of Object.keys(path.__fields)) { - cy.get(path.__fields[field].selector).should('exist'); - }; - } + cy.log('Checking for active parent class'); + cy.get(test._id_parent).should('have.class', 'active'); + }, + url: (path, log = 'Checkinng for URL') => { + cy.log(log) + cy.url().should('include', path.url); + }, + title: (test, path, log = 'Checkinng for title') => { + cy.log(log) + cy.get(test._h3).should('include.text', path.title); }, }, @@ -147,6 +136,14 @@ cy.openmage.validation = { .invoke('removeClass'); }); }, + pageElements: (test, path) => { + cy.openmage.check.buttons(test, path); + cy.openmage.check.fields(path); + cy.openmage.check.grid(test); + cy.openmage.check.navigation(test); + 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 => { @@ -156,14 +153,14 @@ cy.openmage.validation = { }, hasErrorMessage: (message) =>{ cy.log('Checking for error messages'); - cy.get('.error-msg').should('include.text', message); + cy.get(cy.openmage.validation._errorMessage).should('include.text', message); }, hasSuccessMessage: (message) =>{ cy.log('Checking for success messages'); - cy.get('.success-msg').should('include.text', message); + cy.get(cy.openmage.validation._successMessage).should('include.text', message); }, hasWarningMessage: (message) =>{ cy.log('Checking for warning messages'); - cy.get('.warning-msg').should('include.text', message); + cy.get(cy.openmage.validation._warningMessage).should('include.text', message); }, } \ No newline at end of file diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index e64201f4344..10573a4ecb8 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -1,3 +1,5 @@ +const tools = cy.openmage.tools; + const base = { _button: '.form-buttons button', } @@ -18,6 +20,12 @@ cy.testBackendCmsPage.config.index = { __buttons: { add: base._button + '[title="Add New Page"]', }, + clickAdd: () => { + tools.click(cy.testBackendCmsPage.config.index.__buttons.add); + }, + clickGridRow: (selector = 'td', content = 'no-route') => { + tools.clickContains(cy.testBackendCmsPage.config.index._grid, selector, content, 'Select a CMS page'); + }, } cy.testBackendCmsPage.config.edit = { @@ -40,6 +48,21 @@ cy.testBackendCmsPage.config.edit = { cy.get('#page_store_id') .select([1, 2, 3]); }, + clickDelete: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.delete); + }, + clickSave: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.save); + }, + clickSaveAndContinue: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.saveAndContinue); + }, + clickBack: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.back); + }, + clickReset: () => { + tools.click(cy.testBackendCmsPage.config.edit.__buttons.reset); + }, } cy.testBackendCmsPage.config.new = { @@ -51,4 +74,16 @@ cy.testBackendCmsPage.config.new = { back: base._button + '[title="Back"]', reset: base._button + '[title="Reset"]', }, + clickSave: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.save); + }, + clickSaveAndContinue: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.saveAndContinue); + }, + clickBack: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.back); + }, + clickReset: () => { + tools.click(cy.testBackendCmsPage.config.new.__buttons.reset); + }, } From d2b31b8408768aaf1119ceb24d41f5438ee8bf9f Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 09:42:21 +0200 Subject: [PATCH 22/29] minor --- cypress/support/openmage.js | 9 +++ cypress/support/openmage/backend/cms/page.js | 73 +++++++++++++++++++- 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 7307116273f..78a3e746a9d 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -52,6 +52,14 @@ cy.openmage.check = { cy.log(log) cy.url().should('include', path.url); }, + tabs: (path, log = 'Checkinng 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 = 'Checkinng for title') => { cy.log(log) cy.get(test._h3).should('include.text', path.title); @@ -141,6 +149,7 @@ cy.openmage.validation = { cy.openmage.check.fields(path); cy.openmage.check.grid(test); cy.openmage.check.navigation(test); + cy.openmage.check.tabs(path); cy.openmage.check.title(test, path); cy.openmage.check.url(path); }, diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index 10573a4ecb8..a080aa672fa 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -2,6 +2,61 @@ 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 = {}; @@ -11,6 +66,18 @@ cy.testBackendCmsPage.config = { _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 = { @@ -38,6 +105,8 @@ cy.testBackendCmsPage.config.edit = { 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('#page_is_active') @@ -45,7 +114,7 @@ cy.testBackendCmsPage.config.edit = { }, resetStores: () => { cy.log('Restore the default store to the CMS page'); - cy.get('#page_store_id') + cy.get(base.__fields.page_store_id.selector) .select([1, 2, 3]); }, clickDelete: () => { @@ -74,6 +143,8 @@ cy.testBackendCmsPage.config.new = { 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); }, From c1bc4a87b6c0ef8b79949eaed406c58a45a8fc42 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 10:28:12 +0200 Subject: [PATCH 23/29] minor --- cypress/support/openmage/backend/cms/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index a080aa672fa..1f8d8045677 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -109,7 +109,7 @@ cy.testBackendCmsPage.config.edit = { __tabs: base.__tabs, disablePage: () => { cy.log('Disable the CMS page'); - cy.get('#page_is_active') + cy.get(base.__fields.page_is_active.selector) .select('Disabled'); }, resetStores: () => { From efaecb2747d28ccb3bc6c6c30eb1c441bb4f5e2e Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 10:41:40 +0200 Subject: [PATCH 24/29] minor --- cypress/support/openmage.js | 6 +++--- cypress/support/openmage/backend/cms/page.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 78a3e746a9d..71557cba460 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -64,7 +64,7 @@ cy.openmage.check = { cy.log(log) cy.get(test._h3).should('include.text', path.title); }, -}, +} cy.openmage.tools = { click: (selector, log = 'Clicking on something') => { @@ -75,7 +75,7 @@ cy.openmage.tools = { cy.log(log); cy.get(element).contains(selector, content).first().click({force: true, multiple: false}); }, -}, +} cy.openmage.utils = { generateRandomEmail: () => { @@ -86,7 +86,7 @@ cy.openmage.utils = { } return email + '-cypress-test@example.com'; }, -}, +} cy.openmage.validation = { test: { diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index 1f8d8045677..91c40b36f2b 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -88,7 +88,7 @@ cy.testBackendCmsPage.config.index = { add: base._button + '[title="Add New Page"]', }, clickAdd: () => { - tools.click(cy.testBackendCmsPage.config.index.__buttons.add); + 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'); @@ -118,19 +118,19 @@ cy.testBackendCmsPage.config.edit = { .select([1, 2, 3]); }, clickDelete: () => { - tools.click(cy.testBackendCmsPage.config.edit.__buttons.delete); + tools.click(cy.testBackendCmsPage.config.edit.__buttons.delete, 'Delete button clicked'); }, clickSave: () => { - tools.click(cy.testBackendCmsPage.config.edit.__buttons.save); + tools.click(cy.testBackendCmsPage.config.edit.__buttons.save, 'Save button clicked'); }, clickSaveAndContinue: () => { - tools.click(cy.testBackendCmsPage.config.edit.__buttons.saveAndContinue); + tools.click(cy.testBackendCmsPage.config.edit.__buttons.saveAndContinue, 'Save and Continue Edit button clicked'); }, clickBack: () => { - tools.click(cy.testBackendCmsPage.config.edit.__buttons.back); + tools.click(cy.testBackendCmsPage.config.edit.__buttons.back, 'Back button clicked'); }, clickReset: () => { - tools.click(cy.testBackendCmsPage.config.edit.__buttons.reset); + tools.click(cy.testBackendCmsPage.config.edit.__buttons.reset, 'Reset button clicked'); }, } @@ -146,15 +146,15 @@ cy.testBackendCmsPage.config.new = { __fields: base.__fields, __tabs: base.__tabs, clickSave: () => { - tools.click(cy.testBackendCmsPage.config.new.__buttons.save); + tools.click(cy.testBackendCmsPage.config.new.__buttons.save, 'Save button clicked'); }, clickSaveAndContinue: () => { - tools.click(cy.testBackendCmsPage.config.new.__buttons.saveAndContinue); + tools.click(cy.testBackendCmsPage.config.new.__buttons.saveAndContinue, 'Save and Continue Edit button clicked'); }, clickBack: () => { - tools.click(cy.testBackendCmsPage.config.new.__buttons.back); + tools.click(cy.testBackendCmsPage.config.new.__buttons.back, 'Back button clicked'); }, clickReset: () => { - tools.click(cy.testBackendCmsPage.config.new.__buttons.reset); + tools.click(cy.testBackendCmsPage.config.new.__buttons.reset, 'Reset button clicked'); }, } From 00352a4157ab803d27cccadc6d2614dd7ea85ade Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 10:50:56 +0200 Subject: [PATCH 25/29] minor --- cypress/e2e/openmage/backend/catalog/sitemap.cy.js | 2 +- cypress/e2e/openmage/backend/cms/page.cy.js | 2 +- cypress/e2e/openmage/backend/system/design.cy.js | 2 +- cypress/e2e/openmage/backend/system/emails.cy.js | 2 +- cypress/support/openmage.js | 12 +++++------- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js index 556b30e2b74..2e0221456cf 100644 --- a/cypress/e2e/openmage/backend/catalog/sitemap.cy.js +++ b/cypress/e2e/openmage/backend/catalog/sitemap.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - // TODO: There is no edit route for system variables + // TODO: There is no edit route for sitemaps validation.pageElements(test, test.index); }); diff --git a/cypress/e2e/openmage/backend/cms/page.cy.js b/cypress/e2e/openmage/backend/cms/page.cy.js index 613a6ef68aa..1c1d5dae7ec 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -49,7 +49,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { // @todo add validation for required fields }); - it('tests to un-asign a CMS page that is used in config', () => { + it('tests to unassign a CMS page that is used in config', () => { test.index.clickGridRow(); //cy.log('Asign another store to the CMS page'); diff --git a/cypress/e2e/openmage/backend/system/design.cy.js b/cypress/e2e/openmage/backend/system/design.cy.js index a96e00fedf5..5442400285c 100644 --- a/cypress/e2e/openmage/backend/system/design.cy.js +++ b/cypress/e2e/openmage/backend/system/design.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - // TODO: There is no edit route for system variables + // TODO: There is no edit route for design updates validation.pageElements(test, test.index); }); diff --git a/cypress/e2e/openmage/backend/system/emails.cy.js b/cypress/e2e/openmage/backend/system/emails.cy.js index 6b25092842c..3d75fea9d0b 100644 --- a/cypress/e2e/openmage/backend/system/emails.cy.js +++ b/cypress/e2e/openmage/backend/system/emails.cy.js @@ -13,7 +13,7 @@ describe(`Checks admin system "${test.index.title}"`, () => { }); it(`tests edit route`, () => { - // TODO: There is no edit route for system variables + // TODO: There is no edit route for email templates validation.pageElements(test, test.index); }); diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index 71557cba460..b0408c57aa4 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -41,18 +41,16 @@ cy.openmage.check = { cy.get(path._grid).should('exist'); } }, - navigation: (test, log = 'Checkinng for URL') => { - cy.log('Checking for active class'); + navigation: (test, log = 'Checking for active navigation') => { + cy.log(log); cy.get(test._id).should('have.class', 'active'); - - cy.log('Checking for active parent class'); cy.get(test._id_parent).should('have.class', 'active'); }, - url: (path, log = 'Checkinng for URL') => { + url: (path, log = 'Checking for URL') => { cy.log(log) cy.url().should('include', path.url); }, - tabs: (path, log = 'Checkinng for tabs') => { + tabs: (path, log = 'Checking for tabs') => { cy.log(log); if (path.__tabs !== undefined) { for (const tab of Object.keys(path.__tabs)) { @@ -60,7 +58,7 @@ cy.openmage.check = { }; } }, - title: (test, path, log = 'Checkinng for title') => { + title: (test, path, log = 'Checking for title') => { cy.log(log) cy.get(test._h3).should('include.text', path.title); }, From a0a253213602f49a731a06a4f0f7e616df9c05ec Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 10:54:09 +0200 Subject: [PATCH 26/29] minor --- cypress/e2e/openmage/backend/cms/page.cy.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/e2e/openmage/backend/cms/page.cy.js b/cypress/e2e/openmage/backend/cms/page.cy.js index 1c1d5dae7ec..b0dcd082d4d 100644 --- a/cypress/e2e/openmage/backend/cms/page.cy.js +++ b/cypress/e2e/openmage/backend/cms/page.cy.js @@ -52,11 +52,11 @@ describe(`Checks admin system "${test.index.title}"`, () => { it('tests to unassign a CMS page that is used in config', () => { test.index.clickGridRow(); - //cy.log('Asign another store to the CMS page'); - //cy.get('#page_store_id') + //cy.log('Assign another store to the CMS page'); + //cy.get(test.edit.__fields.page_store_id.selector) // .select(4); - //tools.clickAction(test.edit.__buttons.saveAndContinue); + //test.edit.clickSaveAndContinue(); // @todo: fix needed - this test passes because of a Magento bug //validation.hasSuccessMessage('The page has been saved.'); From 10a17f6f447c5923b2ee97dbced862f8d00eb022 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 10:55:56 +0200 Subject: [PATCH 27/29] minor --- cypress/support/openmage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/support/openmage.js b/cypress/support/openmage.js index b0408c57aa4..dd51d859453 100644 --- a/cypress/support/openmage.js +++ b/cypress/support/openmage.js @@ -145,7 +145,7 @@ cy.openmage.validation = { pageElements: (test, path) => { cy.openmage.check.buttons(test, path); cy.openmage.check.fields(path); - cy.openmage.check.grid(test); + cy.openmage.check.grid(path); cy.openmage.check.navigation(test); cy.openmage.check.tabs(path); cy.openmage.check.title(test, path); From 759722a380e0787b4190ec95b412ff7d59399da2 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 11:07:49 +0200 Subject: [PATCH 28/29] minor --- cypress/e2e/openmage/backend/customer/online.cy.js | 1 - cypress/support/openmage/backend/cms/page.js | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/e2e/openmage/backend/customer/online.cy.js b/cypress/e2e/openmage/backend/customer/online.cy.js index 7852045ce26..83127bec161 100644 --- a/cypress/e2e/openmage/backend/customer/online.cy.js +++ b/cypress/e2e/openmage/backend/customer/online.cy.js @@ -1,5 +1,4 @@ const test = cy.testBackendCustomerOnline.config; -const tools = cy.openmage.tools; const validation = cy.openmage.validation; describe(`Checks admin system "${test.index.title}"`, () => { diff --git a/cypress/support/openmage/backend/cms/page.js b/cypress/support/openmage/backend/cms/page.js index 91c40b36f2b..11f901b23b8 100644 --- a/cypress/support/openmage/backend/cms/page.js +++ b/cypress/support/openmage/backend/cms/page.js @@ -88,7 +88,7 @@ cy.testBackendCmsPage.config.index = { add: base._button + '[title="Add New Page"]', }, clickAdd: () => { - tools.click(cy.testBackendCmsPage.config.index.__buttons.add), 'Add New Page button clicked'; + 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'); From a188b6ba62a319e0e824e4dbc8090d057272bc39 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Tue, 7 Oct 2025 11:21:49 +0200 Subject: [PATCH 29/29] minor --- cypress/support/openmage/backend/promo/catalog.js | 2 +- cypress/support/openmage/backend/system/variable.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/support/openmage/backend/promo/catalog.js b/cypress/support/openmage/backend/promo/catalog.js index 7ac0695679e..d47042e67b9 100644 --- a/cypress/support/openmage/backend/promo/catalog.js +++ b/cypress/support/openmage/backend/promo/catalog.js @@ -14,7 +14,7 @@ cy.testBackendPromoCatalog.config = { cy.testBackendPromoCatalog.config.index = { title: 'Catalog Price Rules', url: 'promo_catalog/index', - _grid: '#promo_catalog_grid', + _grid: '#promo_catalog_grid_table', __buttons: { add: base._button + '[title="Add New Rule"]', apply: base._button + '[title="Apply Rules"]', diff --git a/cypress/support/openmage/backend/system/variable.js b/cypress/support/openmage/backend/system/variable.js index a279aa9b28b..05d67f1bf3d 100644 --- a/cypress/support/openmage/backend/system/variable.js +++ b/cypress/support/openmage/backend/system/variable.js @@ -16,7 +16,7 @@ cy.testBackendSystemVariable.config.index = { url: 'system_variable/index', _grid: '#customVariablesGrid', __buttons: { - add: '.form-buttons button[title="Add New Variable"]', + add: base._button + '[title="Add New Variable"]', }, }