mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
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:
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, Utils, AdminActions, UserActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Pagination on multiple pages on Trash', () => {
|
||||
const random = Utils.random();
|
||||
@@ -36,17 +36,21 @@ describe('Pagination on multiple pages on Trash', () => {
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
const { dataTable, pagination } = page;
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.login();
|
||||
await adminApiActions.createUser({ username });
|
||||
await userActions.login(username, username);
|
||||
|
||||
filesDeletedIds = (await userApi.nodes.createFiles(filesForDelete)).list.entries.map((entries: any) => entries.entry.id);
|
||||
|
||||
await userApi.nodes.deleteNodesById(filesDeletedIds, false);
|
||||
await userApi.trashcan.waitForApi({ expect: 101 });
|
||||
await userActions.deleteNodes(filesDeletedIds, false);
|
||||
await userActions.waitForTrashcanSize(101);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
await page.clickTrashAndWait();
|
||||
@@ -57,7 +61,7 @@ describe('Pagination on multiple pages on Trash', () => {
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await userApi.trashcan.emptyTrash();
|
||||
await userActions.emptyTrashcan();
|
||||
});
|
||||
|
||||
it('[C280122] Pagination control default values', async () => {
|
||||
|
@@ -23,7 +23,7 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, Utils, AdminActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
import { LoginPage, BrowsingPage, SearchResultsPage, Utils, AdminActions, UserActions, RepoClient } from '@alfresco/aca-testing-shared';
|
||||
|
||||
describe('Pagination on single page', () => {
|
||||
const random = Utils.random();
|
||||
@@ -40,6 +40,7 @@ describe('Pagination on single page', () => {
|
||||
|
||||
const userApi = new RepoClient(username, username);
|
||||
const adminApiActions = new AdminActions();
|
||||
const userActions = new UserActions();
|
||||
|
||||
const loginPage = new LoginPage();
|
||||
const page = new BrowsingPage();
|
||||
@@ -48,12 +49,14 @@ describe('Pagination on single page', () => {
|
||||
const searchResultsPage = new SearchResultsPage();
|
||||
|
||||
beforeAll(async () => {
|
||||
await adminApiActions.login();
|
||||
await adminApiActions.createUser({ username });
|
||||
await userActions.login(username, username);
|
||||
|
||||
const initialFavoriteTotalItems = await userApi.favorites.getFavoritesTotalItems();
|
||||
const initialRecentFilesTotalItems = await userApi.search.getTotalItems(username);
|
||||
const initialSharedTotalItems = await userApi.shared.getSharedLinksTotalItems();
|
||||
const initialTrashTotalItems = await userApi.trashcan.getDeletedNodesTotalItems();
|
||||
const initialTrashTotalItems = await userActions.getTrashcanSize();
|
||||
|
||||
fileId = (await userApi.nodes.createFile(file)).entry.id;
|
||||
fileInTrashId = (await userApi.nodes.createFile(fileInTrash)).entry.id;
|
||||
@@ -61,20 +64,20 @@ describe('Pagination on single page', () => {
|
||||
|
||||
await userApi.nodes.deleteNodeById(fileInTrashId, false);
|
||||
await userApi.favorites.addFavoriteById('file', fileId);
|
||||
await userApi.shared.shareFileById(fileId);
|
||||
await userActions.shareNodes([fileId]);
|
||||
|
||||
await Promise.all([
|
||||
userApi.favorites.waitForApi({ expect: initialFavoriteTotalItems + 2 }),
|
||||
userApi.search.waitForApi(username, { expect: initialRecentFilesTotalItems + 1 }),
|
||||
userApi.shared.waitForApi({ expect: initialSharedTotalItems + 1 }),
|
||||
userApi.trashcan.waitForApi({ expect: initialTrashTotalItems + 1 })
|
||||
]);
|
||||
await userApi.favorites.waitForApi({ expect: initialFavoriteTotalItems + 2 });
|
||||
await userApi.search.waitForApi(username, { expect: initialRecentFilesTotalItems + 1 });
|
||||
await userApi.shared.waitForApi({ expect: initialSharedTotalItems + 1 });
|
||||
await userActions.waitForTrashcanSize(initialTrashTotalItems + 1);
|
||||
|
||||
await loginPage.loginWith(username);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await Promise.all([userApi.nodes.deleteNodeById(fileId), userApi.sites.deleteSite(siteId), userApi.trashcan.emptyTrash()]);
|
||||
await userActions.deleteNodes([fileId]);
|
||||
await userActions.deleteSites([siteId]);
|
||||
await userActions.emptyTrashcan();
|
||||
});
|
||||
|
||||
it('[C280112] page selector not displayed on Favorites', async () => {
|
||||
|
Reference in New Issue
Block a user