diff --git a/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml b/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml new file mode 100644 index 0000000000000..2b6a2ed8aea63 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/ActionGroup/AdminClickViewThemeActionGroup.xml @@ -0,0 +1,17 @@ + + + + + + + Clicks on 'View' action of one theme on the themes grid. + + + + diff --git a/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml b/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml new file mode 100644 index 0000000000000..25ff37c787c62 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Data/ThemeData.xml @@ -0,0 +1,16 @@ + + + + + + Theme: Magento Blank + Magento/blank + Magento Blank + + diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml index 1a0bb738bc9ca..a4ed84497558a 100644 --- a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml +++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSection.xml @@ -18,5 +18,6 @@ + diff --git a/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml new file mode 100644 index 0000000000000..e5dbdabc6f531 --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Section/AdminThemeSettingsSection.xml @@ -0,0 +1,16 @@ + + + + +
+ + + +
+
diff --git a/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml new file mode 100644 index 0000000000000..a6dba32d83ffd --- /dev/null +++ b/app/code/Magento/Theme/Test/Mftf/Test/AdminContentThemesEditTest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + <description value="Admin should be able to view a theme"/> + <severity value="CRITICAL"/> + <group value="menu"/> + <group value="mtf_migrated"/> + </annotations> + <before> + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/> + </before> + <after> + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> + </after> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="navigateToContentThemesPage"> + <argument name="menuUiId" value="{{AdminMenuContent.dataUiId}}"/> + <argument name="submenuUiId" value="{{AdminMenuContentDesignThemes.dataUiId}}"/> + </actionGroup> + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seePageTitle"> + <argument name="title" value="{{AdminMenuContentDesignThemes.pageTitle}}"/> + </actionGroup> + + <actionGroup ref="AdminClickViewThemeActionGroup" stepKey="editTheme"/> + + <actionGroup ref="AdminAssertPageTitleActionGroup" stepKey="seeEditPageTitle"> + <argument name="title" value="{{MagentoBlankTheme.pageTitle}}"/> + </actionGroup> + + <see selector="{{AdminThemeSettingsSection.themePath}}" userInput="{{MagentoBlankTheme.themePath}}" stepKey="assertThemePath"/> + <see selector="{{AdminThemeSettingsSection.themeTitle}}" userInput="{{MagentoBlankTheme.themeTitle}}" stepKey="assertThemeTitle"/> + <seeElementInDOM selector="{{AdminThemeSettingsSection.themePreviewImage}}" stepKey="seeThemePreviewImage"/> + </test> +</tests> diff --git a/lib/web/mage/list.js b/lib/web/mage/list.js deleted file mode 100644 index a2a44c6de0f99..0000000000000 --- a/lib/web/mage/list.js +++ /dev/null @@ -1,148 +0,0 @@ -/** - * Copyright © Magento, Inc. All rights reserved. - * See COPYING.txt for license details. - */ - -/** - * @deprecated since version 2.2.0 - */ -define([ - 'jquery', - 'mage/template', - 'jquery-ui-modules/widget' -], function ($, mageTemplate) { - 'use strict'; - - $.widget('mage.list', { - options: { - template: '[data-role=item]', //template for item, - templateWrapper: null, //template wrapper - templateClass: null, //template wrapper class - destinationSelector: '[data-role=container]', //destination selector of list - itemIndex: 0, //setting an item index - itemCount: 0, //get count of items - addButton: '[data-button=add]', //button for adding list item - removeButton: '[data-button=remove]', //button for removing list item - maxItems: null, - maxItemsAlert: null - }, - - /** - * @private - */ - _create: function () { - var options, destination, addButton; - - this.options.itemCount = this.options.itemIndex = 0; - - options = this.options; - destination = $(options.destinationSelector); - addButton = this.element.find($(options.addButton)); - - this.element - .addClass('list-widget'); - - addButton.on('click', $.proxy(this.handleAdd, this)); - - //handle remove - destination.on('click', this.options.removeButton, $.proxy(this.removeItem, this)); - }, - - /** - * @return {Boolean} - */ - handleAdd: function () { - this.addItem(++this.options.itemIndex); - - return false; - }, - - /** - * @param {*} index - * @param {*} parent - * @return {*|jQuery|HTMLElement} - */ - addItem: function (index, parent) { - var options = this.options, - template = $(options.template), - destination = $(options.destinationSelector), - item = $(options.templateWrapper), - source, preTemplate, context, compiledTemplate; - - item.addClass(this.options.templateClass) - .attr('id', 'list-item-' + index) - .attr('data-role', 'addedItem') - .attr('data-parent', parent); - - source = template.html(); - preTemplate = mageTemplate(source); - context = this.handleContext(index); - compiledTemplate = preTemplate({ - data: context - }); - - item.append(compiledTemplate); - destination.append(item); - - this.checkLimit(++this.options.itemCount); - - return item; - }, - - /** - * @param {*} index - * @return {Object} - */ - handleContext: function (index) { - var context = { - _index_: index - }; - - return context; - }, - - /** - * @param {jQuery.Event} e - * @return {Boolean} - */ - removeItem: function (e) { - $(e.currentTarget).closest('[data-role="addedItem"]').remove(); - - this.checkLimit(--this.options.itemCount); - - return false; - }, - - /** - * @param {*} index - */ - checkLimit: function (index) { - var addButton = $(this.options.addButton), - maxItems = this.options.maxItems, - maxItemsAlert = $(this.options.maxItemsAlert); - - if (maxItems !== null && index >= maxItems) { - addButton.hide(); - maxItemsAlert.show(); - } else if (addButton.is(':hidden')) { - addButton.show(); - maxItemsAlert.hide(); - } - }, - - /** - * @private - */ - _destroy: function () { - var destination = $(this.options.destinationSelector); - - this.element - .removeClass('list-widget'); - destination - .find('[data-role="addedItem"]') - .remove(); - } - }); - - return $.mage.list; -});