mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-2387] rebalance suites (#1107)
* rebalance suites * try to fix flaky test * fix more related tests * fix retry * reorganise some more suites * move file to another suite
This commit is contained in:
parent
39f528af67
commit
1c18f6c555
35
.travis.yml
35
.travis.yml
@ -36,26 +36,15 @@ jobs:
|
||||
- name: 'Prepare dist cache'
|
||||
script: npm run build.e2e
|
||||
- stage: e2e
|
||||
name: Test Suite authentication
|
||||
script: SUITE="--suite authentication" npm run e2e:docker
|
||||
- name: Test Suite listViews
|
||||
script: SUITE="--suite listViews" npm run e2e:docker
|
||||
- name: Test Suite application
|
||||
script: SUITE="--suite application" npm run e2e:docker
|
||||
- name: Test Suite navigation
|
||||
script: SUITE="--suite navigation" npm run e2e:docker
|
||||
- name: Test Suite pagination
|
||||
script: SUITE="--suite pagination" npm run e2e:docker
|
||||
- name: Test Suite search
|
||||
script: SUITE="--suite search" npm run e2e:docker
|
||||
- name: Test Suite actionsAvailable
|
||||
script: SUITE="--suite actionsAvailable" npm run e2e:docker
|
||||
- stage: e2e
|
||||
name: Test Suite actions
|
||||
script: SUITE="--suite actions" npm run e2e:docker
|
||||
- name: Test Suite viewer
|
||||
script: SUITE="--suite viewer" npm run e2e:docker
|
||||
- name: Test Suite infoDrawer
|
||||
script: SUITE="--suite infoDrawer" npm run e2e:docker
|
||||
- name: Test Suite extensions
|
||||
script: SUITE="--suite extensions" npm run e2e:docker
|
||||
name: Test Suite appNavigation
|
||||
script: SUITE="--suite authentication,listViews,navigation,application,pagination" npm run e2e:docker
|
||||
- name: Test Suite search&actionsAvailable
|
||||
script: SUITE="--suite search,actionsAvailable" npm run e2e:docker
|
||||
- name: Test Suite addRemoveContent
|
||||
script: SUITE="--suite addRemoveContent" npm run e2e:docker
|
||||
- name: Test Suite manageContent
|
||||
script: SUITE="--suite manageContent" npm run e2e:docker
|
||||
- name: Test Suite sharingContent&markFavorite
|
||||
script: SUITE="--suite sharingContent" npm run e2e:docker
|
||||
- name: Test Suite viewContent&metadata&extensions
|
||||
script: SUITE="--suite viewer,infoDrawer,extensions" npm run e2e:docker
|
||||
|
@ -264,7 +264,6 @@ describe('Upload new version', () => {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
// await Utils.pressEscape();
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
@ -411,7 +410,6 @@ describe('Upload new version', () => {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
// await Utils.pressEscape();
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
@ -559,7 +557,6 @@ describe('Upload new version', () => {
|
||||
});
|
||||
|
||||
afterEach(async (done) => {
|
||||
// await Utils.pressEscape();
|
||||
await page.refresh();
|
||||
done();
|
||||
});
|
||||
|
@ -251,7 +251,7 @@ describe('Viewer actions', () => {
|
||||
await viewer.waitForViewerToOpen();
|
||||
await toolbar.clickMoreActionsCancelEditing();
|
||||
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open');
|
||||
});
|
||||
|
||||
@ -506,7 +506,7 @@ describe('Viewer actions', () => {
|
||||
await viewer.waitForViewerToOpen();
|
||||
await toolbar.clickMoreActionsCancelEditing();
|
||||
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open');
|
||||
});
|
||||
|
||||
@ -739,7 +739,7 @@ describe('Viewer actions', () => {
|
||||
await viewer.waitForViewerToOpen();
|
||||
await toolbar.clickMoreActionsCancelEditing();
|
||||
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open');
|
||||
});
|
||||
|
||||
@ -971,7 +971,7 @@ describe('Viewer actions', () => {
|
||||
await viewer.waitForViewerToOpen();
|
||||
await toolbar.clickMoreActionsCancelEditing();
|
||||
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open');
|
||||
});
|
||||
|
||||
@ -1205,7 +1205,7 @@ describe('Viewer actions', () => {
|
||||
await viewer.waitForViewerToOpen();
|
||||
await toolbar.clickMoreActionsCancelEditing();
|
||||
|
||||
expect(await apis.user.nodes.isFileLockedWrite(fileForCancelEditingId)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await apis.user.nodes.isFileLockedWriteWithRetry(fileForCancelEditingId, false)).toBe(false, `${fileForCancelEditing} is still locked`);
|
||||
expect(await viewer.isViewerOpened()).toBe(true, 'Viewer is not open');
|
||||
});
|
||||
|
||||
|
@ -27,6 +27,7 @@ import { RepoApi } from '../repo-api';
|
||||
import { NodeBodyCreate } from './node-body-create';
|
||||
import { NodeContentTree, flattenNodeContentTree } from './node-content-tree';
|
||||
import { NodesApi as AdfNodeApi, NodeBodyLock} from '@alfresco/js-api';
|
||||
import { Utils } from '../../../../utilities/utils';
|
||||
|
||||
export class NodesApi extends RepoApi {
|
||||
nodesApi = new AdfNodeApi(this.alfrescoJsApi);
|
||||
@ -264,6 +265,28 @@ export class NodesApi extends RepoApi {
|
||||
return (await this.getLockType(nodeId)) === 'WRITE_LOCK';
|
||||
}
|
||||
|
||||
async isFileLockedWriteWithRetry(nodeId: string, expect: boolean) {
|
||||
const data = {
|
||||
expect: expect,
|
||||
retry: 5
|
||||
};
|
||||
let isLocked;
|
||||
try {
|
||||
const locked = async () => {
|
||||
isLocked = (await this.getLockType(nodeId)) === 'WRITE_LOCK';
|
||||
if ( isLocked !== data.expect ) {
|
||||
return Promise.reject(isLocked);
|
||||
} else {
|
||||
return Promise.resolve(isLocked);
|
||||
}
|
||||
}
|
||||
return await Utils.retryCall(locked, data.retry);
|
||||
} catch (error) {
|
||||
console.log('-----> catch isLockedWriteWithRetry: ', error);
|
||||
}
|
||||
return isLocked;
|
||||
}
|
||||
|
||||
async isFileLockedByName(fileName: string, parentId: string) {
|
||||
const id = await this.getNodeIdFromParent(fileName, parentId);
|
||||
return await this.isFileLockedWrite(id);
|
||||
|
@ -58,7 +58,30 @@ exports.config = {
|
||||
pagination: './e2e/suites/pagination/*.test.ts',
|
||||
search: './e2e/suites/search/*.test.ts',
|
||||
actionsAvailable: './e2e/suites/actions-available/*.test.ts',
|
||||
actions: './e2e/suites/actions/*.test.ts',
|
||||
addRemoveContent: [
|
||||
'./e2e/suites/actions/new-menu.test.ts',
|
||||
'./e2e/suites/actions/create-folder.test.ts',
|
||||
'./e2e/suites/actions/create-library.test.ts',
|
||||
'./e2e/suites/actions/upload-file.test.ts',
|
||||
'./e2e/suites/actions/upload-new-version.test.ts',
|
||||
'./e2e/suites/actions/delete-undo-delete.test.ts',
|
||||
'./e2e/suites/actions/permanently-delete.test.ts',
|
||||
'./e2e/suites/actions/restore.test.ts',
|
||||
'./e2e/suites/actions/download.test.ts'
|
||||
],
|
||||
manageContent: [
|
||||
'./e2e/suites/actions/copy.test.ts',
|
||||
'./e2e/suites/actions/move.test.ts',
|
||||
'./e2e/suites/actions/library-actions.test.ts',
|
||||
'./e2e/suites/actions/edit-folder.test.ts',
|
||||
'./e2e/suites/actions/edit-offline.test.ts'
|
||||
],
|
||||
sharingContent: [
|
||||
'./e2e/suites/actions/mark-favorite.test.ts',
|
||||
'./e2e/suites/actions/share-file.test.ts',
|
||||
'./e2e/suites/actions/unshare-file-search-results.test.ts',
|
||||
'./e2e/suites/actions/unshare-file.test.ts'
|
||||
],
|
||||
viewer: './e2e/suites/viewer/*.test.ts',
|
||||
infoDrawer: './e2e/suites/info-drawer/*.test.ts',
|
||||
extensions: './e2e/suites/extensions/*.test.ts'
|
||||
|
Loading…
x
Reference in New Issue
Block a user