Try latest ACS com to see if e2e are passing (#1248)

* use latest ACS com

* add workaround for REPO-4772

* due to the workaround done for REPO-4772, files now have an initial version set to MAJOR 1.0

* add workaround for REPO-4772 for bulk create files

* Get ACS log if something goes wrong

* wait for the dialog to close only in specific cases

* Import Custom Model into ACS. Update proxy to work with Share.
This commit is contained in:
Martin Muller 2019-11-18 18:08:32 +01:00 committed by GitHub
parent fd71e2daf4
commit b228ca2f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 301 additions and 142 deletions

View File

@ -45,3 +45,8 @@ jobs:
script: npm run build.e2e && SUITE="--suite sharingContent" npm run e2e:docker
- name: Test Suite viewContent&metadata&extensions
script: npm run build.e2e && SUITE="--suite viewer,infoDrawer,extensions" npm run e2e:docker
after_failure:
- alfrescoContainerId=$(docker ps -a | grep 'alfresco-content-repository-community' | awk '{print $1}')
- docker logs $alfrescoContainerId > alfresco.log
- cat alfresco.log

View File

@ -3,7 +3,7 @@ npm run build.e2e -- --base-href ./
node -e "
const fs = require('fs');
const config = require('./dist/app/app.config.json');
config.baseShareUrl = 'http://localhost:4000/content-app/#/preview/s/';
config.baseShareUrl = 'http://localhost:8080/content-app/#/preview/s/';
fs.writeFileSync(
'./dist/app/app.config.json',
JSON.stringify(config, null, 2)

View File

@ -64,7 +64,8 @@
"denysvuika",
"submenu",
"submenus",
"dateitem"
"dateitem",
"versionable"
],
"dictionaries": ["html", "en-gb", "en_US"]
}

View File

@ -190,7 +190,7 @@ services:
- alfresco
- share
ports:
- 4000:80
- 8080:8080
auth:
image: jboss/keycloak:4.8.3.Final

View File

@ -2,10 +2,10 @@ version: '2'
services:
alfresco:
image: alfresco/alfresco-content-repository-community:6.1.2-ga
image: alfresco/alfresco-content-repository-community:latest
mem_limit: 1500m
depends_on:
- postgres
volumes:
- ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension
environment:
JAVA_OPTS: '
-Ddb.driver=org.postgresql.Driver
@ -17,51 +17,92 @@ services:
-Dsolr.secureComms=none
-Dsolr.base.url=/solr
-Dindex.subsystem.name=solr6
-Dshare.host=localhost
-Dshare.host=127.0.0.1
-Dshare.port=8080
-Dalfresco.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
-Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
-Ddeployment.method=DOCKER_COMPOSE
-Dlocal.transform.service.enabled=true
-DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
-DlocalTransform.imagemagick.url=http://imagemagick:8090/
-DlocalTransform.libreoffice.url=http://libreoffice:8090/
-DlocalTransform.tika.url=http://tika:8090/
-DlocalTransform.misc.url=http://transform-misc:8090/
-Dlegacy.transform.service.enabled=true
-Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
-Djodconverter.url=http://libreoffice:8090/
-Dimg.url=http://imagemagick:8090/
-Dtika.url=http://tika:8090/
-Dtransform.misc.url=http://transform-misc:8090/
-Dcsrf.filter.enabled=false
-Xms1g -Xmx1g
-Xms1500m -Xmx1500m
'
networks:
- internal
alfresco-pdf-renderer:
image: alfresco/alfresco-pdf-renderer:2.1.0
mem_limit: 1g
environment:
JAVA_OPTS: ' -Xms256m -Xmx512m'
ports:
- 8080:8080 #Browser port
- 8090:8090
imagemagick:
image: alfresco/alfresco-imagemagick:2.1.0
mem_limit: 1g
environment:
JAVA_OPTS: ' -Xms256m -Xmx512m'
ports:
- 8091:8090
libreoffice:
image: alfresco/alfresco-libreoffice:2.1.0
mem_limit: 1g
environment:
JAVA_OPTS: ' -Xms256m -Xmx512m'
ports:
- 8092:8090
tika:
image: alfresco/alfresco-tika:2.1.0
mem_limit: 1g
environment:
JAVA_OPTS: ' -Xms256m -Xmx512m'
ports:
- 8093:8090
transform-misc:
image: alfresco/alfresco-transform-misc:2.1.0
mem_limit: 1g
environment:
JAVA_OPTS: ' -Xms256m -Xmx512m'
ports:
- 8094:8090
share:
image: alfresco/alfresco-share:6.1.0-RC3
image: alfresco/alfresco-share:6.2.0
mem_limit: 1g
depends_on:
- alfresco
environment:
- REPO_HOST=alfresco
- REPO_PORT=8080
- 'CATALINA_OPTS= -Xms500m -Xmx500m'
networks:
- internal
ports:
- 8083:8080
postgres:
image: postgres:10.1
mem_limit: 1500m
image: postgres:11.4
mem_limit: 512m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
- POSTGRES_DB=alfresco
command: postgres -c max_connections=300 -c log_min_messages=LOG
networks:
- internal
ports:
- 5432:5432
solr6:
image: alfresco/alfresco-search-services:1.3.0-RC2
mem_limit: 2500m
depends_on:
- alfresco
image: alfresco/alfresco-search-services:1.4.0
mem_limit: 2g
environment:
#Solr needs to know how to register itself with Alfresco
- SOLR_ALFRESCO_HOST=alfresco
@ -71,17 +112,15 @@ services:
- SOLR_SOLR_PORT=8983
#Create the default alfresco and archive cores
- SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
#HTTP by default
- ALFRESCO_SECURE_COMMS=none
- 'SOLR_JAVA_MEM=-Xms2g -Xmx2g'
networks:
- internal
ports:
- 8983:8983 #Browser port
- 8083:8983 #Browser port
activemq:
image: alfresco/alfresco-activemq:5.15.6
mem_limit: 2048m
networks:
- internal
image: alfresco/alfresco-activemq:5.15.8
mem_limit: 1g
ports:
- 8161:8161 # Web Console
- 5672:5672 # AMQP
@ -93,24 +132,19 @@ services:
build: .
depends_on:
- alfresco
networks:
- internal
ports:
- 4001:8080
# volumes:
# - ./app.config.json:/usr/share/nginx/html/app.config.json
# - ./nginx.conf:/etc/nginx/conf.d/default.conf
proxy:
image: nginx:stable-alpine
image: alfresco/acs-community-ngnix:1.0.0
mem_limit: 128m
depends_on:
- content-app
- alfresco
volumes:
- ./docker/proxy/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- internal
- ./docker/proxy/nginx.conf:/etc/nginx/nginx.conf
ports:
- 4000:80
networks:
internal:
- 8080:8080
links:
- alfresco
- share
- content-app

