Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export class ConversationDetailsPage {
readonly clearConversationContentButton: Locator;
readonly selectedSearchList: Locator;
readonly searchList: Locator;
readonly deleteGroupButton: Locator;
readonly notificationsButton: Locator;
readonly editConversationNameButton: Locator;
readonly textFieldForConversationName: Locator;

constructor(page: Page) {
this.page = page;
Expand All @@ -44,6 +48,10 @@ export class ConversationDetailsPage {
this.clearConversationContentButton = this.conversationDetails.getByRole('button', {name: 'Clear Content'});
this.selectedSearchList = this.page.getByTestId('selected-search-list');
this.searchList = this.page.getByTestId('search-list');
this.deleteGroupButton = this.page.getByRole('button', {name: 'Delete group'});
this.notificationsButton = this.page.getByRole('button', {name: 'Notifications'});
this.editConversationNameButton = this.page.getByRole('button', {name: 'Change conversation name'});
this.textFieldForConversationName = this.page.locator('textarea[data-uie-name="enter-name"]');
}

async waitForSidebar() {
Expand Down Expand Up @@ -181,4 +189,16 @@ export class ConversationDetailsPage {
async clickClearConversationContentButton() {
await this.clearConversationContentButton.click();
}

async setNotificationsForConversation(value: 'Everything' | 'Mentions and replies' | 'Nothing') {
await this.notificationsButton.click();
const notificationsPanel = this.page.locator('aside#right-column');
await notificationsPanel.getByRole('radiogroup').getByText(value).click();
}

async changeConversationName(newConversationName: string) {
await this.editConversationNameButton.click();
await this.textFieldForConversationName.fill(newConversationName);
await this.textFieldForConversationName.press('Enter');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,8 @@ export class ConversationListPage {
getMoveToFolderButton(folderName: string) {
return this.moveToMenu.getByRole('button', {name: folderName, exact: true});
}

async getMutedConversationBadge(conversationName: string) {
return this.getConversationLocator(conversationName).getByTitle('Muted conversation');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import {removeCreatedUser} from 'test/e2e_tests/utils/tearDown.util';
import {createGroup, loginUser, logOutUser} from 'test/e2e_tests/utils/userActions';
import {createAndSaveBackup, createGroup, loginUser, logOutUser} from 'test/e2e_tests/utils/userActions';

import {getUser} from '../../data/user';
import {test, expect} from '../../test.fixtures';
Expand All @@ -32,27 +32,9 @@ const groupMessage = 'This is a group message!';
let backupName: string;
let passwordProtectedBackupName: string;

test('Setting up new device with a backup', {tag: ['@TC-8634', '@crit-flow-web']}, async ({pageManager, api}) => {
test('Setting up new device with a backup', {tag: ['@TC-8634', '@crit-flow-web']}, async ({pageManager, api}, testInfo) => {
const {pages, modals, components} = pageManager.webapp;

const createAndSaveBackup = async (password?: string, filenamePrefix?: string): Promise<string> => {
await pages.account().clickBackUpButton();
expect(modals.passwordAdvancedSecurity().isTitleVisible()).toBeTruthy();
if (password) {
await modals.passwordAdvancedSecurity().enterPassword(password);
}
await modals.passwordAdvancedSecurity().clickBackUpNow();
expect(modals.passwordAdvancedSecurity().isTitleHidden()).toBeTruthy();
expect(pages.historyExport().isVisible()).toBeTruthy();
const [download] = await Promise.all([
pages.historyExport().page.waitForEvent('download'),
pages.historyExport().clickSaveFileButton(),
]);
const backupName = `./test-results/downloads/${filenamePrefix}${download.suggestedFilename()}`;
await download.saveAs(backupName);
return backupName;
};

// Creating preconditions for the test via API
await test.step('Preconditions: Creating preconditions for the test via API', async () => {
await api.createPersonalUser(userA);
Expand Down Expand Up @@ -81,11 +63,11 @@ test('Setting up new device with a backup', {tag: ['@TC-8634', '@crit-flow-web']

await test.step('User creates and saves a backup', async () => {
await components.conversationSidebar().clickPreferencesButton();
backupName = await createAndSaveBackup();
backupName = await createAndSaveBackup(testInfo, pageManager);
});

await test.step('User creates and saves a password backup', async () => {
passwordProtectedBackupName = await createAndSaveBackup(userA.password, 'password-');
passwordProtectedBackupName = await createAndSaveBackup(testInfo, pageManager, userA.password, 'password-');
});

await test.step('User logs out and clears all data', async () => {
Expand Down
Loading
Loading