change feed operation to new admin user Activity feed (#17550)

This commit is contained in:
Ashish Gupta 2024-08-22 18:53:43 +05:30 committed by GitHub
parent bbe92e2af3
commit 5ac7a466fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 55 additions and 23 deletions

View File

@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import test, { expect } from '@playwright/test';
import { expect, Page, test as base } from '@playwright/test';
import { TableClass } from '../../support/entity/TableClass';
import { UserClass } from '../../support/user/UserClass';
import {
@ -19,7 +19,6 @@ import {
} from '../../utils/activityFeed';
import { performAdminLogin } from '../../utils/admin';
import {
createNewPage,
descriptionBox,
redirectToHomePage,
toastNotification,
@ -41,16 +40,24 @@ const entity2 = new TableClass();
const entity3 = new TableClass();
const user1 = new UserClass();
const user2 = new UserClass();
const adminUser = new UserClass();
const test = base.extend<{ page: Page }>({
page: async ({ browser }, use) => {
const adminPage = await browser.newPage();
await adminUser.login(adminPage);
await use(adminPage);
await adminPage.close();
},
});
test.describe('Activity feed', () => {
test.slow();
// use the admin user to login
test.use({ storageState: 'playwright/.auth/admin.json' });
test.slow(true);
test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
const { apiContext, afterAction } = await performAdminLogin(browser);
await adminUser.create(apiContext);
await adminUser.setAdminRole(apiContext);
await entity.create(apiContext);
await entity2.create(apiContext);
await entity3.create(apiContext);
@ -59,16 +66,13 @@ test.describe('Activity feed', () => {
await afterAction();
});
test.beforeEach('Visit on landing page', async ({ page }) => {
await redirectToHomePage(page);
});
test.afterAll('Cleanup', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
const { apiContext, afterAction } = await performAdminLogin(browser);
await entity.delete(apiContext);
await entity2.delete(apiContext);
await entity3.delete(apiContext);
await user1.delete(apiContext);
await adminUser.delete(apiContext);
await afterAction();
});
@ -78,6 +82,8 @@ test.describe('Activity feed', () => {
term: entity.entity.name,
assignee: user1.responseData.name,
};
await redirectToHomePage(page);
await entity.visitEntityPage(page);
await page.getByTestId('request-description').click();
@ -148,6 +154,8 @@ test.describe('Activity feed', () => {
test('User should be able to reply and delete comment in feeds in ActivityFeed', async ({
page,
}) => {
await redirectToHomePage(page);
await visitUserProfilePage(page);
const secondFeedConversation = page
@ -249,6 +257,9 @@ test.describe('Activity feed', () => {
columnName: entity.entity.columns[1].name,
oldDescription: entity.entity.columns[1].description,
};
await redirectToHomePage(page);
await entity.visitEntityPage(page);
await page
@ -302,6 +313,8 @@ test.describe('Activity feed', () => {
term: entity2.entity.name,
assignee: user1.responseData.name,
};
await redirectToHomePage(page);
await entity2.visitEntityPage(page);
await page.getByTestId('request-description').click();
@ -362,6 +375,8 @@ test.describe('Activity feed', () => {
term: entity3.entity.name,
assignee: user1.responseData.name,
};
await redirectToHomePage(page);
await entity3.visitEntityPage(page);
await page.getByTestId('request-description').click();
@ -426,10 +441,10 @@ test.describe('Activity feed', () => {
});
});
test.describe('Activity feed with Data Steward User', () => {
test.slow(true);
base.describe('Activity feed with Data Steward User', () => {
base.slow(true);
test.beforeAll('Setup pre-requests', async ({ browser }) => {
base.beforeAll('Setup pre-requests', async ({ browser }) => {
const { afterAction, apiContext } = await performAdminLogin(browser);
await entity.create(apiContext);
@ -439,7 +454,7 @@ test.describe('Activity feed with Data Steward User', () => {
await afterAction();
});
test.afterAll('Cleanup', async ({ browser }) => {
base.afterAll('Cleanup', async ({ browser }) => {
const { afterAction, apiContext } = await performAdminLogin(browser);
await entity.delete(apiContext);
await entity2.delete(apiContext);
@ -449,7 +464,7 @@ test.describe('Activity feed with Data Steward User', () => {
await afterAction();
});
test('Create and Assign Task with Suggestions', async ({ browser }) => {
base('Create and Assign Task with Suggestions', async ({ browser }) => {
const { page: page1, afterAction: afterActionUser1 } =
await performUserLogin(browser, user1);
const { page: page2, afterAction: afterActionUser2 } =
@ -460,7 +475,7 @@ test.describe('Activity feed with Data Steward User', () => {
assignee: user2.responseData.name,
};
await test.step('Create, Close and Assign Task to User 2', async () => {
await base.step('Create, Close and Assign Task to User 2', async () => {
await redirectToHomePage(page1);
await entity.visitEntityPage(page1);
@ -512,7 +527,7 @@ test.describe('Activity feed with Data Steward User', () => {
await afterActionUser1();
});
await test.step('Accept Task By User 2', async () => {
await base.step('Accept Task By User 2', async () => {
await redirectToHomePage(page2);
const taskResponse = page2.waitForResponse(
@ -580,7 +595,7 @@ test.describe('Activity feed with Data Steward User', () => {
});
});
test('Create and Assign Task without Suggestions', async ({ browser }) => {
base('Create and Assign Task without Suggestions', async ({ browser }) => {
const { page: page1, afterAction: afterActionUser1 } =
await performUserLogin(browser, user1);
const { page: page2, afterAction: afterActionUser2 } =
@ -591,7 +606,7 @@ test.describe('Activity feed with Data Steward User', () => {
assignee: user2.responseData.name,
};
await test.step('Create, Close and Assign Task to user 2', async () => {
await base.step('Create, Close and Assign Task to user 2', async () => {
await redirectToHomePage(page1);
await entity2.visitEntityPage(page1);
@ -624,7 +639,7 @@ test.describe('Activity feed with Data Steward User', () => {
await afterActionUser1();
});
await test.step(
await base.step(
'Accept Task By user 2 with adding suggestions',
async () => {
await redirectToHomePage(page2);

View File

@ -0,0 +1,9 @@
<svg viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M26.4905 23.3199L24.0161 20.8342C23.9592 20.7763 23.8902 20.7316 23.8141 20.7033C23.738 20.675 23.6565 20.6637 23.5756 20.6703C23.4946 20.6763 23.4159 20.6999 23.3449 20.7392C23.2739 20.7786 23.2122 20.8328 23.1641 20.8982C22.5289 21.7609 21.7619 22.5184 20.8914 23.1428C20.8252 23.1904 20.7703 23.2519 20.7302 23.3229C20.6902 23.3938 20.6661 23.4727 20.6595 23.5539C20.653 23.6352 20.6642 23.7168 20.6923 23.7933C20.7204 23.8698 20.7648 23.9393 20.8224 23.9969L23.3171 26.4917C23.3693 26.5439 23.4313 26.5853 23.4996 26.6136C23.5678 26.6419 23.641 26.6565 23.7148 26.6565C23.7887 26.6565 23.8618 26.6419 23.9301 26.6136C23.9983 26.5853 24.0603 26.5439 24.1125 26.4917L26.4897 24.1145C26.5951 24.0092 26.6543 23.8664 26.6545 23.7174C26.6546 23.5684 26.5957 23.4255 26.4905 23.3199Z" fill="#35198E"/>
<path d="M14.2734 27.2109C21.4186 27.2109 27.2109 21.4186 27.2109 14.2734C27.2109 7.12825 21.4186 1.33594 14.2734 1.33594C7.12825 1.33594 1.33594 7.12825 1.33594 14.2734C1.33594 21.4186 7.12825 27.2109 14.2734 27.2109Z" fill="#0968DA"/>
<path d="M14.2734 24.9609C20.176 24.9609 24.9609 20.176 24.9609 14.2734C24.9609 8.37089 20.176 3.58594 14.2734 3.58594C8.37089 3.58594 3.58594 8.37089 3.58594 14.2734C3.58594 20.176 8.37089 24.9609 14.2734 24.9609Z" fill="#EEEEEE"/>
<path d="M33.6515 28.8819L28.4794 23.7156L23.7135 28.482L28.8795 33.6541C29.192 33.9689 29.5639 34.2185 29.9735 34.3885C30.3832 34.5585 30.8225 34.6455 31.2661 34.6445H31.2677C31.9353 34.6445 32.5879 34.4464 33.143 34.0753C33.698 33.7042 34.1304 33.1769 34.3856 32.5599C34.6408 31.943 34.7073 31.2642 34.5766 30.6095C34.4459 29.9548 34.124 29.3536 33.6515 28.8819Z" fill="#0968DA"/>
<path d="M28.0805 23.3175C27.7636 23.002 27.3346 22.8247 26.8875 22.825C26.4403 22.8252 26.0115 23.0027 25.695 23.3186L23.3154 25.6977C22.9998 26.0143 22.8225 26.4432 22.8224 26.8903C22.8223 27.3374 22.9994 27.7663 23.3148 28.0831L24.5082 29.2781L29.2752 24.5109L28.0805 23.3175Z" fill="#35198E"/>
<path d="M21.0234 12.5859H20.2275C20.0963 12.1231 19.911 11.6774 19.6754 11.258L20.2393 10.6938C20.4492 10.4822 20.567 10.1963 20.567 9.89833C20.5671 9.60032 20.4494 9.31437 20.2396 9.10272L19.4442 8.30731C19.2331 8.0964 18.947 7.97793 18.6486 7.97793C18.3503 7.97793 18.0641 8.0964 17.8531 8.30731L17.2889 8.87146C16.8695 8.63595 16.4237 8.45064 15.9609 8.31937V7.52344C15.9606 7.22516 15.842 6.93919 15.6311 6.72827C15.4202 6.51736 15.1342 6.39874 14.8359 6.39844H13.7109C13.4127 6.39874 13.1267 6.51736 12.9158 6.72827C12.7049 6.93919 12.5862 7.22516 12.5859 7.52344V8.31937C12.1231 8.45059 11.6774 8.63589 11.258 8.87143L10.6938 8.30756C10.4796 8.10273 10.1947 7.9884 9.89833 7.98834C9.60196 7.98829 9.31699 8.10253 9.10272 8.30729L8.30731 9.1027C8.09757 9.3143 7.9799 9.60018 7.9799 9.89811C7.9799 10.196 8.09757 10.4819 8.30731 10.6935L8.87146 11.2579C8.6359 11.6774 8.45059 12.1231 8.31937 12.5859H7.52344C7.22516 12.5862 6.93919 12.7049 6.72827 12.9158C6.51736 13.1267 6.39874 13.4127 6.39844 13.7109V14.8359C6.39874 15.1342 6.51736 15.4202 6.72827 15.6311C6.93919 15.842 7.22516 15.9606 7.52344 15.9609H8.31937C8.45059 16.4237 8.63589 16.8695 8.87143 17.2889L8.30756 17.8531C8.09769 18.0646 7.97991 18.3505 7.97986 18.6485C7.97981 18.9466 8.09749 19.2325 8.30729 19.4442L9.1027 20.2396C9.31694 20.4442 9.60182 20.5584 9.89811 20.5584C10.1944 20.5584 10.4793 20.4442 10.6935 20.2396L11.2579 19.6754C11.6774 19.911 12.1231 20.0963 12.5859 20.2275V21.0234C12.5862 21.3217 12.7049 21.6077 12.9158 21.8186C13.1267 22.0295 13.4127 22.1481 13.7109 22.1484H14.8359C15.1342 22.1481 15.4202 22.0295 15.6311 21.8186C15.842 21.6077 15.9606 21.3217 15.9609 21.0234V20.2275C16.4237 20.0962 16.8695 19.9109 17.2889 19.6754L17.8531 20.2396C18.0641 20.4505 18.3502 20.569 18.6486 20.569C18.947 20.569 19.2331 20.4505 19.4442 20.2396L20.2396 19.4442C20.4493 19.2326 20.567 18.9467 20.567 18.6488C20.567 18.3508 20.4493 18.065 20.2396 17.8534L19.6754 17.2889C19.911 16.8695 20.0963 16.4238 20.2275 15.9609H21.0234C21.3217 15.9606 21.6077 15.842 21.8186 15.6311C22.0295 15.4202 22.1481 15.1342 22.1484 14.8359V13.7109C22.1481 13.4127 22.0295 13.1267 21.8186 12.9158C21.6077 12.7049 21.3217 12.5862 21.0234 12.5859Z" fill="#78909C"/>
<path d="M14.2734 17.6484C16.1374 17.6484 17.6484 16.1374 17.6484 14.2734C17.6484 12.4095 16.1374 10.8984 14.2734 10.8984C12.4095 10.8984 10.8984 12.4095 10.8984 14.2734C10.8984 16.1374 12.4095 17.6484 14.2734 17.6484Z" fill="#EEEEEE"/>
</svg>

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -93,6 +93,7 @@ import iconDefaultService from '../assets/svg/default-service-icon.svg';
import elasticSearch from '../assets/svg/elasticsearch.svg';
import databaseDefault from '../assets/svg/ic-custom-database.svg';
import mlModelDefault from '../assets/svg/ic-custom-model.svg';
import searchDefault from '../assets/svg/ic-custom-search.svg';
import storageDefault from '../assets/svg/ic-custom-storage.svg';
import restService from '../assets/svg/ic-service-rest-api.svg';
import logo from '../assets/svg/logo-monogram.svg';
@ -210,6 +211,7 @@ export const COUCHBASE = couchbase;
export const GREENPLUM = greenplum;
export const ELASTIC_SEARCH = elasticSearch;
export const OPEN_SEARCH = openSearch;
export const CUSTOM_SEARCH_DEFAULT = searchDefault;
export const PLUS = plus;
export const NOSERVICE = noService;
export const ICEBERGE = iceberge;

View File

@ -25,6 +25,7 @@ import {
BIGTABLE,
CLICKHOUSE,
COUCHBASE,
CUSTOM_SEARCH_DEFAULT,
CUSTOM_STORAGE_DEFAULT,
DAGSTER,
DASHBOARD_DEFAULT,
@ -477,6 +478,9 @@ class ServiceUtilClassBase {
case this.StorageServiceTypeSmallCase.Gcs:
return GCS;
case this.SearchServiceTypeSmallCase.CustomSearch:
return CUSTOM_SEARCH_DEFAULT;
case this.SearchServiceTypeSmallCase.ElasticSearch:
return ELASTIC_SEARCH;
@ -500,6 +504,8 @@ class ServiceUtilClassBase {
logo = ML_MODEL_DEFAULT;
} else if (serviceTypes.storageServices.includes(type)) {
logo = CUSTOM_STORAGE_DEFAULT;
} else if (serviceTypes.searchServices.includes(type)) {
logo = CUSTOM_SEARCH_DEFAULT;
} else {
logo = DEFAULT_SERVICE;
}