20
docker/acs-cm/Readme.md Normal file
View File

@ -0,0 +1,20 @@
# Custom Node creation instruction
Use the v1 POST node/{nodeId}/children for creating the custom node with a payload like:
```
{
"name":"acme document2.txt",
"nodeType":"acme:document",
"properties": {
"acme:documentId": "DOC001",
"acme:securityClassification":"Public",
"cm:title":"My text"
},
"aspectNames": [
"acme:securityClassified"
]
}
```
Tip: You could use the api explorer with <host-url>/api-explorer/

View File

@ -0,0 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="acme.extension.dictionaryBootstrap"
parent="dictionaryModelBootstrap"
depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/acme-content-model.xml</value>
</list>
</property>
</bean>
</beans>

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<model name="acme:contentModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Sample Document Model</description>
<author>My Name</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
<import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
</imports>
<namespaces>
<namespace uri="http://www.acme.org/model/content/1.0" prefix="acme"/>
</namespaces>
<constraints>
<constraint name="acme:securityClassificationOptions" type="LIST">
<parameter name="allowedValues">
<list>
<value></value>
<value>Public</value>
<value>Client Confidential</value>
<value>Company Confidential</value>
<value>Strictly Confidential</value>
</list>
</parameter>
</constraint>
</constraints>
<types>
<type name="acme:document">
<title>Sample Document Type</title>
<parent>cm:content</parent>
<properties>
<property name="acme:documentId">
<title>Document Identification Number</title>
<type>d:text</type>
</property>
</properties>
<mandatory-aspects>
<aspect>acme:securityClassified</aspect>
</mandatory-aspects>
</type>
</types>
<aspects>
<aspect name="acme:securityClassified">
<title>ACME Security Classified</title>
<description>Content has been security classified</description>
<properties>
<property name="acme:securityClassification">
<type>d:text</type>
<index enabled="true">
<atomic>true</atomic>
<stored>false</stored>
<tokenised>false</tokenised>
</index>
<constraints>
<constraint ref="acme:securityClassificationOptions"/>
</constraints>
</property>
</properties>
</aspect>
</aspects>
</model>

