The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/e2e/email-inboxes.spec.ts

52 lines
1.8 KiB

import { faker } from '@faker-js/faker';
import { Users } from './fixtures/userStates';
import { AdminEmailInboxes } from './page-objects';
import { test, expect } from './utils/test';
test.use({ storageState: Users.admin.state });
test.describe.serial('email-inboxes', () => {
let poAdminEmailInboxes: AdminEmailInboxes;
const email = faker.internet.email();
test.beforeEach(async ({ page }) => {
poAdminEmailInboxes = new AdminEmailInboxes(page);
await page.goto('/admin/email-inboxes');
});
test('expect create an email inbox', async () => {
await poAdminEmailInboxes.btnNewEmailInbox.click();
const name = faker.person.firstName();
await poAdminEmailInboxes.inputName.type(name);
await poAdminEmailInboxes.inputEmail.type(email);
// SMTP
await poAdminEmailInboxes.inputSmtpServer.type(faker.internet.domainName());
await poAdminEmailInboxes.inputSmtpUsername.type(faker.internet.userName());
await poAdminEmailInboxes.inputSmtpPassword.type(faker.internet.password());
await poAdminEmailInboxes.inputSmtpSecure.click();
// IMAP
await poAdminEmailInboxes.inputImapServer.type(faker.internet.domainName());
await poAdminEmailInboxes.inputImapUsername.type(faker.internet.userName());
await poAdminEmailInboxes.inputImapPassword.type(faker.internet.password());
await poAdminEmailInboxes.inputImapSecure.click();
await poAdminEmailInboxes.btnSave.click();
await expect(poAdminEmailInboxes.itemRow(name)).toBeVisible();
});
test('expect delete an email inbox', async ({ page }) => {
await poAdminEmailInboxes.deleteEmailInboxByName(email);
// await poAdminEmailInboxes.itemRow(email).click();
// await poAdminEmailInboxes.btnDelete.click();
// await poUtils.btnModalConfirmDelete.click();
// await expect(poUtils.toastBarSuccess).toBeVisible();
await expect(page.locator('text=No results found')).toBeVisible();
});
});