Skip to content

Commit

Permalink
Merge branch 'liferay:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
liferay-frontend authored Jul 4, 2023
2 parents c5f2294 + 3303071 commit 0d6d007
Show file tree
Hide file tree
Showing 58 changed files with 607 additions and 162 deletions.
10 changes: 5 additions & 5 deletions modules/.releng/sdk/gradle-plugins-workspace/artifact.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
artifact.git.id=050236ca2ecc268110eb260ae8f12ef9978bd5d1
artifact.javadoc.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.9/com.liferay.gradle.plugins.workspace-6.1.9-javadoc.jar
artifact.sources-commercial.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.9/com.liferay.gradle.plugins.workspace-6.1.9-sources-commercial.jar
artifact.sources.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.9/com.liferay.gradle.plugins.workspace-6.1.9-sources.jar
artifact.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.9/com.liferay.gradle.plugins.workspace-6.1.9.jar
artifact.git.id=5cf88b44e298adc0d6159f20001aa93775355556
artifact.javadoc.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.10/com.liferay.gradle.plugins.workspace-6.1.10-javadoc.jar
artifact.sources-commercial.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.10/com.liferay.gradle.plugins.workspace-6.1.10-sources-commercial.jar
artifact.sources.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.10/com.liferay.gradle.plugins.workspace-6.1.10-sources.jar
artifact.url=https://repository-cdn.liferay.com/nexus/content/repositories/liferay-public-releases/com/liferay/com.liferay.gradle.plugins.workspace/6.1.10/com.liferay.gradle.plugins.workspace-6.1.10.jar
Original file line number Diff line number Diff line change
Expand Up @@ -1039,14 +1039,29 @@ export default function ChangeTrackingRenderView({
const renderDividers = () => {
if (state.view === VIEW_SPLIT) {
return (
<tr className="publications-render-view-divider table-divider">
<td
className="publications-render-view-divider"
colSpan={2}
>
{renderViewDropdown()}
</td>
</tr>
<>
<tr className="publications-render-view-divider table-divider">
<td
className="publications-render-view-divider"
colSpan={2}
>
{renderViewDropdown()}
</td>
</tr>
<tr className="publications-render-view-divider table-divider">
{
<td className="publications-render-view-divider">
{Liferay.Language.get('production')}
</td>
}

{
<td className="publications-render-view-divider">
{Liferay.Language.get('publication')}
</td>
}
</tr>
</>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,6 @@ definition {
Alert.viewSuccessMessage();
}

macro addProductRelation {
Click(locator1 = "Button#PLUS");

Click(
key_selectAction = "Add Up-Sell Product",
locator1 = "FormViewBuilder#FIELD_ELLIPSIS_ACTION_FIELDSET");

SelectFrame.selectFrameNoLoading(locator1 = "IFrame#MODAL_IFRAME");

Type(
locator1 = "CommerceEntry#SEARCH_PRODUCT_RELATIONS",
value1 = ${productNameRelation});

KeyPress(
locator1 = "CommerceEntry#SEARCH_PRODUCT_RELATIONS",
value1 = "\RETURN");

Check.checkToggleSwitch(
locator1 = "CommerceAccelerators#SELECT_PRODUCT_RELATIONS",
productName = ${productNameRelation});

SelectFrameTop();

Button.clickAdd();

Alert.viewSuccessMessage();
}

macro assignAllRelationsToProductsEntry {
Click(locator1 = "CommerceEntry#ADD_BUTTON");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ definition {

CommerceEntry.gotoMenuTab(menuTab = "Product Relations");

CommerceRelations.addProductRelation(productNameRelation = "U-Joint");
CommerceRelations.addAnyProductRelation(
key_product = "U-Joint",
key_relation = "Up-Sell Product");

AssertElementPresent(
key_productName = "U-Joint",
Expand Down Expand Up @@ -133,7 +135,9 @@ definition {

CommerceEntry.gotoMenuTab(menuTab = "Product Relations");

CommerceRelations.addProductRelation(productNameRelation = "Shoes");
CommerceRelations.addAnyProductRelation(
key_product = "Shoes",
key_relation = "Up-Sell Product");

CommerceRelations.productRelationSetPriority(
priorityValue = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,170 @@ definition {
}
}

@description = "COMMERCE-11610. As a supplier account user, I can add and edit products in a catalog and delete them from the catalog the account is linked to."
@priority = 5
test CanSupplierManageOnlyLinkedCatalogProducts {
property portal.acceptance = "true";

task ("Given a Supplier account with a supplier user") {
JSONAccountEntry.addAccountEntry(
accountEntryName = "Commerce Supplier",
accountEntryType = "Supplier");

JSONAccountEntryUser.addAccountEntryUser(
accountEntryName = "Commerce Supplier",
userEmailAddress = "[email protected]",
userFirstName = "Supplier",
userLastName = "User",
userScreenName = "supplieruser");

JSONUser.setFirstPassword(
agreeToTermsAndAnswerReminderQuery = "true",
requireReset = "false",
userEmailAddress = "[email protected]");

JSONAccountRole.associateUser(
accountEntryName = "Commerce Supplier",
accountRole = "Account Supplier",
userEmailAddress = "[email protected]");
}

task ("And Supplier account is linked to Minium catalog") {
var accountId = CommerceJSONAccountsAPI.getAccountFieldByAccountName(
accountName = "Commerce Supplier",
field = "id");

CommerceJSONCatalogsAPI._patchCommerceCatalog(
accountId = ${accountId},
catalogName = "Minium");
}

task ("And a new Catalog is added") {
CommerceJSONCatalogsAPI._addCatalog(catalogName = "New Catalog");
}

task ("And the Supplier account is linked to Minium Portal Channel") {
CommerceChannels.openChannelsAdmin();

CommerceNavigator.gotoEntry(entryName = "Minium Portal");

Select(
key_fieldLabel = "Link Channel to a Supplier",
locator1 = "Select#GENERIC_SELECT_FIELD",
value1 = "Commerce Supplier");

Button.clickSave();
}

task ("When the supplier user logs in") {
User.logoutAndLoginPG(
userLoginEmailAddress = "[email protected]",
userLoginFullName = "Supplier User");
}

task ("Then can add a new product in Minium Catalog") {
CommerceProducts.openProductsAdmin();

CPCommerceCatalog.newProductsEntry(
productCatalog = "Minium",
productName = "Simple T-Shirt",
productType = "Simple");

AssertSelectedLabel(
key_fieldLabel = "Catalog",
locator1 = "Select#GENERIC_SELECT_FIELD",
value1 = "Minium");
}

task ("And can edit the product") {
CommerceEntry.addProductDescription(
productFullDescription = "This is a Full Description",
productShortDescription = "This is a Short Description",
publishProduct = "true");

CommerceEntry.gotoMenuTab(menuTab = "Options");

CommerceProductOptions.createProductOption(key_optionName = "New Option");

CommerceEntry.gotoMenuTab(menuTab = "SKUs");

CommerceNavigator.gotoEntry(entryName = "default");

CommerceEntry.editSkuPricingAndInventory(
basePrice = "20.00",
italyQuantity = 20,
publish = "true");

CommerceEntry.gotoMenuTab(menuTab = "Product Relations");

CommerceRelations.addAnyProductRelation(
key_product = "U-Joint",
key_relation = "Up-Sell Product");

CommerceEntry.gotoMenuTab(menuTab = "Subscription");

CommerceProducts.configureSubscription(
subscriptionExactDay = 1,
subscriptionLength = 5,
subscriptionMode = "Exact Day of Month",
subscriptionName = "Delivery Subscription",
subscriptionType = "Month");

CommerceEntry.gotoMenuTab(menuTab = "Visibility");

AssertElementNotPresent(
key_name = "Channels",
locator1 = "ToggleSwitch#ENABLE_SPECIFIC_TOGGLE_SWITCH");
}

task ("But cannot add a new product in a different Catalog") {
Click(locator1 = "Icon#BACK");

Click(locator1 = "Button#PLUS");

Click(
key_menuItem = "Simple",
locator1 = "MenuItem#DROPDOWN_MENU_ITEM");

WaitForElementPresent(locator1 = "IFrame#MODAL_BODY");

SelectFrame.selectFrameNoLoading(locator1 = "IFrame#MODAL_BODY");

Type(
locator1 = "CommerceEntry#NAME_FIELD",
value1 = "New Product");

for (var entryName : list "Master,New Catalog") {
Type(
key_label = "Catalog",
locator1 = "CommerceEntry#ANY_AUTOCOMPLETE_TEXT_FIELD",
value1 = ${entryName});

AssertElementPresent(
key_text = "No items were found.",
locator1 = "CP2Utils#ANY_TEXT");
}

Click(locator1 = "Icon#CLOSE");

SelectFrame.selectFrameTop();
}

task ("When the supplier user deletes the product") {
CommerceNavigator.searchEntry(entryName = "Simple T-Shirt");

CommerceProducts.deleteProductsEntry(key_value = "Simple T-Shirt");
}

task ("Then can verify that Simple Product is deleted successfully") {
CommerceNavigator.searchEntry(entryName = "Simple T-Shirt");

AssertElementNotPresent(
key_entryName = "Simple T-Shirt",
locator1 = "CommerceNavigation#ENTRY_NAME");
}
}

@description = "COMMERCE-11604 | As a supplier account user, I want to be able to manage the catalogs the account is linked to"
@priority = 5
test CanSupplierUserManageCatalogs {
Expand Down Expand Up @@ -655,4 +819,89 @@ definition {
}
}

@description = "COMMERCE-11611. As a supplier account user, I cannot view the products in a catalog the account is not linked to."
@priority = 4
test CanSupplierViewOnlyLinkedCatalogProducts {
property portal.acceptance = "false";

task ("Given a Supplier account with a supplier user") {
JSONAccountEntry.addAccountEntry(
accountEntryName = "Commerce Supplier",
accountEntryType = "Supplier");

JSONAccountEntryUser.addAccountEntryUser(
accountEntryName = "Commerce Supplier",
userEmailAddress = "[email protected]",
userFirstName = "Supplier",
userLastName = "User",
userScreenName = "supplieruser");

JSONUser.setFirstPassword(
agreeToTermsAndAnswerReminderQuery = "true",
requireReset = "false",
userEmailAddress = "[email protected]");

JSONAccountRole.associateUser(
accountEntryName = "Commerce Supplier",
accountRole = "Account Supplier",
userEmailAddress = "[email protected]");
}

task ("And a new Catalog with a product is added") {
CommerceJSONCatalogsAPI._addCatalog(catalogName = "Test Catalog");

CommerceJSONProductsAPI._addCommerceProduct(
catalogName = "Test Catalog",
price = 5,
productName = "Simple Product",
productType = "simple",
sku = "TESTSKU");
}

task ("And a product is added to the Master catalog") {
CommerceJSONProductsAPI._addCommerceProduct(
catalogName = "Master",
price = 25,
productName = "New Product",
productType = "simple",
sku = "NEWSKU");
}

task ("And Supplier account is linked to Test Catalog") {
var accountId = CommerceJSONAccountsAPI.getAccountFieldByAccountName(
accountName = "Commerce Supplier",
field = "id");

CommerceJSONCatalogsAPI._patchCommerceCatalog(
accountId = ${accountId},
catalogName = "Test Catalog");
}

task ("When the supplier user logs in") {
User.logoutAndLoginPG(
userLoginEmailAddress = "[email protected]",
userLoginFullName = "Supplier User");
}

task ("Then can view the product from Test Catalog") {
CommerceProducts.openProductsAdmin();

CommerceNavigator.searchEntry(entryName = "Simple Product");

AssertElementPresent(
key_entryName = "Simple Product",
locator1 = "CommerceNavigation#ENTRY_NAME");
}

task ("But cannot view products from Minium and Master Catalogs") {
for (var productName : list "ABS Sensor,Brake Fluid,Hoses,Torque Converters,New Product") {
CommerceNavigator.searchEntry(entryName = ${productName});

AssertElementNotPresent(
key_entryName = ${productName},
locator1 = "CommerceNavigation#ENTRY_NAME");
}
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
dependencies {
compileOnly group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: "2.13.4"
compileOnly group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.13.4"
compileOnly group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.13.4.2"
compileOnly group: "com.liferay", name: "biz.aQute.bnd.annotation", version: "4.2.0.LIFERAY-PATCHED-2"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.impl", version: "default"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "default"
Expand Down
Loading

0 comments on commit 0d6d007

Please sign in to comment.