View File

@ -1,33 +1,44 @@
server {
listen *:80;
worker_processes 1;
set $allowOriginSite *;
proxy_pass_request_headers on;
proxy_pass_header Set-Cookie;
events {
worker_connections 1024;
}
access_log off;
http {
server {
listen *:8080;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
client_max_body_size 0;
location / {
proxy_pass http://content-app:8080;
}
set $allowOriginSite *;
proxy_pass_request_headers on;
proxy_pass_header Set-Cookie;
location /alfresco/ {
proxy_pass http://alfresco:8080;
}
# External settings, do not remove
#ENV_ACCESS_LOG
location /api-explorer/ {
proxy_pass http://alfresco:8080/api-explorer;
}
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
location /share/ {
proxy_pass http://share:8080;
location / {
proxy_pass http://content-app:8080;
}
location /alfresco/ {
proxy_pass http://alfresco:8080;
}
location /api-explorer/ {
proxy_pass http://alfresco:8080/api-explorer/;
}
location /share/ {
proxy_pass http://share:8080;
}
}
}

View File

@ -91,7 +91,7 @@ services:
networks:
- internal
ports:
- 4000:80
- 8080:80
networks:
? internal
internal:

View File

@ -20,7 +20,7 @@ npm run build
npm run start:docker
```
The ACA runs on port `4000` when served from within container.
The ACA runs on port `8080` when served from within container.
Use the following command to stop all the containers:

View File

@ -7,7 +7,7 @@ nav: ja
ACA には ACS 6.0 Community 版が事前構成されています。
アプリケーションは2つのモードで実行されます:
アプリケーションは 2 つのモードで実行されます:
- Development (最新のソースコードを実行し、アプリケーションのビルドが必要)
- Preview (最新の公開されたコンテナー、マスターブランチで実行)
@ -21,7 +21,7 @@ npm run build
npm run start:docker
```
コンテナ内から提供される場合、ACA は `4000` ポートで実行されます。
コンテナ内から提供される場合、ACA は `8080` ポートで実行されます。
次のコマンドを使用して、すべてのコンテナを停止します:

View File

@ -100,7 +100,6 @@ export class UploadNewVersionDialog extends Component {
async clickUpload() {
await this.uploadButton.click();
await this.waitForDialogToClose();
}

View File

@ -52,6 +52,8 @@ describe('Upload new version', () => {
const parentFav = `parentFav-${Utils.random()}`; let parentFavId;
const parentSearch = `parentSearch-${Utils.random()}`; let parentSearchId;
const nameConflictMessage = 'New version not uploaded, another file with the same name already exists';
const file = FILES.pdfFile; let fileId;
const fileToUpload1 = FILES.docxFile;
const fileToUpload2 = FILES.xlsxFile;
@ -116,7 +118,7 @@ describe('Upload new version', () => {
});
afterEach(async (done) => {
// await Utils.pressEscape();
await Utils.pressEscape();
await page.refresh();
done();
});
@ -147,10 +149,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMajor();
await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label');
});
it('file is updated after uploading a new version - minor - [C297546]', async () => {
@ -163,10 +166,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new minor version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file is not updated when clicking Cancel - [C297547]', async () => {
@ -181,8 +185,8 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickCancel();
expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label');
});
it('upload new version fails when new file name already exists - [C297548]', async () => {
@ -196,11 +200,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await page.refresh();
const message = await page.getSnackBarMessage();
expect(message).toContain(nameConflictMessage);
expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label');
});
it('file is unlocked after uploading a new version - [C297549]', async () => {
@ -213,11 +218,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed');
expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`);
expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file remains locked after canceling of uploading a new version - [C297550]', async () => {
@ -294,10 +300,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMajor();
await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label');
});
it('file is updated after uploading a new version - minor - [C297553]', async () => {
@ -310,10 +317,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new minor version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file is not updated when clicking Cancel - [C297554]', async () => {
@ -328,8 +336,8 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickCancel();
expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label');
});
it('upload new version fails when new file name already exists - [C297555]', async () => {
@ -343,11 +351,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await page.refresh();
const message = await page.getSnackBarMessage();
expect(message).toContain(nameConflictMessage);
expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label');
});
it('file is unlocked after uploading a new version - [C297556]', async () => {
@ -360,11 +369,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed');
expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`);
expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file remains locked after canceling of uploading a new version - [C297557]', async () => {
@ -440,10 +450,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMajor();
await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload1, parentRF)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label');
});
it('file is updated after uploading a new version - minor - [C297560]', async () => {
@ -456,10 +467,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new minor version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload2, parentRF)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file is not updated when clicking Cancel - [C297561]', async () => {
@ -474,8 +486,8 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickCancel();
expect(await dataTable.isItemPresent(file3, parentRF)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label');
});
it('upload new version fails when new file name already exists - [C297562]', async () => {
@ -489,11 +501,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await page.refresh();
const message = await page.getSnackBarMessage();
expect(message).toContain(nameConflictMessage);
expect(await dataTable.isItemPresent(file4, parentRF)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label');
});
it('file is unlocked after uploading a new version - [C297563]', async () => {
@ -506,11 +519,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload4, parentRF)).toBe(true, 'File name was not changed');
expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`);
expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file remains locked after canceling of uploading a new version - [C297564]', async () => {
@ -587,10 +601,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMajor();
await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload1)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file1Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('1.0', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file1Id)).toEqual('2.0', 'File has incorrect version label');
});
it('file is updated after uploading a new version - minor - [C297567]', async () => {
@ -603,10 +618,11 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new minor version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload2)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(file2Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(file2Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file is not updated when clicking Cancel - [C297568]', async () => {
@ -621,8 +637,8 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickCancel();
expect(await dataTable.isItemPresent(file3)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file3Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file3Id)).toEqual('1.0', 'File has incorrect version label');
});
it('upload new version fails when new file name already exists - [C297569]', async () => {
@ -636,11 +652,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await page.refresh();
const message = await page.getSnackBarMessage();
expect(message).toContain(nameConflictMessage);
expect(await dataTable.isItemPresent(file4)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(file4Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(file4Id)).toEqual('1.0', 'File has incorrect version label');
});
it('file is unlocked after uploading a new version - [C297570]', async () => {
@ -653,11 +670,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
expect(await dataTable.isItemPresent(fileToUpload4)).toBe(true, 'File name was not changed');
expect(await apis.user.nodes.isFileLockedWrite(fileLocked1Id)).toBe(false, `${fileLocked1} is still locked`);
expect(await apis.user.nodes.getFileVersionType(fileLocked1Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileLocked1Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file remains locked after canceling of uploading a new version - [C297571]', async () => {
@ -738,11 +756,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMajor();
await uploadNewVersionDialog.enterDescription('new major version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
// TODO: enable when ACA-2329 is fixed
// expect(await dataTable.isItemPresent(fileToUpload1, parentSearch)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(fileSearch1Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch1Id)).toEqual('1.0', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch1Id)).toEqual('2.0', 'File has incorrect version label');
});
it('file is updated after uploading a new version - minor - [C307005]', async () => {
@ -759,11 +778,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new minor version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
// TODO: enable when ACA-2329 is fixed
// expect(await dataTable.isItemPresent(fileToUpload2, parentSearch)).toBe(true, 'File not updated');
expect(await apis.user.nodes.getFileVersionType(fileSearch2Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch2Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch2Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file is not updated when clicking Cancel - [C307006]', async () => {
@ -782,8 +802,8 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickCancel();
expect(await dataTable.isItemPresent(fileSearch3, parentSearch)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(fileSearch3Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch3Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(fileSearch3Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch3Id)).toEqual('1.0', 'File has incorrect version label');
});
it('upload new version fails when new file name already exists - [C307007]', async () => {
@ -801,11 +821,12 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await page.refresh();
const message = await page.getSnackBarMessage();
expect(message).toContain(nameConflictMessage);
expect(await dataTable.isItemPresent(fileSearch4, parentSearch)).toBe(true, 'File was updated');
expect(await apis.user.nodes.getFileVersionType(fileSearch4Id)).toEqual('', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch4Id)).toEqual('', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionType(fileSearch4Id)).toEqual('MAJOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileSearch4Id)).toEqual('1.0', 'File has incorrect version label');
});
it('file is unlocked after uploading a new version - [C307008]', async () => {
@ -822,12 +843,13 @@ describe('Upload new version', () => {
await uploadNewVersionDialog.clickMinor();
await uploadNewVersionDialog.enterDescription('new version description');
await uploadNewVersionDialog.clickUpload();
await uploadNewVersionDialog.waitForDialogToClose();
// TODO: enable when ACA-2329 is fixed
// expect(await dataTable.isItemPresent(fileToUpload4, parentSearch)).toBe(true, 'File name was not changed');
expect(await apis.user.nodes.isFileLockedWrite(fileLockedSearch1Id)).toBe(false, `${fileLockedSearch1} is still locked`);
expect(await apis.user.nodes.getFileVersionType(fileLockedSearch1Id)).toEqual('MINOR', 'File has incorrect version type');
expect(await apis.user.nodes.getFileVersionLabel(fileLockedSearch1Id)).toEqual('0.1', 'File has incorrect version label');
expect(await apis.user.nodes.getFileVersionLabel(fileLockedSearch1Id)).toEqual('1.1', 'File has incorrect version label');
});
it('file remains locked after canceling of uploading a new version - [C307009]', async () => {

View File

@ -33,6 +33,7 @@ export class NodeBodyCreate {
public name: string,
public nodeType: string,
public relativePath: string = '/',
public aspectNames?: string[], // workaround for REPO-4772
public properties?: any[]
) {}
}

View File

@ -35,6 +35,7 @@ export interface NodeContentTree {
export function flattenNodeContentTree(content: NodeContentTree, relativePath: string = '/'): NodeBodyCreate[] {
const { name, files, folders, title, description } = content;
const aspectNames: string[] = ['cm:versionable'];
let data: NodeBodyCreate[] = [];
let properties: any;
@ -75,7 +76,8 @@ export function flattenNodeContentTree(content: NodeContentTree, relativePath: s
.map((filename: string): NodeBodyCreate => ({
nodeType: NODE_TYPE_FILE,
name: filename,
relativePath
relativePath,
aspectNames
}));
data = data.concat(filesData);

View File

@ -222,7 +222,8 @@ export class NodesApi extends RepoApi {
'cm:title': title,
'cm:description': description,
'cm:author': author
}
},
aspectNames: ['cm:versionable'] // workaround for REPO-4772
};
if (imageProps) {
nodeBody.properties = Object.assign(nodeBody.properties, imageProps);

View File

@ -17,9 +17,9 @@
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
"wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME",
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:4000} $SUITE",
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080} $SUITE",
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
"wait:app": "wait-on http://localhost:8080 && wait-on http://localhost:4000",
"wait:app": "wait-on http://localhost:8080/alfresco/ -t 1000000 && wait-on http://localhost:8080 -t 400000",
"start:docker": "docker-compose up -d --build && npm run wait:app",
"stop:docker": "docker-compose stop",
"e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker",
@ -29,7 +29,7 @@
"format:fix": "prettier --write \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
"build.tomcat": "npm run build.shared && npm run build.extensions && npm run build.app -- --prod --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .",
"build.tomcat.e2e": "./build-tomcat-e2e.sh",
"e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/ $SUITE",
"e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:8080/content-app/ $SUITE",
"docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app",
"docker.tomcat.stop": "cd docker/tomcat && docker-compose stop",
"docker.tomcat.e2e": "npm run docker.tomcat.start && npm run e2e.tomcat"

View File

@ -120,7 +120,7 @@ exports.config = {
directConnect: true,
// baseUrl: 'http://localhost:4000',
// baseUrl: 'http://localhost:8080',
getPageTimeout: 50000,
framework: 'jasmine',

View File

@ -85,18 +85,6 @@ describe('InfoDrawerComponent', () => {
);
});
it('should set displayNode when node is from personal list', () => {
spyOn(contentApiService, 'getNodeInfo');
const nodeMock = <any>{ entry: { id: 'nodeId', aspectNames: [] } };
component.node = nodeMock;
fixture.detectChanges();
component.ngOnChanges();
expect(component.displayNode).toBe(nodeMock.entry);
expect(contentApiService.getNodeInfo).not.toHaveBeenCalled();
});
it('should set displayNode when node is library', async(() => {
spyOn(contentApiService, 'getNodeInfo');
const nodeMock = <any>{

View File

@ -71,12 +71,8 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
const entry: any = this.node.entry;
if (!entry.aspectNames) {
const id = entry.nodeId || entry.id;
return this.loadNodeInfo(id);
}
this.setDisplayNode(entry);
const id = entry.nodeId || entry.id;
return this.loadNodeInfo(id);
}
}

View File

@ -1,5 +1,5 @@
export HOST_IP=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
export APP_URL="http://${HOST_IP}:4000"
export APP_URL="http://${HOST_IP}:8080"
export APP_CONFIG_AUTH_TYPE="OAUTH"
export APP_CONFIG_OAUTH2_HOST="http://${HOST_IP}:8085/auth/realms/alfresco"