Fix E2E run (#5624)

* Fix E2E run
remove not used report
Fix USERNAME AND PAS upload PS cloud e2e screenshot

* save report

* multiple 4 cs

* change test fix screenshot and others

* exclude other test
This commit is contained in:
Eugenio Romano
2020-04-20 17:54:03 +01:00
committed by GitHub
parent bc2d7f16fd
commit f36cbd57ef
14 changed files with 69 additions and 247 deletions

View File

@@ -118,7 +118,7 @@ describe('Delete Directive', () => {
await contentServicesPage.waitForTableBody();
});
it('[C260188] - Delete multiple content', async () => {
it('[C260188] Delete multiple content', async () => {
await contentListPage.selectRowWithKeyboard(txtFileModel.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name);
await contentListPage.selectRowWithKeyboard(file0BytesModel.name);
@@ -140,7 +140,7 @@ describe('Delete Directive', () => {
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderSecond.name);
});
it('[C260192] - Delete file and folder with hierarchy', async () => {
it('[C260192] Delete file and folder with hierarchy', async () => {
await contentListPage.selectRowWithKeyboard(txtFileModel.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', txtFileModel.name);
await contentListPage.selectRowWithKeyboard(folderInfo.name);
@@ -150,7 +150,7 @@ describe('Delete Directive', () => {
await contentListPage.dataTable.checkContentIsNotDisplayed('Display name', folderInfo.name);
});
it('[C260193] - Delete file when different selections are set', async () => {
it('[C260193] Delete file when different selections are set', async () => {
await contentServicesPage.chooseSelectionMode('None');
await contentListPage.selectRow(txtFileModel.name);
await contentListPage.dataTable.checkRowIsNotSelected('Display name', txtFileModel.name);
@@ -192,7 +192,7 @@ describe('Delete Directive', () => {
await contentServicesPage.waitForTableBody();
});
it('[C260191] - Delete content selected from different pages', async () => {
it('[C260191] Delete content selected from different pages', async () => {
await contentServicesPage.sortByName('ASC');
await paginationPage.selectItemsPerPage('5');
@@ -252,7 +252,7 @@ describe('Delete Directive', () => {
} catch (error) {}
});
it('[C216426] - Delete file without delete permissions', async () => {
it('[C216426] Delete file without delete permissions', async () => {
await contentListPage.selectRowWithKeyboard(filePdf.entry.name);
await contentListPage.dataTable.checkRowIsSelected('Display name', filePdf.entry.name);
await contentServicesPage.checkToolbarDeleteIsDisabled();

View File

@@ -75,7 +75,6 @@ describe('Task Header cloud component', () => {
let groupIdentityService: GroupIdentityService;
beforeAll(async () => {
await apiService.login(browser.params.identityAdmin.email, browser.params.identityAdmin.password);
identityService = new IdentityService(apiService);
groupIdentityService = new GroupIdentityService(apiService);
@@ -183,7 +182,7 @@ describe('Task Header cloud component', () => {
.toEqual(isValueInvalid(subTask.entry.parentTaskId) ? '' : subTask.entry.parentTaskId);
});
it('[C309698] - Should validate the Priority field', async () => {
it('[C309698] Should validate the Priority field', async () => {
const myTaskName = `Test_C309698_${StringUtil.generateRandomString()}`;
await tasksCloudDemoPage.clickStartNewTaskButton();
await startTaskCloudPage.addName(myTaskName);
@@ -206,7 +205,7 @@ describe('Task Header cloud component', () => {
await expect(currentValue).toBe('600');
});
it('[C309698] - Should validate the Priority field', async () => {
it('[C309698] Should validate the Priority field', async () => {
await tasksCloudDemoPage.editTaskFilterCloud.openFilter();
await tasksCloudDemoPage.editTaskFilterCloud.setStatusFilterDropDown('ALL');
await tasksCloudDemoPage.editTaskFilterCloud.clearAssignee();
@@ -219,7 +218,7 @@ describe('Task Header cloud component', () => {
await taskHeaderCloudPage.statusCardTextItem.checkElementIsReadonly();
});
it('[C291991] - Should be able to assign a task only to the users that have access to the selected app', async () => {
it('[C291991] Should be able to assign a task only to the users that have access to the selected app', async () => {
await tasksCloudDemoPage.clickStartNewTaskButton();
const currentAssignee = await peopleCloudComponentPage.getChipAssignee();
await expect(currentAssignee).toContain(testUser.firstName, 'Invalid Assignee first name set for the new task');

View File

@@ -168,22 +168,29 @@ describe('Task filters cloud', () => {
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsNotDisplayedByName(createdTaskName);
});
it('[C317658] Should display only tasks with Suspended status when SUSPENDED is selected from status dropdown', async () => {
const processDefinition = await processDefinitionService
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
describe('Dropdown', () => {
let taskAssigned;
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
beforeEach(async () => {
const processDefinition = await processDefinitionService
.getProcessDefinitionByName(browser.params.resources.ACTIVITI_CLOUD_APPS.SIMPLE_APP.processes.dropdownrestprocess, simpleApp);
const taskAssigned = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
const processInstance = await processInstancesService.createProcessInstance(processDefinition.entry.key, simpleApp);
await processInstancesService.suspendProcessInstance(processInstance.entry.id, simpleApp);
taskAssigned = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp);
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee();
await tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('SUSPENDED');
await processInstancesService.suspendProcessInstance(processInstance.entry.id, simpleApp);
});
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskAssigned.list.entries[0].entry.name);
it('[C317658] Should display only tasks with Suspended status when SUSPENDED is selected from status dropdown', async () => {
await tasksCloudDemoPage.editTaskFilterCloudComponent().openFilter();
await tasksCloudDemoPage.editTaskFilterCloudComponent().clearAssignee();
await tasksCloudDemoPage.editTaskFilterCloudComponent().setStatusFilterDropDown('SUSPENDED');
await expect(true).toEqual(false);
await tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(taskAssigned.list.entries[0].entry.name);
});
});
});
});
});

View File

@@ -1,4 +1,6 @@
{
"C260249" : "REPO-4772 ACS 6.2",
"C305010": "Problem start date"
"C305010": "Problem start date",
"C311290": "https://issues.alfresco.com/jira/browse/ADF-5118",
"C317658": "https://issues.alfresco.com/jira/browse/ADF-5118"
}

View File

@@ -1,10 +1,9 @@
const htmlReporter = require('protractor-html-reporter-2');
const fs = require('fs');
const rimraf = require('rimraf');
const path = require('path');
const projectRoot = path.resolve(__dirname, '../../');
let FOLDER = process.env.FOLDER || '';
const TestConfig = require('../test.config');
const AlfrescoApi = require('@alfresco/js-api').AlfrescoApiCompatibility;
function buildNumber() {
let buildNumber = process.env.TRAVIS_BUILD_NUMBER;
@@ -20,6 +19,13 @@ async function uploadScreenshot(alfrescoJsApi, retryCount) {
if (files && files.length > 0) {
let alfrescoJsApi = new AlfrescoApi({
provider: 'ECM',
hostEcm: TestConfig.screenshot.url
});
await alfrescoJsApi.login(TestConfig.screenshot.username, TestConfig.screenshot.password);
let folder;
try {
@@ -64,96 +70,6 @@ async function uploadScreenshot(alfrescoJsApi, retryCount) {
}
}
async function uploadReport(alfrescoJsApi, filenameReport) {
let pathFile = path.join(__dirname, '../../e2e-output/junit-report/html', filenameReport + '.html');
let reportFile = fs.createReadStream(pathFile);
let reportFolder;
try {
reportFolder = await alfrescoJsApi.nodes.addNode('-my-', {
'name': 'report',
'relativePath': `Builds/${buildNumber()}`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
} catch (error) {
reportFolder = await alfrescoJsApi.nodes.getNode('-my-', {
'relativePath': `Builds/${buildNumber()}/report`,
'nodeType': 'cm:folder'
}, {}, {
'overwrite': true
});
}
try {
await alfrescoJsApi.upload.uploadFile(
reportFile,
'',
reportFolder.entry.id,
null,
{
'name': reportFile.name,
'nodeType': 'cm:content',
'autoRename': true
}
);
} catch (error) {
console.log('error' + error);
}
}
async function saveReport(alfrescoJsApi, retryCount) {
let filenameReport = `ProtractorTestReport-${FOLDER}-${retryCount}`;
let output = '';
let savePath = `${projectRoot}/e2e-output/junit-report/`;
let temporaryHtmlPath = savePath + 'html/temporaryHtml/';
let lastFileName = '';
try {
let files = fs.readdirSync(savePath);
if (files && files.length > 0) {
for (const fileName of files) {
const testConfigReport = {
reportTitle: 'Protractor Test Execution Report',
outputPath: temporaryHtmlPath,
outputFilename: Math.random().toString(36).substr(2, 5) + filenameReport,
};
let filePath = `${projectRoot}/e2e-output/junit-report/` + fileName;
new htmlReporter().from(filePath, testConfigReport);
lastFileName = testConfigReport.outputFilename;
}
}
let lastHtmlFile = temporaryHtmlPath + lastFileName + '.html';
if (!(fs.lstatSync(lastHtmlFile).isDirectory())) {
output = output + fs.readFileSync(lastHtmlFile);
}
let fileName = savePath + 'html/' + filenameReport + '.html';
fs.writeFileSync(fileName, output, 'utf8');
await uploadReport(alfrescoJsApi, filenameReport);
} catch (e) {
console.log('Not possible upload junit report');
}
rimraf(`${projectRoot}/e2e-output/screenshots/`, function () {
console.log('done delete screenshot');
});
}
async function cleanReportFolder() {
let reportsFolder = `${projectRoot}/e2e-output/junit-report/`;
@@ -171,7 +87,5 @@ async function cleanReportFolder() {
module.exports = {
uploadScreenshot: uploadScreenshot,
uploadReport: uploadReport,
cleanReportFolder: cleanReportFolder,
saveReport: saveReport
cleanReportFolder: cleanReportFolder
};

View File

@@ -12,6 +12,7 @@ const HOST_IDENTITY = process.env.URL_HOST_IDENTITY;
const TIMEOUT = parseInt(process.env.TIMEOUT, 10);
const PROXY = process.env.PROXY_HOST_ADF;
const LOG = process.env.LOG;
const BPM_HOST = process.env.URL_HOST_BPM_ADF || "bpm";
const OAUTH_HOST = process.env.URL_HOST_SSO_ADF || "keycloak";
const OAUTH_CLIENT_ID = process.env.OAUTH_CLIENDID || "alfresco";
@@ -19,11 +20,17 @@ const OAUTH_CLIENT_ID = process.env.OAUTH_CLIENDID || "alfresco";
const IDENTITY_HOST = process.env.URL_HOST_IDENTITY || "identity";
const IDENTITY_ADMIN_EMAIL = process.env.IDENTITY_ADMIN_EMAIL || "defaultadmin";
const IDENTITY_ADMIN_PASSWORD = process.env.IDENTITY_ADMIN_PASSWORD || "defaultadminpassword";
const IDENTITY_USERNAME_ADF = process.env.IDENTITY_USERNAME_ADF || "defaultuser";
const IDENTITY_PASSWORD_ADF = process.env.IDENTITY_PASSWORD_ADF;
const USERNAME_ADF = process.env.USERNAME_ADF || process.env.IDENTITY_USERNAME_ADF || "defaultuser";
const PASSWORD_ADF = process.env.PASSWORD_ADF || process.env.IDENTITY_PASSWORD_ADF || "defaultuserpassword";
const USERNAME_ADF = process.env.USERNAME_ADF || "defaultuser";
const PASSWORD_ADF = process.env.PASSWORD_ADF || "defaultuserpassword";
const EMAIL = process.env.EMAIL_ADF || USERNAME_ADF;
const SCREENSHOT_URL = process.env.SCREENSHOT_URL || process.env.URL_HOST_ADF;
const SCREENSHOT_PASSWORD = process.env.SCREENSHOT_PASSWORD || process.env.PASSWORD_ADF;
const SCREENSHOT_USERNAME = process.env.SCREENSHOT_USERNAME || process.env.USERNAME_ADF;
const appConfig = {
"bpmHost": BPM_HOST,
"identityHost": IDENTITY_HOST,
@@ -71,8 +78,8 @@ module.exports = {
},
identityUser: {
email: USERNAME_ADF,
password: PASSWORD_ADF
email: IDENTITY_USERNAME_ADF,
password: IDENTITY_PASSWORD_ADF
},
hrUser: {
@@ -80,6 +87,12 @@ module.exports = {
password: process.env.HR_USER_PASSWORD
},
screenshot: {
url: SCREENSHOT_URL,
password: SCREENSHOT_PASSWORD,
username: SCREENSHOT_USERNAME
},
adf: {
/**
* base