Skip to content

Commit

Permalink
LPS-192708 Add case to edit picklist field on associated display page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Cao authored and brianchandotcom committed Sep 6, 2023
1 parent 2623cee commit e78b129
Showing 1 changed file with 125 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,131 @@ definition {
}
}

@description = "This is a test for LPS-191275. The administrator could edit picklist field of object entry via associated display page."
@priority = 4
test EditPicklistFieldOnAssociatedDisplayPage {
property custom.properties = "feature.flag.LPS-183727=true";

task ("Given a site administrater has a display page template for Object with picklist field") {
Picklist.addPicklistViaAPI(picklistName = "Fruits");

for (var fruit : list "Apple,Banana,Peach,Lemon,Pineapple,Watermelon") {
Picklist.addPicklistItemViaAPI(
itemKey = ${fruit},
itemName = ${fruit},
picklistName = "Fruits");
}

ObjectAdmin.addObjectFieldViaAPI(
fieldBusinessType = "Picklist",
fieldLabelName = "Type",
fieldName = "type",
fieldType = "String",
isRequired = "false",
objectName = ${randomObjectName},
picklistName = "Fruits");

ObjectAdmin.publishObjectViaAPI(objectName = ${randomObjectName});

ObjectAdmin.goToCustomObject(objectName = ${randomObjectName});

ObjectAdmin.addObjectPicklistFieldEntryViaUI(picklistOption = "Apple");

PortletEntry.save();

Navigator.gotoBack();

ObjectPortlet.viewEntry(entry = "Apple");

var objectEntryId = selenium.getText("ObjectPortlet#ENTRY_ID");

DisplayPageTemplatesAdmin.openDisplayPagesAdmin(siteURLKey = ${siteURLKey});

DisplayPageTemplatesAdmin.addDisplayPage(
contentType = ${randomLabelName},
displayPageName = "Display Page Name");

PageEditor.addFragment(
collectionName = "Form Components",
fragmentName = "Form Container");

PageEditor.mapFormContainerToObject(contentType = "${randomLabelName} (Default)");

PageEditor.publish();

DisplayPageTemplatesAdmin.markDisplayPageAsDefault(displayPageName = "Display Page Name");

JSONLayout.addPublicLayout(
groupName = ${randomSiteName},
layoutName = "Test Page Name",
type = "content");

ContentPagesNavigator.openEditContentPage(
pageName = "Test Page Name",
siteName = ${randomSiteName});

PageEditor.addFragment(
collectionName = "Content Display",
fragmentName = "Collection Display");

PageEditor.editCollectionDisplay(
fragmentName = "Collection Display",
infoListProviderName = "${randomLabelName}s");

PageEditor.addFragmentToCollectionDisplay(
collectionName = "Basic Components",
entryTitle = "Sample Collection Item",
fragmentName = "Button");

PageEditorEditableLink.gotoEditableFieldLink(
fragmentName = "Button",
id = "link");

PageEditorEditableLink.mapURLToAsset(field = "Default");

PageEditor.publish();
}

task ("When the site administrater accesses to the associated display page") {
ContentPagesNavigator.openViewContentPage(
pageName = "Test Page Name",
siteName = ${randomSiteName});

Button.click(button = "Go Somewhere");

ControlMenu.viewHeaderTitle(headerTitle = ${objectEntryId});

WaitForPageLoad();
}

task ("Then the site administrater should see the value of picklist field from object entry shown on Multiselect List fragment") {
AssertTextEquals(
index = 1,
locator1 = "Fragment#INPUT_FIELD",
type = "select-from-list",
value1 = "Apple");
}

task ("When the site administrater select different options in picklist field then submit") {
Click(
index = 1,
locator1 = "Fragment#INPUT_TOGGLE",
type = "select-from-list");

MenuItem.click(menuItem = "Pineapple");

Button.clickSubmitButton();

AssertTextPresent(value1 = "Thank you. Your information was successfully received.");
}

task ("Then the value of picklist field from object entry should be updated") {
ObjectAdmin.goToCustomObject(objectName = ${randomObjectName});

ObjectPortlet.viewEntry(entry = "Pineapple");
}
}

@description = "This is a test for LPS-184193. Allow selecting specific display page in the page editor for object entry."
@priority = 4
test MapSpecificDisplayPageForObject {
Expand Down

0 comments on commit e78b129

Please sign in to comment.