Skip to content

Commit

Permalink
LPD-38558 - Refactor. Use fixture helper to create the FDS Sample sit…
Browse files Browse the repository at this point in the history
…e content
  • Loading branch information
juanjofgliferay authored and brianchandotcom committed Oct 11, 2024
1 parent a473782 commit 71fb511
Showing 1 changed file with 12 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import {apiHelpersTest} from '../../fixtures/apiHelpersTest';
import {featureFlagsTest} from '../../fixtures/featureFlagsTest';
import {isolatedSiteTest} from '../../fixtures/isolatedSiteTest';
import {loginTest} from '../../fixtures/loginTest';
import {liferayConfig} from '../../liferay.config';
import getRandomString from '../../utils/getRandomString';
import getPageDefinition from '../layout-content-page-editor-web/utils/getPageDefinition';
import getWidgetDefinition from '../layout-content-page-editor-web/utils/getWidgetDefinition';
import {fdsSamplePageTest} from './fixtures/fdsSamplePageTest';

const sidePanelActionLabelWithActionTitle = 'Side Panel With Action Title';
const sidePanelActionLabelWithContentTitle = 'Side Panel With Content Title';
Expand All @@ -24,6 +21,7 @@ const sidePanelContentTitle = 'Side Panel Title Provided by Page';

export const test = mergeTests(
apiHelpersTest,
fdsSamplePageTest,
featureFlagsTest({
'LPS-178052': true,
}),
Expand All @@ -32,35 +30,18 @@ export const test = mergeTests(
);

test.describe('Item Actions in frontend data set', () => {
test('Side Panel Item Actions', async ({apiHelpers, page, site}) => {
let layout: Layout;

await test.step('Create a content site and the frontend data set sample widget', async () => {
const widgetDefinition = getWidgetDefinition({
id: getRandomString(),
widgetName:
'com_liferay_frontend_data_set_sample_web_internal_portlet_FDSSamplePortlet',
});

layout = await apiHelpers.headlessDelivery.createSitePage({
pageDefinition: getPageDefinition([widgetDefinition]),
siteId: site.id,
title: getRandomString(),
});
test('Side Panel Item Actions', async ({
apiHelpers,
fdsSamplePage,
page,
site,
}) => {
await test.step('Create a content site and with FDS sample widget', async () => {
await fdsSamplePage.setupFDSSampleWidget({apiHelpers, site});
});

await test.step('Select Customized tab ', async () => {
await page.goto(
`${liferayConfig.environment.baseUrl}/web${site.friendlyUrlPath}${layout.friendlyUrlPath}`
);

const tabHeading = page
.getByRole('tablist')
.getByText('Customized');

await expect(tabHeading).toBeInViewport();

await tabHeading.click();
await test.step('Select Customized tab', async () => {
await fdsSamplePage.selectTab('Customized');
});

const datasetRow =
Expand Down

0 comments on commit 71fb511

Please sign in to comment.