Skip to content

Commit

Permalink
Fixed package and e2e with tabs that now are capital letters?
Browse files Browse the repository at this point in the history
  • Loading branch information
VitoAlbano committed May 31, 2024
1 parent 643a93e commit ca1d4b1
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@
import { FormCloudComponentPage, LoginPage, ProcessCloudWidgetPage } from '@alfresco/adf-testing';

import { NavigationBarPage } from '../../core/pages/navigation-bar.page';
import { tabFieldValueVisibilityJson, tabVarValueVisibilityJson, tabVarFieldVisibilityJson,
tabFieldFieldVisibilityJson, tabFieldVarVisibilityJson, tabVarVarVisibilityJson,
tabNextOperatorsVisibilityJson } from '../../resources/forms/tab-visibility-conditions';
import {
tabFieldValueVisibilityJson,
tabVarValueVisibilityJson,
tabVarFieldVisibilityJson,
tabFieldFieldVisibilityJson,
tabFieldVarVisibilityJson,
tabVarVarVisibilityJson,
tabNextOperatorsVisibilityJson
} from '../../resources/forms/tab-visibility-conditions';

describe('Visibility conditions on tabs - cloud', () => {

const loginSSOPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
const formCloudDemoPage = new FormCloudComponentPage();
Expand All @@ -41,13 +46,13 @@ describe('Visibility conditions on tabs - cloud', () => {
};

const tab = {
tabWithFields: 'tabWithFields',
tabFieldValue: 'tabBasicFieldValue',
tabVarValue: 'tabBasicVarValue',
tabVarField: 'tabBasicVarField',
tabFieldField: 'tabBasicFieldField',
tabVarVar: 'tabBasicVarVar',
tabNextOperators: 'tabNextOperators'
tabWithFields: 'TABWITHFIELDS',
tabFieldValue: 'TABBASICFIELDVALUE',
tabVarValue: 'TABBASICVARVALUE',
tabVarField: 'TABBASICVARFIELD',
tabFieldField: 'TABBASICFIELDFIELD',
tabVarVar: 'TABBASICVARVAR',
tabNextOperators: 'TABNEXTOPERATORS'
};

beforeAll(async () => {
Expand Down
262 changes: 149 additions & 113 deletions e2e/resources/forms/tab-visibility-conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ const createField = (id = 'TextTwo', name = 'TextTwo') => ({
}
});

const createFieldDefinition = (id = 'dcde7e13-2444-48bc-ab30-32902cea549e', tabName = '71da814d-5580-4f1f-972a-8089253aeded', fields = {
1: [createField()],
2: []
}) => ({
const createFieldDefinition = (
id = 'dcde7e13-2444-48bc-ab30-32902cea549e',
tabName = '71da814d-5580-4f1f-972a-8089253aeded',
fields = {
1: [createField()],
2: []
}
) => ({
id,
name: 'Label',
type: 'container',
Expand All @@ -57,7 +61,14 @@ const fieldDefinition3 = createFieldDefinition('df452297-d0e8-4406-b9d3-10842033
const fieldsDefinitions1 = [fieldDefinition1, fieldDefinition2];
const fieldsDefinitions2 = [fieldDefinition1, fieldDefinition3];

const createVisibilityCondition = (leftType = 'field', leftValue = 'TextOne', nextCondition?: any, rightValue = 'showTab', rightType = 'value', operator = '==') => ({
const createVisibilityCondition = (
leftType = 'field',
leftValue = 'TextOne',
nextCondition?: any,
rightValue = 'showTab',
rightType = 'value',
operator = '=='
) => ({
leftType,
leftValue,
operator,
Expand All @@ -67,39 +78,44 @@ const createVisibilityCondition = (leftType = 'field', leftValue = 'TextOne', ne
nextCondition
});

const createTab = (id = '71da814d-5580-4f1f-972a-8089253aeded', title = 'tabBasicFieldValue', visibilityCondition = createVisibilityCondition('field', 'TextOne', null)) => ({
const createTab = (
id = '71da814d-5580-4f1f-972a-8089253aeded',
title = 'TABBASICFIELDVALUE',
visibilityCondition = createVisibilityCondition('field', 'TextOne', null)
) => ({
id,
title,
visibilityCondition
});

const createTabVisibilityJson = (tabs = [
createTab(),
createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null)
], fields = [
createFieldDefinition(),
createFieldDefinition('df452297-d0e8-4406-b9d3-10842033549d', '442eea0b-65f9-484e-b37f-f5a91d5e1f21', {
1: [
{
id: 'TextOne',
name: 'TextOne',
type: 'text',
required: false,
colspan: 1,
placeholder: null,
minLength: 0,
maxLength: 0,
regexPattern: null,
visibilityCondition: null,
params: {
existingColspan: 1,
maxColspan: 2
const createTabVisibilityJson = (
tabs = [createTab(), createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null)],
fields = [
createFieldDefinition(),
createFieldDefinition('df452297-d0e8-4406-b9d3-10842033549d', '442eea0b-65f9-484e-b37f-f5a91d5e1f21', {
1: [
{
id: 'TextOne',
name: 'TextOne',
type: 'text',
required: false,
colspan: 1,
placeholder: null,
minLength: 0,
maxLength: 0,
regexPattern: null,
visibilityCondition: null,
params: {
existingColspan: 1,
maxColspan: 2
}
}
}
],
2: []
})
], variables = []) => ({
],
2: []
})
],
variables = []
) => ({
formRepresentation: {
id: 'form-3aff57d3-62af-4adf-9b14-1d8f44a28077',
name: 'tabvisibility',
Expand All @@ -118,89 +134,109 @@ const createTabVisibilityJson = (tabs = [

export const tabFieldValueVisibilityJson = createTabVisibilityJson();

export const tabVarValueVisibilityJson = createTabVisibilityJson([
createTab('71da814d-5580-4f1f-972a-8089253aeded', 'tabBasicVarValue', createVisibilityCondition('variable', 'stringVar'))
], [fieldDefinition1], [
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]);
export const tabVarValueVisibilityJson = createTabVisibilityJson(
[createTab('71da814d-5580-4f1f-972a-8089253aeded', 'TABBASICVARVALUE', createVisibilityCondition('variable', 'stringVar'))],
[fieldDefinition1],
[
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]
);

export const tabVarFieldVisibilityJson = createTabVisibilityJson([
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'tabBasicVarField',
createVisibilityCondition('variable', 'stringVar', undefined, 'TextOne', 'field')
),
createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'tabWithFields', null)
], fieldsDefinitions1, [
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]);
export const tabVarFieldVisibilityJson = createTabVisibilityJson(
[
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'TABBASICVARFIELD',
createVisibilityCondition('variable', 'stringVar', undefined, 'TextOne', 'field')
),
createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'TABWITHFIELDS', null)
],
fieldsDefinitions1,
[
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]
);

export const tabFieldFieldVisibilityJson = createTabVisibilityJson([
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'tabBasicFieldField',
createVisibilityCondition('field', 'TextThree', undefined, 'TextOne', 'field')
),
createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null)
], fieldsDefinitions2);
export const tabFieldFieldVisibilityJson = createTabVisibilityJson(
[
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'TABBASICFIELDFIELD',
createVisibilityCondition('field', 'TextThree', undefined, 'TextOne', 'field')
),
createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null)
],
fieldsDefinitions2
);

export const tabFieldVarVisibilityJson = createTabVisibilityJson([
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'tabBasicVarField',
createVisibilityCondition('field', 'TextOne', undefined, 'stringVar', 'variable')
),
createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'tabWithFields', null)
], fieldsDefinitions1, [
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]);
export const tabFieldVarVisibilityJson = createTabVisibilityJson(
[
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'TABBASICVARFIELD',
createVisibilityCondition('field', 'TextOne', undefined, 'stringVar', 'variable')
),
createTab('0e538a28-f8d6-4cb8-ae93-dbfb2efdf3b1', 'TABWITHFIELDS', null)
],
fieldsDefinitions1,
[
{
id: '803269e6-a568-40e2-aec3-75ad2f411688',
name: 'stringVar',
type: 'string',
value: 'showTab'
}
]
);

export const tabVarVarVisibilityJson = createTabVisibilityJson([
createTab(
'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a',
'tabBasicVarVar',
createVisibilityCondition('variable', 'showTabOne', undefined, 'showTabTwo', 'variable')
)
], [
createFieldDefinition('6eeb9e54-e51d-44f3-9557-503308f07361', 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', {
1: [createField('TextOne', 'TextOne')],
2: []
})
], [
{
id: 'b116df99-f6b5-45f8-b48c-15b74f7f1c92',
name: 'showTabOne',
type: 'string',
value: 'showTab'
},
{
id: '6e3e88ab-848c-4f48-8326-a404d1427f60',
name: 'showTabTwo',
type: 'string',
value: 'showTab'
}
]);
export const tabVarVarVisibilityJson = createTabVisibilityJson(
[
createTab(
'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a',
'TABBASICVARVAR',
createVisibilityCondition('variable', 'showTabOne', undefined, 'showTabTwo', 'variable')
)
],
[
createFieldDefinition('6eeb9e54-e51d-44f3-9557-503308f07361', 'ef512cb3-0c41-4d12-84ef-a7ef8f0b111a', {
1: [createField('TextOne', 'TextOne')],
2: []
})
],
[
{
id: 'b116df99-f6b5-45f8-b48c-15b74f7f1c92',
name: 'showTabOne',
type: 'string',
value: 'showTab'
},
{
id: '6e3e88ab-848c-4f48-8326-a404d1427f60',
name: 'showTabTwo',
type: 'string',
value: 'showTab'
}
]
);

export const tabNextOperatorsVisibilityJson = createTabVisibilityJson([
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'tabNextOperators',
createVisibilityCondition('field', 'TextOne', createVisibilityCondition('field', 'TextThree', null, 'showTab', 'value', '!='))
),
createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'tabWithFields', null)
], fieldsDefinitions2);
export const tabNextOperatorsVisibilityJson = createTabVisibilityJson(
[
createTab(
'71da814d-5580-4f1f-972a-8089253aeded',
'TABNEXTOPERATORS',
createVisibilityCondition('field', 'TextOne', createVisibilityCondition('field', 'TextThree', null, 'showTab', 'value', '!='))
),
createTab('442eea0b-65f9-484e-b37f-f5a91d5e1f21', 'TABWITHFIELDS', null)
],
fieldsDefinitions2
);
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ export const ACTIVITI_CLOUD_APPS = {
tabVisibilityVars: {
name: 'tabvisibilitywithvars',
tabs: {
tabWithFields: 'tabWithFields',
tabVarVar: 'tabBasicVarVar',
tabBasicVarField: 'tabBasicVarField'
tabWithFields: 'TABWITHFIELDS',
tabVarVar: 'TABBASICVARVAR',
tabBasicVarField: 'TABBASICVARFIELD'
},
widgets: {
textOneId: 'TextOne',
Expand Down
Loading

0 comments on commit ca1d4b1

Please sign in to comment.