Skip to content

Commit

Permalink
Fixes after PR comments, removed afterEach blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
katarzynakita committed Feb 12, 2024
1 parent c7ffc53 commit 3ba6c79
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
2 changes: 1 addition & 1 deletion e2e/playwright/info-drawer/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const config: PlaywrightTestConfig<CustomConfig> = {
name: 'Info Drawer',
testDir: './src/tests',
use: {
users: ['hruser', 'admin']
users: []
}
}
]
Expand Down
24 changes: 9 additions & 15 deletions e2e/playwright/info-drawer/src/tests/general.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ test.describe('Info Drawer - General', () => {

const username = `user1-${Utils.random()}`;

test.afterAll(async () => {
try {
await nodesApi.deleteCurrentUserNodes();
await trashcanApi.emptyTrashcan();
} catch (error) {
console.error(`afterAll failed: ${error}`);
}
});

test.beforeAll(async () => {
try {
const apiClientFactory = new ApiClientFactory();
Expand All @@ -45,15 +54,6 @@ test.describe('Info Drawer - General', () => {
}
});

test.afterAll(async () => {
try {
await nodesApi.deleteCurrentUserNodes();
await trashcanApi.emptyTrashcan();
} catch (error) {
console.error(`afterAll failed: ${error}`);
}
});

test.beforeEach(async ({ loginPage }) => {
try {
await loginPage.loginUser({ username, password: username }, { withNavigation: true, waitForLoading: true });
Expand All @@ -62,12 +62,6 @@ test.describe('Info Drawer - General', () => {
}
});

test.afterEach(async ({ personalFiles }) => {
if (await personalFiles.infoDrawer.infoDrawerPanel.isVisible()) {
await personalFiles.acaHeader.viewDetails.click();
}
});

test('[C268999] Info drawer closes on page refresh', async ({ personalFiles }) => {
const parentFolder = `parent-${Utils.random()}`;
const file1 = `file1-${Utils.random()}.txt`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ test.describe('Library properties', () => {
}
});

test.afterEach(async ({ myLibrariesPage }) => {
if (await myLibrariesPage.libraryDetails.infoDrawerPanel.isVisible()) {
await myLibrariesPage.acaHeader.viewDetails.click();
}
});

test.beforeAll(async () => {
try {
const apiClientFactory = new ApiClientFactory();
Expand Down
3 changes: 2 additions & 1 deletion projects/aca-playwright-shared/src/api/queries-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/

import { FindQuery } from '@alfresco/js-api';
import { Utils } from '../utils';
import { ApiClientFactory } from './api-client-factory';

Expand Down Expand Up @@ -59,7 +60,7 @@ export class QueriesApi {

private async findSitesTotalItems(searchTerm: string): Promise<number> {
try {
const opts: { term: string; fields: Array<string> } = {
const opts: FindQuery = {
term: searchTerm,
fields: ['title']
};
Expand Down

0 comments on commit 3ba6c79

Please sign in to comment.