e2e improvements part2 (#1728)

* deprecate comments api wrapper, delete sites perf improve

* introduce user actions

* admin actions inherit user actions

* unlock nodes helper

* api improvements

* api improvements

* update code

* api improvements

* deprecate trashcan api wrapper

* shared api improvements
This commit is contained in:
Denys Vuika
2020-10-07 19:06:21 +01:00
committed by GitHub
parent ffa7ca3aa6
commit e9b837462a
35 changed files with 509 additions and 458 deletions

View File

@@ -25,6 +25,7 @@
import {
AdminActions,
UserActions,
LoginPage,
BrowsingPage,
FILES,
@@ -59,9 +60,12 @@ describe('Viewer actions', () => {
const manageVersionsDialog = new ManageVersionsDialog();
const uploadNewVersionDialog = new UploadNewVersionDialog();
const adminApiActions = new AdminActions();
const userActions = new UserActions();
beforeAll(async (done) => {
await adminApiActions.login();
await adminApiActions.createUser({ username });
await userActions.login(username, username);
done();
});
@@ -125,9 +129,8 @@ describe('Viewer actions', () => {
});
afterAll(async (done) => {
await apis.user.nodes.deleteNodeById(parentId);
await apis.user.nodes.deleteNodeById(destinationId);
await apis.user.trashcan.emptyTrash();
await userActions.deleteNodes([parentId, destinationId]);
await userActions.emptyTrashcan();
done();
});
@@ -354,9 +357,9 @@ describe('Viewer actions', () => {
});
afterAll(async (done) => {
await apis.user.sites.deleteSite(siteName);
await apis.user.nodes.deleteNodeById(destinationId);
await apis.user.trashcan.emptyTrash();
await userActions.deleteSites([siteName]);
await userActions.deleteNodes([destinationId]);
await userActions.emptyTrashcan();
done();
});
@@ -542,9 +545,8 @@ describe('Viewer actions', () => {
});
afterAll(async (done) => {
await apis.user.nodes.deleteNodeById(parentId);
await apis.user.nodes.deleteNodeById(destinationId);
await apis.user.trashcan.emptyTrash();
await userActions.deleteNodes([parentId, destinationId]);
await userActions.emptyTrashcan();
done();
});
@@ -741,9 +743,8 @@ describe('Viewer actions', () => {
});
afterAll(async (done) => {
await apis.user.nodes.deleteNodeById(parentId);
await apis.user.nodes.deleteNodeById(destinationId);
await apis.user.trashcan.emptyTrash();
await userActions.deleteNodes([parentId, destinationId]);
await userActions.emptyTrashcan();
done();
});
@@ -937,9 +938,8 @@ describe('Viewer actions', () => {
});
afterAll(async (done) => {
await apis.user.nodes.deleteNodeById(parentId);
await apis.user.nodes.deleteNodeById(destinationId);
await apis.user.trashcan.emptyTrash();
await userActions.deleteNodes([parentId, destinationId]);
await userActions.emptyTrashcan();
done();
});