* fix e2e

* Update notifications-component.e2e.ts

* fix e2e

* fix e2e

* try with interval

* Update version-actions.e2e.ts
This commit is contained in:
Eugenio Romano 2020-05-12 10:04:55 +01:00 committed by GitHub
parent 27fd18c40e
commit f72f82ed4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 24 additions and 23 deletions

View File

@ -14,9 +14,7 @@ COPY demo-shell/dist/ .
RUN addgroup -g ${GROUPID} ${GROUPNAME} && \
adduser -S -u ${USERID} -G ${GROUPNAME} -s "/bin/bash" ${USERNAME} && \
chown -R ${USERNAME}:${GROUPNAME} ./**/app.config.json && \
chown -R ${USERNAME}:${GROUPNAME} ./app.config.json && \
chown -R ${USERNAME}:${GROUPNAME} /var/cache/nginx && \
chown -R ${USERNAME}:${GROUPNAME} ./**/app.config.json, ./app.config.json /var/cache/nginx || \
touch /var/run/nginx.pid && \
chown -R ${USERNAME}:${GROUPNAME} /var/run/nginx.pid && \
chmod +x /entrypoint.sh && \

View File

@ -18,7 +18,7 @@
import { ContentServicesPage } from '../../pages/adf/content-services.page';
import { AcsUserModel } from '../../models/ACS/acs-user.model';
import { FileModel } from '../../models/ACS/file.model';
import { LoginPage, UploadActions, PaginationPage, StringUtil, PermissionActions } from '@alfresco/adf-testing';
import { BrowserActions, LoginPage, UploadActions, PaginationPage, StringUtil, PermissionActions } from '@alfresco/adf-testing';
import { browser } from 'protractor';
import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api';
import { FolderModel } from '../../models/ACS/folder.model';
@ -114,7 +114,7 @@ describe('Delete Directive', () => {
await uploadActions.createFolder(folderSecond.name, baseFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.get(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await contentServicesPage.waitForTableBody();
});
@ -188,7 +188,7 @@ describe('Delete Directive', () => {
await uploadActions.uploadFile(secondPngFileModel.location, secondPngFileModel.name, baseFolderUploaded.entry.id);
await loginPage.loginToContentServicesUsingUserModel(acsUser);
await browser.get(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${baseFolderUploaded.entry.id}`);
await contentServicesPage.waitForTableBody();
});
@ -240,7 +240,7 @@ describe('Delete Directive', () => {
await permissionActions.disableInheritedPermissionsForNode(filePdf.entry.id);
await loginPage.loginToContentServicesUsingUserModel(secondAcsUser);
await browser.get(`${browser.baseUrl}/files/${createdSite.entry.guid}`);
await BrowserActions.getUrl(`${browser.baseUrl}/files/${createdSite.entry.guid}`);
await contentServicesPage.waitForTableBody();
});

View File

@ -92,7 +92,7 @@ describe('Notifications Component', () => {
await notificationPage.enterDurationField(1000);
await notificationPage.clickNotificationButton();
await notificationPage.checkNotificationSnackBarIsDisplayed();
await browser.sleep(1500);
await browser.sleep(2000);
await notificationPage.checkNotificationSnackBarIsNotDisplayed();
});

View File

@ -73,7 +73,7 @@ describe('Upload component', async () => {
};
it('[C272792] Should be possible to cancel upload of a big file using row cancel icon', async () => {
await browser.executeScript(`setTimeout(() => {document.querySelector('div[data-automation-id="cancel-upload-progress"]').click();}, 2500)`);
await browser.executeScript(`setInterval(() => {document.querySelector('div[data-automation-id="cancel-upload-progress"]').click();}, 500)`);
await contentServicesPage.uploadFile(mediumFile.location);
@ -84,8 +84,8 @@ describe('Upload component', async () => {
});
it('[C287790] Should be possible to cancel upload of a big file through the cancel uploads button', async () => {
await browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 2500)');
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await contentServicesPage.uploadFile(largeFile.location);
await expect(await uploadDialog.getTitleText()).toEqual('Upload canceled');
@ -97,8 +97,8 @@ describe('Upload component', async () => {
it('[C272793] Should be able to cancel multiple files upload', async () => {
await uploadToggles.enableMultipleFileUpload();
await browser.executeScript(' setTimeout(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 2500)');
await browser.executeScript(' setInterval(() => {document.querySelector("#adf-upload-dialog-cancel-all").click();' +
'document.querySelector("#adf-upload-dialog-cancel").click(); }, 500)');
await contentServicesPage.uploadMultipleFile([mediumFile.location, largeFile.location]);
@ -113,7 +113,7 @@ describe('Upload component', async () => {
it('[C315257] Should be able to cancel file in upload queue', async () => {
await uploadToggles.enableMultipleFileUpload();
await browser.executeScript(`setTimeout(() => {document.querySelector('button[data-automation-id="cancel-upload-queue"]').click();}, 2500)`);
await browser.executeScript(`setInterval(() => {document.querySelector('button[data-automation-id="cancel-upload-queue"]').click();}, 500)`);
await contentServicesPage.uploadMultipleFile([mediumFile.location, pngFile.location]);
await uploadDialog.fileIsCancelled(pngFile.name);

View File

@ -149,10 +149,10 @@ describe('Version component actions', () => {
it('[C307033] Should be possible to cancel the upload of a new version', async () => {
await browser.refresh();
await contentServicesPage.versionManagerContent(txtFileModel.name);
await browser.executeScript(' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
await BrowserActions.click(versionManagePage.showNewVersionButton);
await browser.executeScript(' setTimeout(() => {document.querySelector("div[data-automation-id=\'cancel-upload-progress\']").click();}, 1000)');
await versionManagePage.uploadNewVersionFile(bigFileToCancel.location);
await versionManagePage.closeVersionDialog();

View File

@ -102,7 +102,7 @@ export class UploadDialogPage {
async fileIsCancelled(content): Promise<void> {
const row = await this.getRowByRowName(content);
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon));
await BrowserVisibility.waitUntilElementIsVisible(row.element(this.cancelledStatusIcon), 10000);
}
async removeUploadedFile(content): Promise<void> {

View File

@ -54,7 +54,7 @@ export class LoginPage {
sidenavLayout = element(by.css(`[data-automation-id="sidenav-layout"]`));
async goToLoginPage(): Promise<void> {
await browser.get(this.loginURL);
await BrowserActions.getUrl(this.loginURL);
await this.waitForElements();
}

View File

@ -47,8 +47,8 @@ export class BrowserActions {
await BrowserVisibility.waitUntilElementIsNotVisible(actionMenu);
}
static async getUrl(url: string): Promise<any> {
return browser.get(url);
static async getUrl(url: string, timeout: number = 10000): Promise<any> {
return browser.get(url, timeout);
}
static async clickExecuteScript(elementCssSelector: string): Promise<void> {

View File

@ -88,7 +88,7 @@ export class StartProcessCloudPage {
async checkStartProcessButtonIsEnabled(): Promise<boolean> {
await browser.sleep(1000); // waiting for API response
await BrowserVisibility.waitUntilElementIsPresent(this.startProcessButton);
await BrowserVisibility.waitUntilElementIsVisible(this.startProcessButton);
return this.startProcessButton.isEnabled();
}

View File

@ -41,7 +41,7 @@
"start:dist": "ng lint dist && npm run validate-config && ng serve dist --prod --open",
"build": "npm run validate-config && ng build dist",
"build:dev": "npm run validate-config && npm run style:dev && ng build dev",
"build:dist": "npm run validate-config && node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build dist --prod --base-href .",
"build:dist": "npm run validate-config && node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build dist --prod",
"build:dist:stats": "npm run validate-config && node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build dist --prod --stats-json",
"build:dist:e2e": "npm run validate-config && node --max-old-space-size=12000 node_modules/@angular/cli/bin/ng build dist --prod --configuration=e2e --stats-json ",
"style:dev": "npm run webpack -- --config ./lib/config/webpack.style.js --progress --profile --bail",

View File

@ -9,7 +9,7 @@ const configPath = './demo-shell/dist/app.config.json';
fs.readFile(configPath, (err, appConfigString) => {
if (err) throw err;
let appConfig = JSON.parse(appConfigString);
appConfig.providers = process.env.PROVIDERS;
appConfig.providers = process.env.PROVIDERS || 'ALL';
appConfig.bpmHost = (process.env.PROXY_HOST_ADF || process.env.URL_HOST_BPM_ADF || process.env.URL_HOST_ADF);
appConfig.ecmHost = (process.env.PROXY_HOST_ADF || process.env.URL_HOST_ADF);
appConfig.identityHost = process.env.URL_HOST_IDENTITY;

View File

@ -10,6 +10,9 @@ echo "Running the docker with tag" $TAG_VERSION
# Publish Image to docker
sed s%href=\".\"%href=\".\"%g \
-i ./demo-shell/dist/index.html
mkdir "./demo-shell/tmp/"
mv ./demo-shell/dist/* ./demo-shell/tmp