mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-2107] Move e2e to Unit test (#5535)
* [AAE-2107] Move e2e to Unit test * * fixed namings * * more unit test added * * minor changes
This commit is contained in:
@@ -1,314 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BrowserVisibility, LoginPage } from '@alfresco/adf-testing';
|
||||
import { browser, by, element } from 'protractor';
|
||||
import { CardViewComponentPage } from '../../pages/adf/card-view-component.page';
|
||||
import { MetadataViewPage } from '../../pages/adf/metadata-view.page';
|
||||
import { NavigationBarPage } from '../../pages/adf/navigation-bar.page';
|
||||
|
||||
describe('CardView Component', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const cardViewPageComponent = new CardViewComponentPage();
|
||||
const metadataViewPage = new MetadataViewPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await loginPage.loginToContentServices(browser.params.testConfig.adf.adminEmail, browser.params.testConfig.adf.adminPassword);
|
||||
await navigationBarPage.clickCardViewButton();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await navigationBarPage.clickLogoutButton();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await cardViewPageComponent.clickOnResetButton();
|
||||
});
|
||||
|
||||
describe('key-value pair ', () => {
|
||||
|
||||
it('[C279938] Should the label be present', async () => {
|
||||
const label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279898] Should be possible edit key-value pair properties', async () => {
|
||||
await cardViewPageComponent.clickOnAddButton();
|
||||
await cardViewPageComponent.setName('testName');
|
||||
await cardViewPageComponent.setValue('testValue');
|
||||
await cardViewPageComponent.clickOnAddButton();
|
||||
await cardViewPageComponent.waitForOutput();
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Key-Value Pairs Item] - [{"name":"testName","value":"testValue"}]');
|
||||
|
||||
await cardViewPageComponent.deletePairsValues();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Key-Value Pairs Item] - []');
|
||||
});
|
||||
});
|
||||
|
||||
describe('SelectBox', () => {
|
||||
|
||||
it('[C279939] Should the label be present', async () => {
|
||||
const label = element(by.css('div[data-automation-id="card-select-label-select"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279899] Should be possible edit selectBox item', async () => {
|
||||
await cardViewPageComponent.clickSelectBox();
|
||||
await cardViewPageComponent.selectValueFromComboBox(1);
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0))
|
||||
.toBe('[CardView Select Item] - two');
|
||||
});
|
||||
|
||||
it('[C312448] Should be able to enable None option', async () => {
|
||||
await cardViewPageComponent.enableNoneOption();
|
||||
await cardViewPageComponent.clickSelectBox();
|
||||
await cardViewPageComponent.selectValueFromComboBox(0);
|
||||
|
||||
await expect(cardViewPageComponent.getOutputText(0))
|
||||
.toBe('[CardView Select Item] - null');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Text', () => {
|
||||
|
||||
it('[C279937] Should the label be present', async () => {
|
||||
await cardViewPageComponent.checkNameTextLabelIsPresent();
|
||||
});
|
||||
|
||||
it('[C279943] Should be present a default value', async () => {
|
||||
await expect(await cardViewPageComponent.getNameTextFieldText()).toBe('Spock');
|
||||
});
|
||||
|
||||
it('[C279934] Should be possible edit text item', async () => {
|
||||
await cardViewPageComponent.clickOnNameTextField();
|
||||
await cardViewPageComponent.enterNameTextField('example');
|
||||
await cardViewPageComponent.clickOnNameTextSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Text Item] - example');
|
||||
});
|
||||
|
||||
it('[C279944] Should be possible undo text item modify when click on the clear button', async () => {
|
||||
await cardViewPageComponent.clickOnNameTextField();
|
||||
await cardViewPageComponent.enterNameTextField('example');
|
||||
await cardViewPageComponent.clickOnNameTextClearIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getNameTextFieldText()).toBe('Spock');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Int', () => {
|
||||
|
||||
it('[C279940] Should the label be present', async () => {
|
||||
const label = element(by.css('div[data-automation-id="card-textitem-label-int"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279945] Should be present a default value', async () => {
|
||||
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
|
||||
});
|
||||
|
||||
it('[C279946] Should be possible edit int item', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('99999');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 99999');
|
||||
});
|
||||
|
||||
it('[C279947] Should not be possible add string value to the int item', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('string value');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
|
||||
});
|
||||
|
||||
it('[C279948] Should not be possible add float value to the int item', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('0.22');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
|
||||
});
|
||||
|
||||
it('[C279949] Should not be possible to have a space as a value', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField(' ');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
|
||||
});
|
||||
|
||||
it('[C321535] Should be able to delete the value and save the CardView Int Item', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.clearIntField();
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
await expect(await cardViewPageComponent.isErrorNotDisplayed()).toBe(true, 'The CardView Int Item should accept an empty field, but the error message is still displayed');
|
||||
});
|
||||
|
||||
it('[C279950] Should return an error when the value is > 2147483647', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('214748367');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Int Item] - 214748367');
|
||||
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('2147483648');
|
||||
await cardViewPageComponent.clickOnIntSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorInt()).toBe('Use an integer format');
|
||||
});
|
||||
|
||||
it('[C279951] Should be possible undo item modify when click on the clear button', async () => {
|
||||
await cardViewPageComponent.clickOnIntField();
|
||||
await cardViewPageComponent.enterIntField('999');
|
||||
await cardViewPageComponent.clickOnIntClearIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getIntFieldText()).toBe('213');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Float', () => {
|
||||
|
||||
it('[C279941] Should the label be present', async () => {
|
||||
const label = element(by.css('div[data-automation-id="card-textitem-label-float"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279952] Should be present a default value', async () => {
|
||||
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
|
||||
});
|
||||
|
||||
it('[C279953] Should be possible edit float item', async () => {
|
||||
await cardViewPageComponent.clickOnFloatField();
|
||||
await cardViewPageComponent.enterFloatField('77.33');
|
||||
await cardViewPageComponent.clickOnFloatSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Float Item] - 77.33');
|
||||
});
|
||||
|
||||
it('[C279954] Should not be possible add string value to the float item', async () => {
|
||||
await cardViewPageComponent.clickOnFloatField();
|
||||
await cardViewPageComponent.enterFloatField('string value');
|
||||
await cardViewPageComponent.clickOnFloatSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
|
||||
});
|
||||
|
||||
it('[C279955] Should be possible undo item item modify when click on the clear button', async () => {
|
||||
await cardViewPageComponent.clickOnFloatField();
|
||||
await cardViewPageComponent.enterFloatField('77.33');
|
||||
await cardViewPageComponent.clickOnFloatClearIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getFloatFieldText()).toBe('9.9');
|
||||
});
|
||||
|
||||
it('[C279956] Should not be possible have an empty value', async () => {
|
||||
await cardViewPageComponent.clickOnFloatField();
|
||||
await cardViewPageComponent.enterFloatField(' ');
|
||||
await cardViewPageComponent.clickOnFloatSaveIcon();
|
||||
|
||||
await expect(await cardViewPageComponent.getErrorFloat()).toBe('Use a number format');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Boolean', () => {
|
||||
|
||||
it('[C279942] Should the label be present', async () => {
|
||||
const label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(label);
|
||||
});
|
||||
|
||||
it('[C279957] Should be possible edit the checkbox value when click on it', async () => {
|
||||
await cardViewPageComponent.checkboxClick();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(0)).toBe('[CardView Boolean Item] - false');
|
||||
|
||||
await cardViewPageComponent.checkboxClick();
|
||||
|
||||
await expect(await cardViewPageComponent.getOutputText(1)).toBe('[CardView Boolean Item] - true');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Date and DateTime', () => {
|
||||
|
||||
it('[C279961] Should the label be present', async () => {
|
||||
const labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(labelDate);
|
||||
|
||||
const labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsPresent(labelDatetime);
|
||||
});
|
||||
|
||||
it('[C279962] Should be present a default value', async () => {
|
||||
await expect(await metadataViewPage.getPropertyText('date', 'date')).toEqual('12/24/83');
|
||||
await expect(await metadataViewPage.getPropertyText('datetime', 'datetime')).toEqual('12/24/83, 10:00 AM');
|
||||
});
|
||||
|
||||
it('[C312447] Should be able to clear the date field', async () => {
|
||||
await cardViewPageComponent.enableClearDate();
|
||||
await cardViewPageComponent.clearDateField();
|
||||
await expect(await cardViewPageComponent.getDateValue()).toBe('', 'Date field should be cleared');
|
||||
await expect(cardViewPageComponent.getOutputText(0))
|
||||
.toBe('[CardView Date Item] - null');
|
||||
await cardViewPageComponent.clearDateTimeField();
|
||||
await expect(await cardViewPageComponent.getDateTimeValue()).toBe('', 'DateTime field should be cleared');
|
||||
await expect(cardViewPageComponent.getOutputText(1))
|
||||
.toBe('[CardView Datetime Item] - null');
|
||||
});
|
||||
});
|
||||
|
||||
it('[C306895] Should display the form field as editable and clickable depending on the \'Editable\' toggle mode.', async () => {
|
||||
const message = 'clickable updated';
|
||||
await cardViewPageComponent.clickOnResetButton();
|
||||
await expect(await cardViewPageComponent.getClickableValue()).toContain('click here');
|
||||
|
||||
await cardViewPageComponent.updateClickableField(message);
|
||||
await expect(await cardViewPageComponent.hasCardViewConsoleLog(message)).toContain(`[This is clickable ] - ${message}`);
|
||||
|
||||
await cardViewPageComponent.clickOnResetButton();
|
||||
await cardViewPageComponent.updateClickableField('');
|
||||
await expect(await cardViewPageComponent.hasCardViewConsoleLog('[This is clickable ] -' )).toContain('[This is clickable ] -');
|
||||
});
|
||||
|
||||
it('[C279936] Should not be possible edit any parameter when editable property is false', async () => {
|
||||
await cardViewPageComponent.disableEdit();
|
||||
|
||||
const editIconText = element(by.css('button[data-automation-id="card-textitem-edit-icon-name"]'));
|
||||
const editIconInt = element(by.css('button[data-automation-id="card-textitem-edit-icon-int"]'));
|
||||
const editIconFloat = element(by.css('button[data-automation-id="card-textitem-edit-icon-float"]'));
|
||||
const editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]'));
|
||||
const editIconData = element(by.css('mat-datetimepicker-toggle'));
|
||||
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editIconText);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editIconInt);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editIconFloat);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editIconKey);
|
||||
await BrowserVisibility.waitUntilElementIsNotVisible(editIconData);
|
||||
});
|
||||
});
|
@@ -69,33 +69,4 @@ describe('Datatable component - selection', () => {
|
||||
await dataTablePage.checkNoRowIsSelected();
|
||||
});
|
||||
|
||||
it('[C260059] Should be possible select multiple row when multiselect is true', async () => {
|
||||
await dataTablePage.clickMultiSelect();
|
||||
await dataTablePage.clickCheckbox('1');
|
||||
await dataTablePage.checkRowIsChecked('1');
|
||||
await dataTablePage.clickCheckbox('3');
|
||||
await dataTablePage.checkRowIsChecked('3');
|
||||
await dataTablePage.checkRowIsNotChecked('2');
|
||||
await dataTablePage.checkRowIsNotChecked('4');
|
||||
await dataTablePage.clickCheckbox('3');
|
||||
await dataTablePage.checkRowIsNotChecked('3');
|
||||
await dataTablePage.checkRowIsChecked('1');
|
||||
});
|
||||
|
||||
it('[C260058] Should be possible select all the rows when multiselect is true', async () => {
|
||||
await dataTablePage.checkAllRows();
|
||||
await dataTablePage.checkRowIsChecked('1');
|
||||
await dataTablePage.checkRowIsChecked('2');
|
||||
await dataTablePage.checkRowIsChecked('3');
|
||||
await dataTablePage.checkRowIsChecked('4');
|
||||
});
|
||||
|
||||
it('[C277262] Should be possible reset the selected row when click on the reset button', async () => {
|
||||
await dataTablePage.checkRowIsChecked('1');
|
||||
await dataTablePage.checkRowIsChecked('2');
|
||||
await dataTablePage.checkRowIsChecked('3');
|
||||
await dataTablePage.checkRowIsChecked('4');
|
||||
await dataTablePage.clickReset();
|
||||
await dataTablePage.checkNoRowIsSelected();
|
||||
});
|
||||
});
|
||||
|
@@ -227,18 +227,6 @@ describe('Process list cloud', () => {
|
||||
await expect(await processCloudDemoPage.processListCloudComponent().getDataTable().checkListIsSorted('DESC', 'Business Key')).toBe(true);
|
||||
});
|
||||
|
||||
it('[C305054] Should display the actions filters Save, SaveAs and Delete', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('All Processes');
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
|
||||
const editProcessFilterCloudComponent = processCloudDemoPage.editProcessFilterCloudComponent();
|
||||
|
||||
await editProcessFilterCloudComponent.checkSaveButtonIsDisplayed();
|
||||
await editProcessFilterCloudComponent.checkSaveAsButtonIsDisplayed();
|
||||
await editProcessFilterCloudComponent.checkDeleteButtonIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C297697] The value of the filter should be preserved when saving it', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setProcessInstanceId(completedProcess.entry.id);
|
||||
@@ -297,32 +285,5 @@ describe('Process list cloud', () => {
|
||||
await BrowserActions.closeMenuAndDialogs();
|
||||
});
|
||||
|
||||
describe('Process List - Check Action Filters', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await LocalStorageUtil.setConfigField('adf-edit-process-filter', JSON.stringify({
|
||||
'actions': [
|
||||
'save',
|
||||
'saveAs'
|
||||
]
|
||||
}));
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkTaskListIsLoaded();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
|
||||
});
|
||||
|
||||
it('[C305054] Should display the actions filters Save and SaveAs, Delete button is not displayed', async () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickAllProcessesFilter();
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('All Processes');
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().checkSaveButtonIsDisplayed();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().checkSaveAsButtonIsDisplayed();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().checkDeleteButtonIsNotDisplayed();
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -184,14 +184,6 @@ describe('Process filters cloud', () => {
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsNotDisplayedByName(differentAppUserProcessInstance.entry.name);
|
||||
});
|
||||
|
||||
it('[C306891] Should be able to see "No process found" when providing an initiator whitout processes', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setProperty('initiator', anotherUser.username);
|
||||
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
|
||||
it('[C311315] Should be able to filter by process definition id', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processDefinitionId', processDefinition.entry.id);
|
||||
|
@@ -31,10 +31,13 @@ import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/p
|
||||
import { ProcessDetailsCloudDemoPage } from '../pages/adf/demo-shell/process-services-cloud/process-details-cloud-demo.page';
|
||||
import { TasksCloudDemoPage } from '../pages/adf/demo-shell/process-services/tasks-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../pages/adf/navigation-bar.page';
|
||||
import { ProcessListPage } from '../pages/adf/process-services/process-list.page';
|
||||
import { EditProcessFilterConfiguration } from './config/edit-process-filter.config';
|
||||
import { ProcessListCloudConfiguration } from './config/process-list-cloud.config';
|
||||
import { ProcessDefinitionCloud, ProcessInstanceCloud, StartTaskCloudResponseModel } from '@alfresco/adf-process-services-cloud';
|
||||
import {
|
||||
ProcessDefinitionCloud,
|
||||
ProcessInstanceCloud,
|
||||
StartTaskCloudResponseModel
|
||||
} from '@alfresco/adf-process-services-cloud';
|
||||
|
||||
describe('Process filters cloud', () => {
|
||||
const loginSSOPage = new LoginSSOPage();
|
||||
@@ -45,7 +48,6 @@ describe('Process filters cloud', () => {
|
||||
const processDetailsCloudDemoPage = new ProcessDetailsCloudDemoPage();
|
||||
const taskHeaderCloudPage = new TaskHeaderCloudPage();
|
||||
const taskFormCloudComponent = new TaskFormCloudComponent();
|
||||
const processListPage = new ProcessListPage();
|
||||
const apiService = new ApiService(
|
||||
browser.params.config.oauth2.clientId,
|
||||
browser.params.config.bpmHost, browser.params.config.oauth2.host, browser.params.config.providers
|
||||
@@ -88,30 +90,6 @@ describe('Process filters cloud', () => {
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
});
|
||||
|
||||
it('[C290041] Should be displayed the "No Process Found" message when the process list is empty', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setAppNameDropDown(simpleApp);
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setStatusFilterDropDown('COMPLETED');
|
||||
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().waitTillContentLoaded();
|
||||
await expect(await processCloudDemoPage.processListCloudComponent().getDataTable().contents.count()).toBeGreaterThan(0);
|
||||
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processInstanceId', 'i_am_fake_id');
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
|
||||
it('[C315296] Should NOT display "No Process Found" before displaying the process list', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setAppNameDropDown(simpleApp);
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setStatusFilterDropDown('COMPLETED');
|
||||
|
||||
await expect(await processListPage.titleNotPresent()).toBeTruthy();
|
||||
await expect(await processCloudDemoPage.processListCloudComponent().getDataTable().contents.count()).toBeGreaterThan(0);
|
||||
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setProperty('processInstanceId', 'i_am_fake_id');
|
||||
await expect(await processListPage.getDisplayedProcessListTitle()).toEqual('No Processes Found');
|
||||
});
|
||||
|
||||
it('[C290040] Should be able to open the Task Details page by clicking on the process name', async () => {
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().openFilter();
|
||||
await processCloudDemoPage.editProcessFilterCloudComponent().setAppNameDropDown(simpleApp);
|
||||
|
@@ -1,102 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright 2019 Alfresco Software, Ltd.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ApiService, AppListCloudPage, GroupIdentityService, IdentityService, LocalStorageUtil, LoginSSOPage, ProcessDefinitionsService, ProcessInstancesService } from '@alfresco/adf-testing';
|
||||
import { browser } from 'protractor';
|
||||
import { ProcessCloudDemoPage } from '../pages/adf/demo-shell/process-services/process-cloud-demo.page';
|
||||
import { NavigationBarPage } from '../pages/adf/navigation-bar.page';
|
||||
import { ProcessListCloudConfiguration } from './config/process-list-cloud.config';
|
||||
|
||||
describe('Process list cloud', () => {
|
||||
|
||||
describe('Process List', () => {
|
||||
const loginSSOPage = new LoginSSOPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
const appListCloudComponent = new AppListCloudPage();
|
||||
const processCloudDemoPage = new ProcessCloudDemoPage();
|
||||
const apiService = new ApiService(browser.params.config.oauth2.clientId, browser.params.config.bpmHost, browser.params.config.oauth2.host, 'BPM');
|
||||
|
||||
let processDefinitionService: ProcessDefinitionsService;
|
||||
let processInstancesService: ProcessInstancesService;
|
||||
let identityService: IdentityService;
|
||||
let groupIdentityService: GroupIdentityService;
|
||||
let testUser, groupInfo;
|
||||
|
||||
const candidateBaseApp = browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.name;
|
||||
let jsonFile;
|
||||
let runningProcess;
|
||||
|
||||
beforeAll(async () => {
|
||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||
identityService = new IdentityService(apiService);
|
||||
groupIdentityService = new GroupIdentityService(apiService);
|
||||
testUser = await identityService.createIdentityUserWithRole(apiService, [identityService.ROLES.ACTIVITI_USER]);
|
||||
groupInfo = await groupIdentityService.getGroupInfoByGroupName('hr');
|
||||
await identityService.addUserToGroup(testUser.idIdentityService, groupInfo.id);
|
||||
|
||||
await apiService.login(testUser.email, testUser.password);
|
||||
|
||||
processDefinitionService = new ProcessDefinitionsService(apiService);
|
||||
const processDefinition = await processDefinitionService
|
||||
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.CANDIDATE_BASE_APP.processes.candidateGroupProcess, candidateBaseApp);
|
||||
|
||||
processInstancesService = new ProcessInstancesService(apiService);
|
||||
runningProcess = await processInstancesService.createProcessInstance(processDefinition.entry.key, candidateBaseApp);
|
||||
|
||||
await loginSSOPage.loginSSOIdentityService(testUser.email, testUser.password);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
|
||||
await identityService.deleteIdentityUser(testUser.idIdentityService);
|
||||
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
const processListCloudConfiguration = new ProcessListCloudConfiguration();
|
||||
jsonFile = processListCloudConfiguration.getConfiguration();
|
||||
|
||||
await LocalStorageUtil.setConfigField('adf-cloud-process-list', JSON.stringify(jsonFile));
|
||||
|
||||
await navigationBarPage.navigateToProcessServicesCloudPage();
|
||||
await appListCloudComponent.checkApsContainer();
|
||||
await appListCloudComponent.goToApp(candidateBaseApp);
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickOnProcessFilters();
|
||||
await processCloudDemoPage.processFilterCloudComponent.clickRunningProcessesFilter();
|
||||
await expect(await processCloudDemoPage.processFilterCloudComponent.getActiveFilterName()).toBe('Running Processes');
|
||||
await processCloudDemoPage.processListCloudComponent().checkProcessListIsLoaded();
|
||||
await processCloudDemoPage.processListCloudComponent().checkContentIsDisplayedById(runningProcess.entry.id);
|
||||
|
||||
});
|
||||
|
||||
it('[C291997] Should be able to change the default columns', async () => {
|
||||
|
||||
await expect(await processCloudDemoPage.processListCloudComponent().getDataTable().getNumberOfColumns()).toBe(10);
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('id');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('name');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('status');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('startDate');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('appName');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('businessKey');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('initiator');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('lastModified');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('processDefinitionId');
|
||||
await processCloudDemoPage.processListCloudComponent().getDataTable().checkColumnIsDisplayed('processDefinitionKey');
|
||||
|
||||
});
|
||||
});
|
||||
});
|
@@ -199,13 +199,6 @@ describe('Start Task', () => {
|
||||
await expect(await tasksCloudDemoPage.taskFilterCloudComponent.getActiveFilterName()).toBe('My Tasks');
|
||||
});
|
||||
|
||||
it('[C291953] Assignee field should display the logged user as default', async () => {
|
||||
await tasksCloudDemoPage.openNewTaskForm();
|
||||
await startTask.checkFormIsDisplayed();
|
||||
await expect(await peopleCloudComponent.checkSelectedPeople(testUser.firstName));
|
||||
await startTask.clickCancelButton();
|
||||
});
|
||||
|
||||
it('[C305050] Should be able to reassign the removed user when starting a new task', async () => {
|
||||
await tasksCloudDemoPage.openNewTaskForm();
|
||||
await startTask.checkFormIsDisplayed();
|
||||
|
@@ -63,11 +63,6 @@ describe('Task filters cloud', () => {
|
||||
await appListCloudComponent.goToApp(simpleApp);
|
||||
});
|
||||
|
||||
it('[C290011] Should display default filters when an app is deployed', async () => {
|
||||
await tasksCloudDemoPage.taskFilterCloudComponent.checkMyTasksFilterIsDisplayed();
|
||||
await tasksCloudDemoPage.taskFilterCloudComponent.checkCompletedTasksFilterIsDisplayed();
|
||||
});
|
||||
|
||||
it('[C290009] Should display default filters and created task', async () => {
|
||||
tasksService = new TasksService(apiService);
|
||||
|
||||
@@ -101,9 +96,5 @@ describe('Task filters cloud', () => {
|
||||
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(completedTask);
|
||||
});
|
||||
|
||||
it('[C291792] Should select the first task filter from the list as default', async () => {
|
||||
|
||||
await expect(await tasksCloudDemoPage.taskFilterCloudComponent.firstFilterIsActive()).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user