mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +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, 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);
|
||||
|
Reference in New Issue
Block a user