mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
e2e api enhancements (part 1) (#1727)
* add typings, deprecate username wrapper * improve imports * unify admin actions for people * remove auth api wrapper * remove unused apis * remove unused apis * use admin api actions everywhere
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Copy content', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -100,7 +100,6 @@ describe('Copy content', () => {
|
||||
let destinationId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -109,9 +108,10 @@ describe('Copy content', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const copyDialog = new ContentNodeSelectorDialog();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
const initialSharedTotalItems = await apis.user.shared.getSharedLinksTotalItems();
|
||||
const initialFavoritesTotalItems = await apis.user.favorites.getFavoritesTotalItems();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, ContentNodeSelectorDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Move content', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -55,7 +55,6 @@ describe('Move content', () => {
|
||||
const folderSiteFav = `folderSiteFavorites-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -63,9 +62,10 @@ describe('Move content', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const moveDialog = new ContentNodeSelectorDialog();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.user.sites.createSite(siteName);
|
||||
const docLibId = await apis.user.sites.getDocLibId(siteName);
|
||||
|
||||
@@ -23,7 +23,15 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, CreateOrEditFolderDialog, Utils, clearTextWithBackspace, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
CreateOrEditFolderDialog,
|
||||
Utils,
|
||||
clearTextWithBackspace,
|
||||
RepoClient
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Create folder', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -43,7 +51,6 @@ describe('Create folder', () => {
|
||||
let docLibUserSite: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -51,9 +58,10 @@ describe('Create folder', () => {
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFolder(duplicateFolderName, parentId);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, CreateLibraryDialog, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, LoginPage, BrowsingPage, CreateLibraryDialog, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Create library', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -49,7 +49,6 @@ describe('Create library', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -57,9 +56,10 @@ describe('Create library', () => {
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateLibraryDialog();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
await apis.user.sites.createSite(duplicateSite.name, SITE_VISIBILITY.PRIVATE, '', duplicateSite.id);
|
||||
await apis.user.sites.createSite(siteInTrash.name, SITE_VISIBILITY.PUBLIC, '', siteInTrash.id);
|
||||
await apis.user.sites.deleteSite(siteInTrash.id, false);
|
||||
|
||||
@@ -23,22 +23,22 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Delete and undo delete', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Download', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -63,7 +63,6 @@ describe('Download', () => {
|
||||
const archiveZip = 'archive.zip';
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -77,8 +76,10 @@ describe('Download', () => {
|
||||
let initialFavoritesTotalItems: number;
|
||||
let initialRecentTotalItems: number;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
initialRecentTotalItems = await apis.user.search.getTotalItems(username);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
@@ -71,7 +72,6 @@ describe('Edit folder', () => {
|
||||
const folderSearchDuplicate = `folder-search-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -81,13 +81,15 @@ describe('Edit folder', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await apis.admin.nodes.createFolder(folderName, docLibId);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
beforeAll(async (done) => {
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
|
||||
await adminApiActions.nodes.createFolder(folderName, docLibId);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFolder(folderName, parentId, '', folderDescription);
|
||||
@@ -121,7 +123,7 @@ describe('Edit folder', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(sitePrivate),
|
||||
adminApiActions.sites.deleteSite(sitePrivate),
|
||||
apis.user.sites.deleteSite(siteName),
|
||||
apis.user.nodes.deleteNodesById([parentId, folderFavoriteToEditId, folderFavoriteDuplicateId, folderSearchToEditId])
|
||||
]);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Edit offline', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -54,7 +54,6 @@ describe('Edit offline', () => {
|
||||
let parentSearchId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -63,8 +62,10 @@ describe('Edit offline', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
});
|
||||
|
||||
describe('on Personal Files', () => {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, ConfirmDialog, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, ConfirmDialog, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Library actions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -54,7 +54,6 @@ describe('Library actions', () => {
|
||||
const siteSearchForDelete = `site-public-search-5-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -64,16 +63,17 @@ describe('Library actions', () => {
|
||||
const { searchInput } = page.header;
|
||||
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.admin.sites.createSite(siteSearchPublic1Admin);
|
||||
await apis.admin.sites.createSite(siteSearchPublic2Admin);
|
||||
await apis.admin.sites.createSite(siteSearchPublic3Admin);
|
||||
await apis.admin.sites.createSite(siteSearchPublic4Admin);
|
||||
await apis.admin.sites.createSite(siteSearchModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.admin.sites.createSite(siteSearchModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
await adminApiActions.sites.createSite(siteSearchPublic1Admin);
|
||||
await adminApiActions.sites.createSite(siteSearchPublic2Admin);
|
||||
await adminApiActions.sites.createSite(siteSearchPublic3Admin);
|
||||
await adminApiActions.sites.createSite(siteSearchPublic4Admin);
|
||||
await adminApiActions.sites.createSite(siteSearchModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await adminApiActions.sites.createSite(siteSearchModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.sites.createSite(siteSearchForDelete);
|
||||
|
||||
await apis.user.queries.waitForSites('site-public-search', { expect: 5 });
|
||||
@@ -95,7 +95,7 @@ describe('Library actions', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apis.admin.sites.deleteSites([
|
||||
await adminApiActions.sites.deleteSites([
|
||||
sitePublic1Admin,
|
||||
siteSearchPublic1Admin,
|
||||
sitePublic2Admin,
|
||||
@@ -106,7 +106,7 @@ describe('Library actions', () => {
|
||||
sitePublic7Admin,
|
||||
sitePublic8Admin
|
||||
]);
|
||||
await apis.admin.sites.deleteSites([
|
||||
await adminApiActions.sites.deleteSites([
|
||||
siteSearchPublic2Admin,
|
||||
siteSearchPublic3Admin,
|
||||
siteSearchPublic4Admin,
|
||||
@@ -121,7 +121,7 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Join a public library', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic1Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic1Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic1Admin);
|
||||
done();
|
||||
});
|
||||
@@ -149,7 +149,7 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Join a moderated library', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await adminApiActions.sites.createSite(siteModerated1Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated1Admin);
|
||||
await apis.user.queries.waitForSites(siteSearchModerated1Admin, { expect: 1 });
|
||||
done();
|
||||
@@ -182,17 +182,17 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Leave a library', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic2Admin);
|
||||
await apis.admin.sites.createSite(sitePublic3Admin);
|
||||
await apis.admin.sites.createSite(sitePublic4Admin);
|
||||
await apis.admin.sites.createSite(sitePublic5Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic2Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic3Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic4Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic5Admin);
|
||||
await apis.user.sites.createSite(sitePublicUser);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic3Admin);
|
||||
await apis.admin.sites.addSiteMember(sitePublic2Admin, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic3Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(siteSearchPublic2Admin, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic5Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic2Admin, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic3Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(siteSearchPublic2Admin, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic5Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.user.queries.waitForSites(siteSearchPublic2Admin, { expect: 1 });
|
||||
done();
|
||||
});
|
||||
@@ -271,7 +271,7 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Cancel join', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
await adminApiActions.sites.createSite(siteModerated2Admin, SITE_VISIBILITY.MODERATED);
|
||||
await apis.user.favorites.addFavoriteById('site', siteModerated2Admin);
|
||||
await apis.user.sites.requestToJoin(siteModerated2Admin);
|
||||
await apis.user.sites.requestToJoin(siteSearchModerated2Admin);
|
||||
@@ -308,8 +308,8 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Mark library as favorite', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic6Admin);
|
||||
await apis.admin.sites.addSiteMember(sitePublic6Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.createSite(sitePublic6Admin);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic6Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.user.queries.waitForSites(siteSearchPublic3Admin, { expect: 1 });
|
||||
done();
|
||||
});
|
||||
@@ -340,14 +340,14 @@ describe('Library actions', () => {
|
||||
|
||||
describe('Remove library from favorites', () => {
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePublic7Admin);
|
||||
await apis.admin.sites.createSite(sitePublic8Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic7Admin);
|
||||
await adminApiActions.sites.createSite(sitePublic8Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic7Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', sitePublic8Admin);
|
||||
await apis.user.favorites.addFavoriteById('site', siteSearchPublic4Admin);
|
||||
await apis.admin.sites.addSiteMember(sitePublic7Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(sitePublic8Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(siteSearchPublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic7Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePublic8Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(siteSearchPublic4Admin, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.user.queries.waitForSites(siteSearchPublic4Admin, { expect: 1 });
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Mark items as favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -74,7 +74,6 @@ describe('Mark items as favorites', () => {
|
||||
let folderSearchId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -83,8 +82,10 @@ describe('Mark items as favorites', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const { searchInput } = page.header;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SITE_ROLES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SITE_ROLES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('New menu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -32,7 +32,6 @@ describe('New menu', () => {
|
||||
const siteAdmin = `site-admin-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -41,10 +40,12 @@ describe('New menu', () => {
|
||||
const { dataTable, sidenav } = page;
|
||||
const { menu } = sidenav;
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteAdmin);
|
||||
await apis.admin.sites.addSiteMember(siteAdmin, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.createUser({ username });
|
||||
await adminApiActions.sites.createSite(siteAdmin);
|
||||
await adminApiActions.sites.addSiteMember(siteAdmin, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await apis.user.sites.createSite(siteUser);
|
||||
|
||||
@@ -54,7 +55,7 @@ describe('New menu', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.sites.deleteSite(siteUser);
|
||||
await apis.admin.sites.deleteSite(siteAdmin);
|
||||
await adminApiActions.sites.deleteSite(siteAdmin);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, ConfirmDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, ConfirmDialog, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Permanently delete from Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -40,7 +40,6 @@ describe('Permanently delete from Trash', () => {
|
||||
const site = `site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -49,9 +48,10 @@ describe('Permanently delete from Trash', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
filesIds = (await apis.user.nodes.createFiles([file1, file2, file3])).list.entries.map((entries: any) => entries.entry.id);
|
||||
foldersIds = (await apis.user.nodes.createFolders([folder1, folder2])).list.entries.map((entries: any) => entries.entry.id);
|
||||
await apis.user.sites.createSite(site);
|
||||
|
||||
@@ -24,22 +24,22 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage, BrowsingPage, APP_ROUTES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, APP_ROUTES, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Restore from Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, toolbar } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, ShareDialog, Viewer, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, RepoClient, ShareDialog, Viewer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Share a file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -56,12 +56,13 @@ describe('Share a file', () => {
|
||||
const shareLinkPreUrl = `/#/preview/s/`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
done();
|
||||
});
|
||||
@@ -330,7 +331,7 @@ describe('Share a file', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.shared.waitForApi({ expect: initialTotalItems });
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
@@ -59,7 +60,6 @@ describe('Unshare a file from Search Results', () => {
|
||||
let fileSite2Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -71,9 +71,10 @@ describe('Unshare a file from Search Results', () => {
|
||||
const contextMenu = dataTable.menu;
|
||||
const viewer = new Viewer();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
const initialSearchByTermTotalItems = await apis.user.search.getSearchByTermTotalItems('search-file');
|
||||
@@ -88,15 +89,15 @@ describe('Unshare a file from Search Results', () => {
|
||||
await apis.user.shared.shareFileById(file3Id);
|
||||
await apis.user.shared.shareFileById(file4Id);
|
||||
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
|
||||
|
||||
fileSite1Id = (await apis.admin.nodes.createFile(fileSite1, docLibId)).entry.id;
|
||||
fileSite2Id = (await apis.admin.nodes.createFile(fileSite2, docLibId)).entry.id;
|
||||
fileSite1Id = (await adminApiActions.nodes.createFile(fileSite1, docLibId)).entry.id;
|
||||
fileSite2Id = (await adminApiActions.nodes.createFile(fileSite2, docLibId)).entry.id;
|
||||
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await apis.admin.shared.shareFileById(fileSite1Id);
|
||||
await adminApiActions.shared.shareFileById(fileSite1Id);
|
||||
await apis.user.shared.shareFileById(fileSite2Id);
|
||||
|
||||
await apis.user.shared.waitForApi({ expect: initialSharedTotalItems + 6 });
|
||||
@@ -108,7 +109,7 @@ describe('Unshare a file from Search Results', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await adminApiActions.sites.deleteSite(sitePrivate);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SITE_VISIBILITY,
|
||||
@@ -43,7 +44,6 @@ describe('Unshare a file', () => {
|
||||
let parentId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -54,9 +54,10 @@ describe('Unshare a file', () => {
|
||||
const confirmDialog = new ConfirmDialog();
|
||||
const contextMenu = dataTable.menu;
|
||||
const viewer = new Viewer();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
@@ -236,7 +237,7 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.shared.waitForApi({ expect: initialSharedTotalItems });
|
||||
done();
|
||||
});
|
||||
@@ -695,24 +696,24 @@ describe('Unshare a file', () => {
|
||||
let file2FavId: string;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
|
||||
|
||||
file1FileLibId = (await apis.admin.nodes.createFile(file1FileLib, docLibId)).entry.id;
|
||||
file2FileLibId = (await apis.admin.nodes.createFile(file2FileLib, docLibId)).entry.id;
|
||||
file1SharedId = (await apis.admin.nodes.createFile(file1Shared, docLibId)).entry.id;
|
||||
file2SharedId = (await apis.admin.nodes.createFile(file2Shared, docLibId)).entry.id;
|
||||
file1FavId = (await apis.admin.nodes.createFile(file1Fav, docLibId)).entry.id;
|
||||
file2FavId = (await apis.admin.nodes.createFile(file2Fav, docLibId)).entry.id;
|
||||
file1FileLibId = (await adminApiActions.nodes.createFile(file1FileLib, docLibId)).entry.id;
|
||||
file2FileLibId = (await adminApiActions.nodes.createFile(file2FileLib, docLibId)).entry.id;
|
||||
file1SharedId = (await adminApiActions.nodes.createFile(file1Shared, docLibId)).entry.id;
|
||||
file2SharedId = (await adminApiActions.nodes.createFile(file2Shared, docLibId)).entry.id;
|
||||
file1FavId = (await adminApiActions.nodes.createFile(file1Fav, docLibId)).entry.id;
|
||||
file2FavId = (await adminApiActions.nodes.createFile(file2Fav, docLibId)).entry.id;
|
||||
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
const initialSharedTotalItems = await apis.user.shared.getSharedLinksTotalItems();
|
||||
await apis.admin.shared.shareFileById(file1FileLibId);
|
||||
await adminApiActions.shared.shareFileById(file1FileLibId);
|
||||
await apis.user.shared.shareFileById(file2FileLibId);
|
||||
await apis.admin.shared.shareFileById(file1SharedId);
|
||||
await adminApiActions.shared.shareFileById(file1SharedId);
|
||||
await apis.user.shared.shareFileById(file2SharedId);
|
||||
await apis.admin.shared.shareFileById(file1FavId);
|
||||
await adminApiActions.shared.shareFileById(file1FavId);
|
||||
await apis.user.shared.shareFileById(file2FavId);
|
||||
|
||||
await apis.user.favorites.addFavoriteById('file', file1FavId);
|
||||
@@ -725,7 +726,7 @@ describe('Unshare a file', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await adminApiActions.sites.deleteSite(sitePrivate);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Upload files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -32,16 +32,16 @@ describe('Upload files', () => {
|
||||
let folder1Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
@@ -23,7 +23,16 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, FILES, RepoClient, Utils, UploadNewVersionDialog } from '@alfresco/aca-testing-shared';
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
SearchResultsPage,
|
||||
FILES,
|
||||
RepoClient,
|
||||
Utils,
|
||||
UploadNewVersionDialog
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Upload new version', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -76,7 +85,6 @@ describe('Upload new version', () => {
|
||||
const fileToUpload5 = FILES.xlsxFile2;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -86,9 +94,10 @@ describe('Upload new version', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const uploadNewVersionDialog = new UploadNewVersionDialog();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentPFId = (await apis.user.nodes.createFolder(parentPF)).entry.id;
|
||||
parentSFId = (await apis.user.nodes.createFolder(parentSF)).entry.id;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils, UploadNewVersionDialog } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils, UploadNewVersionDialog } from '@alfresco/aca-testing-shared';
|
||||
import { VersionManagePage } from '../../../projects/aca-testing-shared/src/components/version-manage/version-manager';
|
||||
import { Viewer } from '../../../projects/aca-testing-shared/src/components';
|
||||
import { browser } from 'protractor';
|
||||
@@ -39,7 +39,6 @@ describe('Version component actions', () => {
|
||||
const filesToUpload = [FILES.pdfFile, FILES.docxFile, FILES.xlsxFile, FILES.jpgFile, FILES.docxFile2];
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -48,9 +47,10 @@ describe('Version component actions', () => {
|
||||
const { dataTable, toolbar } = page;
|
||||
const uploadNewVersionDialog = new UploadNewVersionDialog();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
fileId = (await apis.user.upload.uploadFile(filesToUpload[0])).entry.id;
|
||||
await apis.user.shared.shareFilesByIds([fileId]);
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
@@ -32,18 +32,17 @@ describe('General', () => {
|
||||
const page = new BrowsingPage();
|
||||
const createDialog = new CreateOrEditFolderDialog();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi, authentication: authApi } = adminApi;
|
||||
const folder = `folder-${Utils.random()}`;
|
||||
let folderId: string;
|
||||
|
||||
describe('on session expire', () => {
|
||||
beforeAll(async (done) => {
|
||||
folderId = (await nodesApi.createFolder(folder)).entry.id;
|
||||
folderId = (await adminApi.nodes.createFolder(folder)).entry.id;
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await nodesApi.deleteNodeById(folderId);
|
||||
await adminApi.nodes.deleteNodeById(folderId);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -54,7 +53,7 @@ describe('General', () => {
|
||||
await createDialog.waitForDialogToOpen();
|
||||
await createDialog.enterName(folder);
|
||||
|
||||
await authApi.logout();
|
||||
await adminApi.logout();
|
||||
|
||||
await createDialog.createButton.click();
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ describe('Page titles', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApi = new RepoClient();
|
||||
const { nodes: nodesApi } = adminApi;
|
||||
const file = `file-${Utils.random()}.txt`;
|
||||
let fileId: string;
|
||||
const { searchInput } = page.header;
|
||||
@@ -57,7 +56,7 @@ describe('Page titles', () => {
|
||||
|
||||
describe('on app pages', () => {
|
||||
beforeAll(async (done) => {
|
||||
fileId = (await nodesApi.createFile(file)).entry.id;
|
||||
fileId = (await adminApi.nodes.createFile(file)).entry.id;
|
||||
await loginPage.loginWithAdmin();
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient, navigate } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, APP_ROUTES, LoginPage, BrowsingPage, Utils, navigate } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Login', () => {
|
||||
const peopleApi = new RepoClient().people;
|
||||
const loginPage = new LoginPage();
|
||||
const { login } = loginPage;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
/* cspell:disable-next-line */
|
||||
const testUser = `user-${Utils.random()}@alfness`;
|
||||
@@ -57,12 +57,12 @@ describe('Login', () => {
|
||||
const newPassword = 'new password';
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await peopleApi.createUser({ username: testUser });
|
||||
await peopleApi.createUser(russianUser);
|
||||
await peopleApi.createUser(johnDoe);
|
||||
await peopleApi.createUser({ username: disabledUser });
|
||||
await peopleApi.createUser(testUser2);
|
||||
await peopleApi.disableUser(disabledUser);
|
||||
await adminApiActions.createUser({ username: testUser });
|
||||
await adminApiActions.createUser(russianUser);
|
||||
await adminApiActions.createUser(johnDoe);
|
||||
await adminApiActions.createUser({ username: disabledUser });
|
||||
await adminApiActions.createUser(testUser2);
|
||||
await adminApiActions.disableUser(disabledUser);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -141,7 +141,7 @@ describe('Login', () => {
|
||||
|
||||
it('[C213104] user is able to login after changing his password', async () => {
|
||||
await loginPage.loginWith(testUser2.username, testUser2.password);
|
||||
await peopleApi.changePassword(testUser2.username, newPassword);
|
||||
await adminApiActions.changePassword(testUser2.username, newPassword);
|
||||
await loginPage.loginWith(testUser2.username, newPassword);
|
||||
expect(await browser.getCurrentUrl()).toContain(APP_ROUTES.PERSONAL_FILES);
|
||||
});
|
||||
|
||||
@@ -24,18 +24,16 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient, APP_ROUTES } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, Utils, APP_ROUTES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Logout', () => {
|
||||
const page = new BrowsingPage();
|
||||
const loginPage = new LoginPage();
|
||||
|
||||
const peopleApi = new RepoClient().people;
|
||||
|
||||
const johnDoe = `user-${Utils.random()}`;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await peopleApi.createUser({ username: johnDoe });
|
||||
await adminApiActions.createUser({ username: johnDoe });
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, EXTENSIBILITY_CONFIGS, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, EXTENSIBILITY_CONFIGS, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Context submenu', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -44,7 +44,6 @@ describe('Extensions - Context submenu', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -52,9 +51,10 @@ describe('Extensions - Context submenu', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const contextMenu = dataTable.menu;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BrowsingPage, LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, BrowsingPage, LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - DocumentList presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -51,16 +51,16 @@ describe('Extensions - DocumentList presets', () => {
|
||||
];
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils, Header, Menu } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, EXTENSIBILITY_CONFIGS, Utils, Header, Menu } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Info Drawer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -42,18 +42,14 @@ describe('Extensions - Info Drawer', () => {
|
||||
icon: 'alarm_on'
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const header = new Header();
|
||||
const toolbarMenu = new Menu();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
await loginPage.load();
|
||||
await Utils.setSessionStorageFromConfig(EXTENSIBILITY_CONFIGS.HEADER);
|
||||
await loginPage.loginWith(username);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, InfoDrawer, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, InfoDrawer, RepoClient, EXTENSIBILITY_CONFIGS, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Info Drawer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -54,7 +54,6 @@ describe('Extensions - Info Drawer', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -62,9 +61,10 @@ describe('Extensions - Info Drawer', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -23,7 +23,16 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { BrowsingPage, LoginPage, RepoClient, EXTENSIBILITY_CONFIGS, Utils, InfoDrawer, MetadataCard } from '@alfresco/aca-testing-shared';
|
||||
import {
|
||||
AdminActions,
|
||||
BrowsingPage,
|
||||
LoginPage,
|
||||
RepoClient,
|
||||
EXTENSIBILITY_CONFIGS,
|
||||
Utils,
|
||||
InfoDrawer,
|
||||
MetadataCard
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Metadata presets', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -53,7 +62,6 @@ describe('Extensions - Metadata presets', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -62,9 +70,10 @@ describe('Extensions - Metadata presets', () => {
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
fileId = (await apis.user.nodes.createImage(file)).entry.id;
|
||||
|
||||
await loginPage.load();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, Viewer, RepoClient, EXTENSIBILITY_CONFIGS, FILES, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, Viewer, RepoClient, EXTENSIBILITY_CONFIGS, FILES, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Extensions - Viewer', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -63,7 +63,6 @@ describe('Extensions - Viewer', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -72,9 +71,10 @@ describe('Extensions - Viewer', () => {
|
||||
|
||||
const viewer = new Viewer();
|
||||
const { toolbar } = viewer;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
pdfFileId = (await apis.user.upload.uploadFile(pdfFile.file_name)).entry.id;
|
||||
docxFileId = (await apis.user.upload.uploadFile(docxFile.file_name)).entry.id;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Comments', () => {
|
||||
@@ -54,7 +54,6 @@ describe('Comments', () => {
|
||||
let comment2File2Entry: any;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -64,9 +63,10 @@ describe('Comments', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
|
||||
@@ -23,7 +23,17 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils, FILES, DATE_TIME_FORMAT, DATE_FORMAT } from '@alfresco/aca-testing-shared';
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
RepoClient,
|
||||
InfoDrawer,
|
||||
Utils,
|
||||
FILES,
|
||||
DATE_TIME_FORMAT,
|
||||
DATE_FORMAT
|
||||
} from '@alfresco/aca-testing-shared';
|
||||
|
||||
const moment = require('moment');
|
||||
|
||||
@@ -58,7 +68,6 @@ describe('File / Folder properties', () => {
|
||||
let folder1Id: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -68,9 +77,10 @@ describe('File / Folder properties', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1.name, parentId, file1.title, file1.description, file1.author)).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1.name, parentId, folder1.title, folder1.description, folder1.author)).entry.id;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('General', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
@@ -35,7 +35,6 @@ describe('General', () => {
|
||||
const folder1 = `folder1-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -44,9 +43,10 @@ describe('General', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.nodes.createFile(file1, parentId);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SITE_VISIBILITY, SITE_ROLES, RepoClient, InfoDrawer, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Library properties', () => {
|
||||
const username = `user1-${Utils.random()}`;
|
||||
@@ -53,7 +53,6 @@ describe('Library properties', () => {
|
||||
const siteDup = `site3-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -63,11 +62,12 @@ describe('Library properties', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.people.createUser({ username: user2 });
|
||||
await apis.admin.people.createUser({ username: user3 });
|
||||
await adminApiActions.createUser({ username });
|
||||
await adminApiActions.createUser({ username: user2 });
|
||||
await adminApiActions.createUser({ username: user3 });
|
||||
await apis.user.sites.createSite(site.name, site.visibility, site.description, site.id);
|
||||
await apis.user.sites.createSite(siteForUpdate.name, siteForUpdate.visibility, siteForUpdate.description, siteForUpdate.id);
|
||||
await apis.user.sites.createSite(siteDup);
|
||||
|
||||
@@ -23,25 +23,19 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, SearchResultsPage, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Empty list views', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
const { dataTable, pagination } = page;
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Favorites', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -37,22 +37,22 @@ describe('Favorites', () => {
|
||||
const fileName4 = `file4-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
const file1Id = (await apis.admin.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
const file1Id = (await adminApiActions.nodes.createFile(fileName1, docLibId)).entry.id;
|
||||
const folderId = (await apis.user.nodes.createFolder(favFolderName)).entry.id;
|
||||
const parentId = (await apis.user.nodes.createFolder(parentFolder)).entry.id;
|
||||
const file2Id = (await apis.user.nodes.createFile(fileName2, parentId)).entry.id;
|
||||
@@ -78,7 +78,7 @@ describe('Favorites', () => {
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodes([favFolderName, parentFolder]);
|
||||
await apis.user.trashcan.emptyTrash();
|
||||
done();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('File Libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -48,32 +48,32 @@ describe('File Libraries', () => {
|
||||
const siteDescription = 'my site description';
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.user.sites.createSite(userSitePublic, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.user.sites.createSite(userSiteModerated, SITE_VISIBILITY.MODERATED, siteDescription);
|
||||
await apis.user.sites.createSite(userSitePrivate, SITE_VISIBILITY.PRIVATE, null);
|
||||
|
||||
await apis.admin.sites.createSite(adminSite1, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite2, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite3, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite4, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite5, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite6, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite4, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite6, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.createSite(adminSite1, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite2, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite3, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite4, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite5, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite6, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite4, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite6, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite1);
|
||||
await apis.user.favorites.addFavoriteById('site', adminSite2);
|
||||
@@ -89,7 +89,7 @@ describe('File Libraries', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.sites.deleteSites([userSitePublic, userSiteModerated, userSitePrivate, siteId1, siteId2]);
|
||||
await apis.admin.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminSite5, adminSite6]);
|
||||
await adminApiActions.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminSite5, adminSite6]);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -24,11 +24,10 @@
|
||||
*/
|
||||
|
||||
import { browser } from 'protractor';
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Generic errors', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const username2 = `user2-${Utils.random()}`;
|
||||
|
||||
const parent = `folder-${Utils.random()}`;
|
||||
@@ -38,17 +37,17 @@ describe('Generic errors', () => {
|
||||
const file2 = `file2-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.people.createUser({ username: username2 });
|
||||
await adminApiActions.createUser({ username });
|
||||
await adminApiActions.createUser({ username: username2 });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1, parentId)).entry.id;
|
||||
await apis.user.nodes.createFile(file2, parentId);
|
||||
|
||||
@@ -23,14 +23,13 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Special permissions', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
const password = username;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
@@ -38,11 +37,12 @@ describe('Special permissions', () => {
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
let initialSharedTotalItems: number;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -52,15 +52,15 @@ describe('Special permissions', () => {
|
||||
let fileId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.admin.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await adminApiActions.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
|
||||
initialSharedTotalItems = await apis.user.shared.getSharedLinksTotalItems();
|
||||
|
||||
await apis.admin.shared.shareFileById(fileId);
|
||||
await adminApiActions.shared.shareFileById(fileId);
|
||||
await apis.user.nodes.editNodeContent(fileId, 'edited by user');
|
||||
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
@@ -71,17 +71,17 @@ describe('Special permissions', () => {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await adminApiActions.sites.deleteSite(sitePrivate);
|
||||
});
|
||||
|
||||
it('[C213173] on Recent Files', async () => {
|
||||
await page.clickRecentFilesAndWait();
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
|
||||
});
|
||||
@@ -89,7 +89,7 @@ describe('Special permissions', () => {
|
||||
it('[C213227] on Favorites', async () => {
|
||||
await page.clickFavoritesAndWait();
|
||||
expect(await dataTable.getRowsCount()).toBe(1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.isEmpty()).toBe(true, 'Items are still displayed');
|
||||
});
|
||||
@@ -97,7 +97,7 @@ describe('Special permissions', () => {
|
||||
it('[C213116] on Shared Files', async () => {
|
||||
await page.clickSharedFilesAndWait();
|
||||
expect(await dataTable.getRowsCount()).toBe(initialSharedTotalItems + 1, 'Incorrect number of items');
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
|
||||
await page.refresh();
|
||||
expect(await dataTable.getRowsCount()).toBe(initialSharedTotalItems, 'Incorrect number of items');
|
||||
});
|
||||
@@ -110,7 +110,7 @@ describe('Special permissions', () => {
|
||||
|
||||
expect(await dataTable.isItemPresent(fileName)).toBe(true, `${fileName} is not displayed`);
|
||||
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
|
||||
|
||||
await searchInput.clickSearchButton();
|
||||
await searchInput.checkFilesAndFolders();
|
||||
@@ -127,9 +127,9 @@ describe('Special permissions', () => {
|
||||
let fileId;
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await apis.admin.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(sitePrivate);
|
||||
await adminApiActions.sites.createSite(sitePrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await adminApiActions.sites.addSiteMember(sitePrivate, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(sitePrivate);
|
||||
fileId = (await apis.user.nodes.createFile(fileName, docLibId)).entry.id;
|
||||
await apis.user.favorites.addFavoriteById('file', fileId);
|
||||
|
||||
@@ -138,13 +138,13 @@ describe('Special permissions', () => {
|
||||
await apis.user.shared.waitForApi({ expect: initialSharedTotalItems + 1 });
|
||||
|
||||
await apis.user.search.waitForApi(username, { expect: 1 });
|
||||
await apis.admin.sites.deleteSiteMember(sitePrivate, username);
|
||||
await adminApiActions.sites.deleteSiteMember(sitePrivate, username);
|
||||
await loginPage.loginWith(username);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.admin.sites.deleteSite(sitePrivate);
|
||||
await adminApiActions.sites.deleteSite(sitePrivate);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -25,13 +25,12 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, APP_ROUTES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Personal Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -43,16 +42,17 @@ describe('Personal Files', () => {
|
||||
|
||||
const userFolder = `user-folder-${Utils.random()}`;
|
||||
const userFile = `file-${Utils.random()}.txt`;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await Promise.all([apis.admin.people.createUser({ username }), apis.admin.nodes.createFolders([adminFolder])]);
|
||||
await Promise.all([adminApiActions.createUser({ username }), adminApiActions.nodes.createFolders([adminFolder])]);
|
||||
await apis.user.nodes.createFolders([userFolder]);
|
||||
await apis.user.nodes.createFiles([userFile], userFolder);
|
||||
done();
|
||||
});
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([apis.admin.nodes.deleteNodes([adminFolder]), apis.user.nodes.deleteNodes([userFolder])]);
|
||||
await Promise.all([adminApiActions.nodes.deleteNodes([adminFolder]), apis.user.nodes.deleteNodes([userFolder])]);
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Recent Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -41,16 +41,16 @@ describe('Recent Files', () => {
|
||||
const fileSite = `file-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
folderId = (await apis.user.nodes.createFolders([folderName])).entry.id;
|
||||
await apis.user.nodes.createFiles([fileName1], folderName);
|
||||
file2Id = (await apis.user.nodes.createFiles([fileName2])).entry.id;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Shared Files', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -46,20 +46,20 @@ describe('Shared Files', () => {
|
||||
let initialSharedTotalItems: number;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, password)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
const nodeId = (await apis.admin.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
await adminApiActions.createUser({ username });
|
||||
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
const nodeId = (await adminApiActions.nodes.createFile(fileAdmin, docLibId)).entry.id;
|
||||
|
||||
folderId = (await apis.user.nodes.createFolder(folderUser)).entry.id;
|
||||
file1Id = (await apis.user.nodes.createFile(file1User, folderId)).entry.id;
|
||||
@@ -70,7 +70,7 @@ describe('Shared Files', () => {
|
||||
initialSharedTotalItems = await apis.user.shared.getSharedLinksTotalItems();
|
||||
|
||||
await apis.user.shared.shareFilesByIds([file1Id, file2Id, file3Id, file4Id]);
|
||||
await apis.admin.shared.shareFileById(nodeId);
|
||||
await adminApiActions.shared.shareFileById(nodeId);
|
||||
await apis.user.shared.waitForApi({ expect: initialSharedTotalItems + 5 });
|
||||
|
||||
await apis.user.nodes.deleteNodeById(file2Id);
|
||||
@@ -88,7 +88,7 @@ describe('Shared Files', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await apis.admin.sites.deleteSite(siteName);
|
||||
await adminApiActions.sites.deleteSite(siteName);
|
||||
await apis.user.nodes.deleteNodeById(folderId);
|
||||
await apis.user.nodes.deleteNodeById(file4Id);
|
||||
});
|
||||
|
||||
@@ -23,13 +23,12 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('File / folder tooltips', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -51,9 +50,10 @@ describe('File / folder tooltips', () => {
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
file1Id = (await apis.user.nodes.createFile(file, parentId)).entry.id;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, SITE_ROLES, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Trash', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -53,22 +53,22 @@ describe('Trash', () => {
|
||||
let fileInFolderId: string;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
fileAdminId = (await apis.admin.nodes.createFiles([fileAdmin])).entry.id;
|
||||
folderAdminId = (await apis.admin.nodes.createFolders([folderAdmin])).entry.id;
|
||||
await apis.admin.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
const docLibId = await apis.admin.sites.getDocLibId(siteName);
|
||||
fileSiteId = (await apis.admin.nodes.createFile(fileSite, docLibId)).entry.id;
|
||||
await adminApiActions.createUser({ username });
|
||||
fileAdminId = (await adminApiActions.nodes.createFiles([fileAdmin])).entry.id;
|
||||
folderAdminId = (await adminApiActions.nodes.createFolders([folderAdmin])).entry.id;
|
||||
await adminApiActions.sites.createSite(siteName, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(siteName, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
const docLibId = await adminApiActions.sites.getDocLibId(siteName);
|
||||
fileSiteId = (await adminApiActions.nodes.createFile(fileSite, docLibId)).entry.id;
|
||||
fileUserId = (await apis.user.nodes.createFiles([fileUser])).entry.id;
|
||||
folderUserId = (await apis.user.nodes.createFolders([folderUser])).entry.id;
|
||||
folderDeletedId = (await apis.user.nodes.createFolder(folderDeleted)).entry.id;
|
||||
@@ -76,7 +76,7 @@ describe('Trash', () => {
|
||||
folderNotDeletedId = (await apis.user.nodes.createFolder(folderNotDeleted)).entry.id;
|
||||
fileInFolderId = (await apis.user.nodes.createFiles([fileInFolder], folderNotDeleted)).entry.id;
|
||||
|
||||
await apis.admin.nodes.deleteNodesById([fileAdminId, folderAdminId], false);
|
||||
await adminApiActions.nodes.deleteNodesById([fileAdminId, folderAdminId], false);
|
||||
await apis.user.nodes.deleteNodesById([fileSiteId, fileUserId, folderUserId, fileInFolderId], false);
|
||||
await apis.user.nodes.deleteNodeById(fileDeletedId, false);
|
||||
await apis.user.nodes.deleteNodeById(folderDeletedId, false);
|
||||
@@ -84,9 +84,9 @@ describe('Trash', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSite(siteName),
|
||||
apis.admin.trashcan.permanentlyDelete(fileAdminId),
|
||||
apis.admin.trashcan.permanentlyDelete(folderAdminId),
|
||||
adminApiActions.sites.deleteSite(siteName),
|
||||
adminApiActions.trashcan.permanentlyDelete(fileAdminId),
|
||||
adminApiActions.trashcan.permanentlyDelete(folderAdminId),
|
||||
apis.user.nodes.deleteNodeById(folderNotDeletedId),
|
||||
apis.user.trashcan.emptyTrash()
|
||||
]);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
import { browser } from 'protractor';
|
||||
|
||||
import { SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, SITE_VISIBILITY, LoginPage, BrowsingPage, Utils, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Breadcrumb', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -51,12 +51,12 @@ describe('Breadcrumb', () => {
|
||||
const { breadcrumb } = page;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
subFolder1Id = (await apis.user.nodes.createFolder(subFolder1, parentId)).entry.id;
|
||||
subFolder2Id = (await apis.user.nodes.createFolder(subFolder2, subFolder1Id)).entry.id;
|
||||
@@ -194,7 +194,7 @@ describe('Breadcrumb', () => {
|
||||
const user2Api = new RepoClient(user2, user2);
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username: user2 });
|
||||
await adminApiActions.createUser({ username: user2 });
|
||||
userFolderId = (await user2Api.nodes.createFolder(userFolder)).entry.id;
|
||||
await loginPage.loginWithAdmin();
|
||||
await page.dataTable.waitForBody();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, Viewer, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, Viewer, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Single click on item name', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -42,7 +42,6 @@ describe('Single click on item name', () => {
|
||||
const fileSite = `fileSite-${Utils.random()}.txt`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -51,9 +50,10 @@ describe('Single click on item name', () => {
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const viewer = new Viewer();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
file1Id = (await apis.user.nodes.createFile(file1)).entry.id;
|
||||
folder1Id = (await apis.user.nodes.createFolder(folder1)).entry.id;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, FILES, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils, FILES, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
const moment = require('moment');
|
||||
|
||||
@@ -57,7 +57,6 @@ describe('Search filters', () => {
|
||||
const expectedLocations = ['_REPOSITORY_ (1)', `${site} (1)`];
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user1: new RepoClient(user1, user1),
|
||||
user2: new RepoClient(user2, user2)
|
||||
};
|
||||
@@ -74,14 +73,15 @@ describe('Search filters', () => {
|
||||
const locationFilter = filters.location;
|
||||
const modifierFilter = filters.modifier;
|
||||
const modifiedDateFilter = filters.modifiedDate;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username: user1 });
|
||||
await apis.admin.people.createUser({ username: user2 });
|
||||
await adminApiActions.createUser({ username: user1 });
|
||||
await adminApiActions.createUser({ username: user2 });
|
||||
parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user1.sites.createSite(site, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.user1.sites.addSiteMember(site, user2, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
docLibId = await apis.admin.sites.getDocLibId(site);
|
||||
docLibId = await adminApiActions.sites.getDocLibId(site);
|
||||
|
||||
await apis.user1.nodes.setGranularPermission(parentId, true, user2, 'Collaborator');
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
const moment = require('moment');
|
||||
|
||||
describe('Search results - files and folders', () => {
|
||||
@@ -46,7 +46,6 @@ describe('Search results - files and folders', () => {
|
||||
const site = `test-site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -54,9 +53,10 @@ describe('Search results - files and folders', () => {
|
||||
const page = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
const { dataTable, breadcrumb } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
fileId = (await apis.user.nodes.createFile(file, '-my-', fileTitle, fileDescription)).entry.id;
|
||||
await apis.user.nodes.editNodeContent(fileId, 'edited by user');
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils } from '@alfresco/aca-testing-shared';
|
||||
import { browser } from 'protractor';
|
||||
|
||||
describe('Search results general', () => {
|
||||
@@ -36,7 +36,6 @@ describe('Search results general', () => {
|
||||
const site = `test-site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -44,9 +43,10 @@ describe('Search results general', () => {
|
||||
const page = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
const dataTable = page.dataTable;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
fileId = (await apis.user.nodes.createFile(file)).entry.id;
|
||||
folderId = (await apis.user.nodes.createFolder(folder)).entry.id;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils, SITE_VISIBILITY, SITE_ROLES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Search results - libraries', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -63,7 +63,6 @@ describe('Search results - libraries', () => {
|
||||
const adminPrivate = `admin-site-${Utils.random()}`;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -71,9 +70,10 @@ describe('Search results - libraries', () => {
|
||||
const page = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
const dataTable = page.dataTable;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
|
||||
await apis.user.sites.createSite(site1.name, SITE_VISIBILITY.PUBLIC, '', site1.id);
|
||||
await apis.user.sites.createSite(site2.name, SITE_VISIBILITY.PUBLIC, '', site2.id);
|
||||
@@ -86,16 +86,16 @@ describe('Search results - libraries', () => {
|
||||
|
||||
await apis.user.sites.createSite(siteRussian.name, SITE_VISIBILITY.PUBLIC, '', siteRussian.id);
|
||||
|
||||
await apis.admin.sites.createSite(adminSite1, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite2, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite3, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.createSite(adminSite4, SITE_VISIBILITY.PUBLIC);
|
||||
await apis.admin.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await apis.admin.sites.addSiteMember(adminSite4, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
await adminApiActions.sites.createSite(adminSite1, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite2, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite3, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.createSite(adminSite4, SITE_VISIBILITY.PUBLIC);
|
||||
await adminApiActions.sites.addSiteMember(adminSite1, username, SITE_ROLES.SITE_CONSUMER.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite2, username, SITE_ROLES.SITE_CONTRIBUTOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite3, username, SITE_ROLES.SITE_COLLABORATOR.ROLE);
|
||||
await adminApiActions.sites.addSiteMember(adminSite4, username, SITE_ROLES.SITE_MANAGER.ROLE);
|
||||
|
||||
await apis.admin.sites.createSite(adminPrivate, SITE_VISIBILITY.PRIVATE);
|
||||
await adminApiActions.sites.createSite(adminPrivate, SITE_VISIBILITY.PRIVATE);
|
||||
|
||||
await apis.user.sites.waitForApi({ expect: 12 });
|
||||
await apis.user.queries.waitForSites('lib', { expect: 2 });
|
||||
@@ -107,7 +107,7 @@ describe('Search results - libraries', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await Promise.all([
|
||||
apis.admin.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminPrivate]),
|
||||
adminApiActions.sites.deleteSites([adminSite1, adminSite2, adminSite3, adminSite4, adminPrivate]),
|
||||
apis.user.sites.deleteSites([site1.id, site2.id, site3.id, site4.id, userSitePublic, userSiteModerated, userSitePrivate, siteRussian.id])
|
||||
]);
|
||||
done();
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, SearchResultsPage, RepoClient, Utils, FILES } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, SearchResultsPage, RepoClient, Utils, FILES } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Search sorting', () => {
|
||||
const random = Utils.random();
|
||||
@@ -47,7 +47,6 @@ describe('Search sorting', () => {
|
||||
};
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user1: new RepoClient(user1, user1),
|
||||
user2: new RepoClient(user2, user2)
|
||||
};
|
||||
@@ -56,10 +55,11 @@ describe('Search sorting', () => {
|
||||
const page = new SearchResultsPage();
|
||||
const { searchInput } = page.header;
|
||||
const { dataTable } = page;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username: user1 });
|
||||
await apis.admin.people.createUser({ username: user2 });
|
||||
await adminApiActions.createUser({ username: user1 });
|
||||
await adminApiActions.createUser({ username: user2 });
|
||||
parentId = (await apis.user1.nodes.createFolder(parent)).entry.id;
|
||||
|
||||
await apis.user1.nodes.setGranularPermission(parentId, true, user2, 'Collaborator');
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
*/
|
||||
|
||||
import {
|
||||
AdminActions,
|
||||
LoginPage,
|
||||
BrowsingPage,
|
||||
FILES,
|
||||
@@ -45,7 +46,6 @@ describe('Viewer actions', () => {
|
||||
const pdfFileForDelete = FILES.pdfFile;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -58,9 +58,10 @@ describe('Viewer actions', () => {
|
||||
const shareDialog = new ShareDialog();
|
||||
const manageVersionsDialog = new ManageVersionsDialog();
|
||||
const uploadNewVersionDialog = new UploadNewVersionDialog();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
done();
|
||||
});
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, FILES, SITE_VISIBILITY, RepoClient, Utils, Viewer } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Viewer general', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -44,7 +44,6 @@ describe('Viewer general', () => {
|
||||
const fileInSite = FILES.docxFile;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -53,15 +52,16 @@ describe('Viewer general', () => {
|
||||
const { dataTable } = page;
|
||||
const viewer = new Viewer();
|
||||
const { searchInput } = page.header;
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async (done) => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
xlsxFileId = (await apis.user.upload.uploadFile(xlsxFile, parentId)).entry.id;
|
||||
|
||||
await apis.admin.sites.createSite(siteAdmin, SITE_VISIBILITY.PRIVATE);
|
||||
docLibId = await apis.admin.sites.getDocLibId(siteAdmin);
|
||||
fileAdminId = (await apis.admin.upload.uploadFile(fileAdmin, docLibId)).entry.id;
|
||||
await adminApiActions.sites.createSite(siteAdmin, SITE_VISIBILITY.PRIVATE);
|
||||
docLibId = await adminApiActions.sites.getDocLibId(siteAdmin);
|
||||
fileAdminId = (await adminApiActions.upload.uploadFile(fileAdmin, docLibId)).entry.id;
|
||||
|
||||
await apis.user.sites.createSite(siteUser, SITE_VISIBILITY.PUBLIC);
|
||||
docLibSiteUserId = await apis.user.sites.getDocLibId(siteUser);
|
||||
@@ -94,7 +94,7 @@ describe('Viewer general', () => {
|
||||
|
||||
afterAll(async (done) => {
|
||||
await apis.user.nodes.deleteNodeById(parentId);
|
||||
await apis.admin.sites.deleteSite(siteAdmin);
|
||||
await adminApiActions.sites.deleteSite(siteAdmin);
|
||||
await apis.user.sites.deleteSite(siteUser);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, FILES, RepoClient, Utils, Viewer, PasswordDialog } from '@alfresco/aca-testing-shared';
|
||||
import { AdminActions, LoginPage, BrowsingPage, FILES, RepoClient, Utils, Viewer, PasswordDialog } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Viewer - password protected file', () => {
|
||||
const username = `user-${Utils.random()}`;
|
||||
@@ -34,7 +34,6 @@ describe('Viewer - password protected file', () => {
|
||||
const protectedFile = FILES.protectedFile;
|
||||
|
||||
const apis = {
|
||||
admin: new RepoClient(),
|
||||
user: new RepoClient(username, username)
|
||||
};
|
||||
|
||||
@@ -43,9 +42,10 @@ describe('Viewer - password protected file', () => {
|
||||
const { dataTable } = page;
|
||||
const viewer = new Viewer();
|
||||
const passwordDialog = new PasswordDialog();
|
||||
const adminApiActions = new AdminActions();
|
||||
|
||||
beforeAll(async () => {
|
||||
await apis.admin.people.createUser({ username });
|
||||
await adminApiActions.createUser({ username });
|
||||
parentId = (await apis.user.nodes.createFolder(parent)).entry.id;
|
||||
await apis.user.upload.uploadFile(protectedFile.name, parentId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user