mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-27 02:16:18 +00:00
Replacing cy.wait with api wait (#7460)
* services wait * changing project id * fixing flaky bigquery test * Changing flaky tests * test * test * Custom properties and change in services test wait * Entity details wait * Glossary api wait * minor changes for glossary * mydata api wait * policies api wait * mydata page changes * Roles and services api wait * Tags and teams api wait * Users api wait * tags page failure fix * minor code change for users * test fail fix * test fail fix * removing it.only * removing timeout and reducing wait timeout * changing description element to constant &test fix * removing timeout on wait * Teams page fix * changing the project id * changing api intercept url for flaky tests * bigquery test fail fix * fix flaky tests * changing project id
This commit is contained in:
parent
898e596c1c
commit
3c788b02dd
@ -12,13 +12,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
export const descriptionBox =
|
||||||
|
'.toastui-editor-md-container > .toastui-editor > .ProseMirror';
|
||||||
export const uuid = () => Cypress._.random(0, 1e6);
|
export const uuid = () => Cypress._.random(0, 1e6);
|
||||||
|
|
||||||
const AARON_JOHNSON = 'Aaron Johnson';
|
const AARON_JOHNSON = 'Aaron Johnson';
|
||||||
|
|
||||||
const isDatabaseService = (type) => type === 'database';
|
const isDatabaseService = (type) => type === 'database';
|
||||||
|
|
||||||
|
//intercepting URL with cy.intercept
|
||||||
|
export const interceptURL = (method, url, alias) => {
|
||||||
|
cy.intercept({ method: method, url: url }).as(alias);
|
||||||
|
};
|
||||||
|
|
||||||
|
//waiting for response and validating the response status code
|
||||||
|
export const verifyResponseStatusCode = (alias, responseCode) => {
|
||||||
|
cy.wait(alias).its('response.statusCode').should('eq', responseCode);
|
||||||
|
};
|
||||||
|
|
||||||
export const handleIngestionRetry = (type, testIngestionButton, count = 0) => {
|
export const handleIngestionRetry = (type, testIngestionButton, count = 0) => {
|
||||||
// ingestions page
|
// ingestions page
|
||||||
const retryTimes = 25;
|
const retryTimes = 25;
|
||||||
@ -166,11 +177,15 @@ export const deleteCreatedService = (typeOfService, service_Name) => {
|
|||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
|
|
||||||
// Services page
|
// Services page
|
||||||
|
interceptURL('GET', '/api/v1/services/*', 'getServices');
|
||||||
|
|
||||||
cy.get('.ant-menu-title-content')
|
cy.get('.ant-menu-title-content')
|
||||||
.contains(typeOfService)
|
.contains(typeOfService)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getServices', 200);
|
||||||
|
|
||||||
//click on created service
|
//click on created service
|
||||||
cy.get(`[data-testid="service-name-${service_Name}"]`)
|
cy.get(`[data-testid="service-name-${service_Name}"]`)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
@ -185,14 +200,13 @@ export const deleteCreatedService = (typeOfService, service_Name) => {
|
|||||||
expect(text).to.equal(service_Name);
|
expect(text).to.equal(service_Name);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getServices', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="service-delete"]')
|
cy.get('[data-testid="service-delete"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
|
||||||
//Clicking on permanent delete radio button and checking the service name
|
//Clicking on permanent delete radio button and checking the service name
|
||||||
cy.get('[data-testid="hard-delete-option"]')
|
cy.get('[data-testid="hard-delete-option"]')
|
||||||
.contains(service_Name)
|
.contains(service_Name)
|
||||||
@ -203,18 +217,17 @@ export const deleteCreatedService = (typeOfService, service_Name) => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('DELETE');
|
.type('DELETE');
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/*', 'homePage');
|
||||||
|
|
||||||
cy.get('[data-testid="confirm-button"]').should('be.visible').click();
|
cy.get('[data-testid="confirm-button"]').should('be.visible').click();
|
||||||
cy.wait(2000);
|
|
||||||
cy.get('[class="Toastify__toast-body"] >div')
|
cy.get('.Toastify__toast-body')
|
||||||
.eq(1)
|
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.should('have.text', `${typeOfService} Service deleted successfully!`);
|
.should('have.text', `${typeOfService} Service deleted successfully!`);
|
||||||
|
cy.url().should('eq', 'http://localhost:8585/my-data');
|
||||||
|
verifyResponseStatusCode('@homePage', 200);
|
||||||
//Checking if the service got deleted successfully
|
//Checking if the service got deleted successfully
|
||||||
cy.clickOnLogo();
|
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
//Click on settings page
|
//Click on settings page
|
||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
|
|
||||||
@ -239,13 +252,21 @@ export const editOwnerforCreatedService = (service_type, service_Name) => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/services/*/name/${service_Name}*`,
|
||||||
|
'getSelectedService'
|
||||||
|
);
|
||||||
|
|
||||||
//click on created service
|
//click on created service
|
||||||
cy.get(`[data-testid="service-name-${service_Name}"]`)
|
cy.get(`[data-testid="service-name-${service_Name}"]`)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getSelectedService', 200);
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/users/loggedInUser/groupTeams', 'waitForUsers');
|
||||||
|
|
||||||
//Click on edit owner button
|
//Click on edit owner button
|
||||||
cy.get('[data-testid="edit-Owner-icon"]')
|
cy.get('[data-testid="edit-Owner-icon"]')
|
||||||
@ -253,7 +274,8 @@ export const editOwnerforCreatedService = (service_type, service_Name) => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@waitForUsers', 200);
|
||||||
|
|
||||||
//Clicking on users tab
|
//Clicking on users tab
|
||||||
cy.get('[data-testid="dropdown-tab"]')
|
cy.get('[data-testid="dropdown-tab"]')
|
||||||
.contains('Users')
|
.contains('Users')
|
||||||
@ -266,7 +288,6 @@ export const editOwnerforCreatedService = (service_type, service_Name) => {
|
|||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
cy.get('[data-testid="owner-dropdown"]')
|
cy.get('[data-testid="owner-dropdown"]')
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
@ -352,7 +373,8 @@ export const addNewTagToEntity = (entity, term) => {
|
|||||||
searchEntity(entity);
|
searchEntity(entity);
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
cy.get('[data-testid="table-link"]').first().contains(entity).click();
|
cy.get('[data-testid="table-link"]').first().contains(entity).click();
|
||||||
cy.get('[data-testid="tags"] > [data-testid="add-tag"]').eq(0)
|
cy.get('[data-testid="tags"] > [data-testid="add-tag"]')
|
||||||
|
.eq(0)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.click();
|
.click();
|
||||||
@ -400,7 +422,7 @@ export const addUser = (username, email) => {
|
|||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(username);
|
.type(username);
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('Adding user');
|
.type('Adding user');
|
||||||
@ -409,12 +431,13 @@ export const addUser = (username, email) => {
|
|||||||
|
|
||||||
export const softDeleteUser = (username) => {
|
export const softDeleteUser = (username) => {
|
||||||
//Search the created user
|
//Search the created user
|
||||||
|
interceptURL('GET', '/api/v1/search/query*', 'searchUser');
|
||||||
cy.get('[data-testid="searchbar"]')
|
cy.get('[data-testid="searchbar"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(username);
|
.type(username);
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@searchUser', 200);
|
||||||
|
|
||||||
//Click on delete button
|
//Click on delete button
|
||||||
cy.get('.ant-table-row .ant-table-cell button')
|
cy.get('.ant-table-row .ant-table-cell button')
|
||||||
@ -425,12 +448,15 @@ export const softDeleteUser = (username) => {
|
|||||||
//Soft deleting the user
|
//Soft deleting the user
|
||||||
cy.get('[data-testid="soft-delete"]').click();
|
cy.get('[data-testid="soft-delete"]').click();
|
||||||
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
||||||
|
|
||||||
|
interceptURL('DELETE', '/api/v1/users/*', 'softdeleteUser');
|
||||||
|
interceptURL('GET', '/api/v1/users*', 'userDeleted');
|
||||||
cy.get('[data-testid="confirm-button"]')
|
cy.get('[data-testid="confirm-button"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@softdeleteUser', 200);
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@userDeleted', 200);
|
||||||
|
|
||||||
cy.get('.Toastify__toast-body > :nth-child(2)').should(
|
cy.get('.Toastify__toast-body > :nth-child(2)').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
@ -443,6 +469,8 @@ export const softDeleteUser = (username) => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/search/query*', 'searchUser');
|
||||||
|
|
||||||
//Verifying the deleted user
|
//Verifying the deleted user
|
||||||
cy.get('[data-testid="searchbar"]')
|
cy.get('[data-testid="searchbar"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
@ -450,7 +478,7 @@ export const softDeleteUser = (username) => {
|
|||||||
.clear()
|
.clear()
|
||||||
.type(username);
|
.type(username);
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@searchUser', 200);
|
||||||
cy.get('.ant-table-placeholder > .ant-table-cell').should(
|
cy.get('.ant-table-placeholder > .ant-table-cell').should(
|
||||||
'not.contain',
|
'not.contain',
|
||||||
username
|
username
|
||||||
@ -459,19 +487,21 @@ export const softDeleteUser = (username) => {
|
|||||||
|
|
||||||
export const restoreUser = (username) => {
|
export const restoreUser = (username) => {
|
||||||
//Click on deleted user toggle
|
//Click on deleted user toggle
|
||||||
|
interceptURL('GET', '/api/v1/users*', 'deletedUser');
|
||||||
cy.get('.ant-switch-handle').should('exist').should('be.visible').click();
|
cy.get('.ant-switch-handle').should('exist').should('be.visible').click();
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@deletedUser', 200);
|
||||||
|
|
||||||
cy.get('button [alt="Restore"]').should('exist').should('be.visible').click();
|
cy.get('button [alt="Restore"]').should('exist').should('be.visible').click();
|
||||||
cy.get('.ant-modal-body > p').should(
|
cy.get('.ant-modal-body > p').should(
|
||||||
'contain',
|
'contain',
|
||||||
`Are you sure you want to restore ${username}?`
|
`Are you sure you want to restore ${username}?`
|
||||||
);
|
);
|
||||||
|
interceptURL('PUT', '/api/v1/users', 'restoreUser');
|
||||||
cy.get('.ant-modal-footer > .ant-btn-primary')
|
cy.get('.ant-modal-footer > .ant-btn-primary')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@restoreUser', 200);
|
||||||
cy.get('.Toastify__toast-body > :nth-child(2)').should(
|
cy.get('.Toastify__toast-body > :nth-child(2)').should(
|
||||||
'contain',
|
'contain',
|
||||||
'User restored successfully!'
|
'User restored successfully!'
|
||||||
@ -486,12 +516,13 @@ export const restoreUser = (username) => {
|
|||||||
//Verifying the restored user
|
//Verifying the restored user
|
||||||
cy.get('.ant-switch').should('exist').should('be.visible').click();
|
cy.get('.ant-switch').should('exist').should('be.visible').click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/search/query*', 'searchUser');
|
||||||
cy.get('[data-testid="searchbar"]')
|
cy.get('[data-testid="searchbar"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(username);
|
.type(username);
|
||||||
|
verifyResponseStatusCode('@searchUser', 200);
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('.ant-table-row > :nth-child(1)').should('contain', username);
|
cy.get('.ant-table-row > :nth-child(1)').should('contain', username);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -561,11 +592,13 @@ export const addCustomPropertiesForEntity = (entityType, customType, value) => {
|
|||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(entityType.description);
|
.type(entityType.description);
|
||||||
|
//Check if the property got added
|
||||||
|
cy.intercept('/api/v1/metadata/types/name/*?fields=customProperties').as(
|
||||||
|
'customProperties'
|
||||||
|
);
|
||||||
cy.get('[data-testid="create-custom-field"]').scrollIntoView().click();
|
cy.get('[data-testid="create-custom-field"]').scrollIntoView().click();
|
||||||
|
|
||||||
//Check if the property got added
|
cy.wait('@customProperties');
|
||||||
cy.intercept('/api/v1/metadata/types/name/*?fields=customProperties').as("customProperties");
|
|
||||||
cy.wait("@customProperties");
|
|
||||||
cy.get('[data-testid="data-row"]').should('contain', propertyName);
|
cy.get('[data-testid="data-row"]').should('contain', propertyName);
|
||||||
|
|
||||||
//Navigating to home page
|
//Navigating to home page
|
||||||
@ -649,14 +682,16 @@ export const editCreatedProperty = (propertyName) => {
|
|||||||
|
|
||||||
cy.get('@editbutton').click();
|
cy.get('@editbutton').click();
|
||||||
|
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.clear()
|
.clear()
|
||||||
.type('This is new description');
|
.type('This is new description');
|
||||||
|
|
||||||
|
interceptURL('PATCH', '/api/v1/metadata/types/*', 'checkPatchForDescription');
|
||||||
|
|
||||||
cy.get('[data-testid="save"]').should('be.visible').click();
|
cy.get('[data-testid="save"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@checkPatchForDescription', 200);
|
||||||
|
|
||||||
//Fetching for updated descriptions for the created custom property
|
//Fetching for updated descriptions for the created custom property
|
||||||
cy.get('[data-testid="table-body"]')
|
cy.get('[data-testid="table-body"]')
|
||||||
@ -695,11 +730,11 @@ export const updateOwner = () => {
|
|||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((text) => {
|
.then((text) => {
|
||||||
cy.get('[data-testid="hiden-layer"]').should('exist').click();
|
cy.get('[data-testid="hiden-layer"]').should('exist').click();
|
||||||
|
interceptURL('GET', '/api/v1/users/loggedInUser/groupTeams', 'getUser');
|
||||||
//Clicking on edit owner button
|
//Clicking on edit owner button
|
||||||
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getUser', 200);
|
||||||
|
|
||||||
//Clicking on users tab
|
//Clicking on users tab
|
||||||
cy.get('button[data-testid="dropdown-tab"]')
|
cy.get('button[data-testid="dropdown-tab"]')
|
||||||
@ -708,14 +743,12 @@ export const updateOwner = () => {
|
|||||||
.contains('Users')
|
.contains('Users')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.get('[data-testid="list-item"]').first()
|
cy.get('[data-testid="list-item"]')
|
||||||
|
.first()
|
||||||
.should('contain', text.trim())
|
.should('contain', text.trim())
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
//Asserting the added name
|
//Asserting the added name
|
||||||
cy.get('[data-testid="owner-link"]').should(
|
cy.get('[data-testid="owner-link"]').should('contain', text.trim());
|
||||||
'contain',
|
|
||||||
text.trim()
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
@ -147,7 +147,7 @@ export const service = {
|
|||||||
name: 'Glue',
|
name: 'Glue',
|
||||||
description: 'This is a Glue service',
|
description: 'This is a Glue service',
|
||||||
newDescription: 'This is updated Glue service description',
|
newDescription: 'This is updated Glue service description',
|
||||||
Owner: 'Cloud_Infra',
|
Owner: 'Aaron Johnson',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SERVICE_TYPE = {
|
export const SERVICE_TYPE = {
|
||||||
|
@ -11,26 +11,35 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { addCustomPropertiesForEntity, deleteCreatedProperty, editCreatedProperty } from '../../common/common';
|
import { addCustomPropertiesForEntity, deleteCreatedProperty, editCreatedProperty, interceptURL, verifyResponseStatusCode } from '../../common/common';
|
||||||
import { ENTITIES } from '../../constants/constants';
|
import { ENTITIES } from '../../constants/constants';
|
||||||
|
|
||||||
describe('Custom Properties should work properly', () => {
|
describe('Custom Properties should work properly', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/users*', 'getTeams');
|
||||||
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@getTeams', 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Add Integer custom property for all Entities', () => {
|
it('Add Integer custom property for all Entities', () => {
|
||||||
Object.values(ENTITIES).forEach((entity) => {
|
Object.values(ENTITIES).forEach((entity) => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/metadata/types/name/${entity.name}*`,
|
||||||
|
'getEntity'
|
||||||
|
);
|
||||||
//Selecting the entity
|
//Selecting the entity
|
||||||
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
//Getting the property
|
//Getting the property
|
||||||
const propertyName = addCustomPropertiesForEntity(
|
const propertyName = addCustomPropertiesForEntity(
|
||||||
entity,
|
entity,
|
||||||
@ -45,7 +54,8 @@ describe('Custom Properties should work properly', () => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
editCreatedProperty(propertyName);
|
editCreatedProperty(propertyName);
|
||||||
|
|
||||||
@ -55,12 +65,20 @@ describe('Custom Properties should work properly', () => {
|
|||||||
|
|
||||||
it('Add String custom property for all Entities', () => {
|
it('Add String custom property for all Entities', () => {
|
||||||
Object.values(ENTITIES).forEach((entity) => {
|
Object.values(ENTITIES).forEach((entity) => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/metadata/types/name/${entity.name}*`,
|
||||||
|
'getEntity'
|
||||||
|
);
|
||||||
|
|
||||||
//Selecting the entity
|
//Selecting the entity
|
||||||
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
const propertyName = addCustomPropertiesForEntity(
|
const propertyName = addCustomPropertiesForEntity(
|
||||||
entity,
|
entity,
|
||||||
'string',
|
'string',
|
||||||
@ -76,7 +94,8 @@ describe('Custom Properties should work properly', () => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
editCreatedProperty(propertyName);
|
editCreatedProperty(propertyName);
|
||||||
|
|
||||||
@ -86,11 +105,20 @@ describe('Custom Properties should work properly', () => {
|
|||||||
|
|
||||||
it('Add Markdown custom property for all Entities', () => {
|
it('Add Markdown custom property for all Entities', () => {
|
||||||
Object.values(ENTITIES).forEach((entity) => {
|
Object.values(ENTITIES).forEach((entity) => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/metadata/types/name/${entity.name}*`,
|
||||||
|
'getEntity'
|
||||||
|
);
|
||||||
|
|
||||||
//Selecting the entity
|
//Selecting the entity
|
||||||
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
cy.get(`[data-menu-id*="customAttributes.${entity.name}"]`)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
const propertyName = addCustomPropertiesForEntity(
|
const propertyName = addCustomPropertiesForEntity(
|
||||||
entity,
|
entity,
|
||||||
'markdown',
|
'markdown',
|
||||||
@ -104,7 +132,8 @@ describe('Custom Properties should work properly', () => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@getEntity', 200);
|
||||||
|
|
||||||
editCreatedProperty(propertyName);
|
editCreatedProperty(propertyName);
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { searchEntity } from '../../common/common';
|
import { descriptionBox, interceptURL, searchEntity, verifyResponseStatusCode } from '../../common/common';
|
||||||
import { DELETE_ENTITY, DELETE_TERM } from '../../constants/constants';
|
import { DELETE_ENTITY, DELETE_TERM } from '../../constants/constants';
|
||||||
|
|
||||||
describe('Entity Details Page', () => {
|
describe('Entity Details Page', () => {
|
||||||
@ -29,18 +29,19 @@ describe('Entity Details Page', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.should('have.class', 'active')
|
.should('have.class', 'active')
|
||||||
.click();
|
.click();
|
||||||
|
interceptURL('GET', '/api/v1/feed*', 'getEntityDetails');
|
||||||
cy.wait(500);
|
|
||||||
|
|
||||||
//Click on manage button
|
//Click on manage button
|
||||||
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
cy.get('[data-testid="manage-button"]')
|
cy.get('[data-testid="manage-button"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
cy.get('[data-menu-id*="delete-button"]')
|
||||||
|
.should('exist')
|
||||||
|
.should('be.visible');
|
||||||
// check for delete section and delete button is available or not
|
// check for delete section and delete button is available or not
|
||||||
// cy.get('[data-testid="danger-zone"]').scrollIntoView().should('be.visible');
|
// cy.get('[data-testid="danger-zone"]').scrollIntoView().should('be.visible');
|
||||||
cy.get('[data-testid="delete-button-title"]')
|
cy.get('[data-testid="delete-button-title"]')
|
||||||
@ -48,8 +49,6 @@ describe('Entity Details Page', () => {
|
|||||||
.click()
|
.click()
|
||||||
.as('deleteBtn');
|
.as('deleteBtn');
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
cy.get('[data-testid="hard-delete-option"]')
|
cy.get('[data-testid="hard-delete-option"]')
|
||||||
.should('contain', `Permanently Delete ${singuler} “${value.term}”`)
|
.should('contain', `Permanently Delete ${singuler} “${value.term}”`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -82,7 +81,9 @@ describe('Entity Details Page', () => {
|
|||||||
// open modal and type required text in input box to delete entity
|
// open modal and type required text in input box to delete entity
|
||||||
|
|
||||||
cy.get('@deleteBtn').click();
|
cy.get('@deleteBtn').click();
|
||||||
cy.wait(1000);
|
cy.get('[data-menu-id*="delete-button"]')
|
||||||
|
.should('exist')
|
||||||
|
.should('be.visible');
|
||||||
cy.get('@permanentDelete').click();
|
cy.get('@permanentDelete').click();
|
||||||
cy.get('@textBox').type(DELETE_TERM);
|
cy.get('@textBox').type(DELETE_TERM);
|
||||||
cy.get('@confirmBtn').should('not.be.disabled');
|
cy.get('@confirmBtn').should('not.be.disabled');
|
||||||
@ -129,13 +130,21 @@ describe('Entity Details Page', () => {
|
|||||||
.should('have.class', 'active')
|
.should('have.class', 'active')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/feed*', 'getEntityDetails');
|
||||||
|
|
||||||
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
|
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
'/api/v1/users/loggedInUser/groupTeams',
|
||||||
|
'waitForUsers'
|
||||||
|
);
|
||||||
|
|
||||||
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@waitForUsers', 200);
|
||||||
//Clicking on users tab
|
//Clicking on users tab
|
||||||
cy.get('[data-testid="dropdown-tab"]')
|
cy.get('[data-testid="dropdown-tab"]')
|
||||||
.contains('Users')
|
.contains('Users')
|
||||||
@ -143,12 +152,14 @@ describe('Entity Details Page', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('PATCH', '/api/v1/tables/*', 'validateOwner');
|
||||||
//Selecting the user
|
//Selecting the user
|
||||||
cy.get('[data-testid="list-item"]')
|
cy.get('[data-testid="list-item"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@validateOwner', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="owner-link"]')
|
cy.get('[data-testid="owner-link"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
@ -157,8 +168,6 @@ describe('Entity Details Page', () => {
|
|||||||
expect(text).equal('Aaron Johnson');
|
expect(text).equal('Aaron Johnson');
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
cy.get('[data-testid="edit-Tier-icon"]')
|
cy.get('[data-testid="edit-Tier-icon"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('exist')
|
.should('exist')
|
||||||
@ -178,16 +187,17 @@ describe('Entity Details Page', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
cy.get('[data-testid="entity-tags"]').should('contain', 'Tier1');
|
cy.get('[data-testid="entity-tags"]').should('contain', 'Tier1');
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
// Test out the activity feed and task tab
|
// Test out the activity feed and task tab
|
||||||
cy.get('[data-testid="Activity Feeds & Tasks"]').should('be.visible').click()
|
cy.get('[data-testid="Activity Feeds & Tasks"]')
|
||||||
|
.should('be.visible')
|
||||||
|
.click();
|
||||||
// Check for tab count
|
// Check for tab count
|
||||||
cy.get('[data-testid=filter-count').should('be.visible').contains("2")
|
cy.get('[data-testid=filter-count').should('be.visible').contains('2');
|
||||||
|
|
||||||
// Check for activity feeds - count should be 2
|
// Check for activity feeds - count should be 2
|
||||||
// 1 for tier change and 1 for owner change
|
// 1 for tier change and 1 for owner change
|
||||||
cy.get('[data-testid="message-container"]').its('length').should("eq",2)
|
cy.get('[data-testid="message-container"]').its('length').should('eq', 2);
|
||||||
|
|
||||||
cy.clickOnLogo();
|
cy.clickOnLogo();
|
||||||
|
|
||||||
@ -207,9 +217,11 @@ describe('Entity Details Page', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const addAnnouncement = (value) => {
|
const addAnnouncement = (value) => {
|
||||||
const currentDate = Date.now()
|
const currentDate = Date.now();
|
||||||
const startDate = moment(currentDate, 'x').format('yyyy-MM-DDThh:mm');
|
const startDate = moment(currentDate, 'x').format('yyyy-MM-DDThh:mm');
|
||||||
const endDate=moment(currentDate, 'x').add(5, 'days').format('yyyy-MM-DDThh:mm');
|
const endDate = moment(currentDate, 'x')
|
||||||
|
.add(5, 'days')
|
||||||
|
.format('yyyy-MM-DDThh:mm');
|
||||||
searchEntity(value.term);
|
searchEntity(value.term);
|
||||||
cy.get(`[data-testid="${value.entity}-tab"]`).should('be.visible').click();
|
cy.get(`[data-testid="${value.entity}-tab"]`).should('be.visible').click();
|
||||||
cy.get(`[data-testid="${value.entity}-tab"]`)
|
cy.get(`[data-testid="${value.entity}-tab"]`)
|
||||||
@ -217,35 +229,43 @@ describe('Entity Details Page', () => {
|
|||||||
.should('have.class', 'active')
|
.should('have.class', 'active')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/feed*', 'getEntityDetails');
|
||||||
|
|
||||||
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
cy.get('[data-testid="table-link"]').first().should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
|
|
||||||
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
||||||
|
cy.get('[data-testid="announcement-button"]').should('be.visible').click();
|
||||||
|
cy.get('.ant-empty-description')
|
||||||
|
.should('be.visible')
|
||||||
|
.contains('No Announcements, Click on add announcement to add one.');
|
||||||
|
cy.get('[data-testid="add-announcement"]').should('be.visible').click();
|
||||||
|
cy.get('.ant-modal-header')
|
||||||
|
.should('be.visible')
|
||||||
|
.contains('Make an announcement');
|
||||||
|
cy.get('.ant-modal-body').should('be.visible');
|
||||||
|
cy.get('#title').should('be.visible').type('Announcement Title');
|
||||||
|
cy.get('#startDate').should('be.visible').type(startDate);
|
||||||
|
cy.get('#endtDate').should('be.visible').type(endDate);
|
||||||
|
cy.get(descriptionBox).type('Description');
|
||||||
|
|
||||||
|
cy.get('.ant-modal-footer > .ant-btn-primary')
|
||||||
|
.should('be.visible')
|
||||||
|
.contains('Submit')
|
||||||
|
.scrollIntoView()
|
||||||
|
.click();
|
||||||
|
|
||||||
cy.get('[data-testid="manage-button"]').should('be.visible').click()
|
|
||||||
cy.get('[data-testid="announcement-button"]').should('be.visible').click()
|
|
||||||
cy.get('.ant-empty-description').should('be.visible').contains("No Announcements, Click on add announcement to add one.")
|
|
||||||
cy.get('[data-testid="add-announcement"]').should('be.visible').click()
|
|
||||||
cy.get('.ant-modal-header').should('be.visible').contains("Make an announcement")
|
|
||||||
cy.get('.ant-modal-body').should('be.visible')
|
|
||||||
cy.get('#title').should('be.visible').type("Announcement Title")
|
|
||||||
cy.get('#startDate').should('be.visible').type(startDate)
|
|
||||||
cy.get('#endtDate').should('be.visible').type(endDate)
|
|
||||||
cy.get(
|
|
||||||
'.toastui-editor-md-container > .toastui-editor > .ProseMirror'
|
|
||||||
).type("Description");
|
|
||||||
|
|
||||||
cy.get('.ant-modal-footer > .ant-btn-primary').should('be.visible').contains("Submit").scrollIntoView().click();
|
|
||||||
|
|
||||||
cy.wait(5000);
|
cy.wait(5000);
|
||||||
|
|
||||||
cy.get('.anticon > svg').should("be.visible").click()
|
cy.get('.anticon > svg').should('be.visible').click();
|
||||||
|
|
||||||
// reload page to get the active announcement card
|
// reload page to get the active announcement card
|
||||||
cy.reload()
|
cy.reload();
|
||||||
|
|
||||||
// check for announcement card on entity page
|
// check for announcement card on entity page
|
||||||
cy.get('[data-testid="announcement-card"]').should("be.visible")
|
cy.get('[data-testid="announcement-card"]').should('be.visible');
|
||||||
|
|
||||||
cy.clickOnLogo();
|
cy.clickOnLogo();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -259,7 +279,7 @@ describe('Entity Details Page', () => {
|
|||||||
Object.values(DELETE_ENTITY).forEach((value) => {
|
Object.values(DELETE_ENTITY).forEach((value) => {
|
||||||
addAnnouncement(value);
|
addAnnouncement(value);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Delete entity flow should work properly', () => {
|
it('Delete entity flow should work properly', () => {
|
||||||
Object.values(DELETE_ENTITY).forEach((value) => {
|
Object.values(DELETE_ENTITY).forEach((value) => {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { searchEntity } from '../../common/common';
|
import { descriptionBox, interceptURL, searchEntity, verifyResponseStatusCode } from '../../common/common';
|
||||||
import { DELETE_TERM, NEW_GLOSSARY, NEW_GLOSSARY_TERMS, SEARCH_ENTITY_TABLE } from '../../constants/constants';
|
import { DELETE_TERM, NEW_GLOSSARY, NEW_GLOSSARY_TERMS, SEARCH_ENTITY_TABLE } from '../../constants/constants';
|
||||||
|
|
||||||
const createGlossaryTerm = (term) => {
|
const createGlossaryTerm = (term) => {
|
||||||
@ -26,7 +26,7 @@ const createGlossaryTerm = (term) => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(term.name);
|
.type(term.name);
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(term.description);
|
.type(term.description);
|
||||||
@ -46,11 +46,13 @@ const createGlossaryTerm = (term) => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('https://test.com');
|
.type('https://test.com');
|
||||||
|
|
||||||
|
interceptURL('POST', '/api/v1/glossaryTerms', 'createGlossaryTerms');
|
||||||
cy.get('[data-testid="save-glossary-term"]')
|
cy.get('[data-testid="save-glossary-term"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(200);
|
verifyResponseStatusCode('@createGlossaryTerms', 201);
|
||||||
|
|
||||||
cy.get('#left-panelV1').contains(term.name).should('be.visible');
|
cy.get('#left-panelV1').contains(term.name).should('be.visible');
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -124,7 +126,7 @@ describe('Glossary page should work properly', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(NEW_GLOSSARY.name);
|
.type(NEW_GLOSSARY.name);
|
||||||
|
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(NEW_GLOSSARY.description);
|
.type(NEW_GLOSSARY.description);
|
||||||
@ -178,11 +180,13 @@ describe('Glossary page should work properly', () => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.get('[class*="-control"]')
|
cy.get('[class*="-control"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('personal');
|
.type('personal');
|
||||||
cy.wait(500);
|
cy.get('[id*="-option-0"]').should('contain', 'Personal');
|
||||||
|
|
||||||
cy.get('[id*="-option-0"]').scrollIntoView().should('be.visible').click();
|
cy.get('[id*="-option-0"]').scrollIntoView().should('be.visible').click();
|
||||||
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
||||||
cy.get('[data-testid="glossary-details"]')
|
cy.get('[data-testid="glossary-details"]')
|
||||||
@ -193,15 +197,18 @@ describe('Glossary page should work properly', () => {
|
|||||||
// updating description
|
// updating description
|
||||||
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
||||||
cy.get('.tw-modal-container').should('be.visible');
|
cy.get('.tw-modal-container').should('be.visible');
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).should('be.visible').as('description');
|
||||||
.should('be.visible')
|
|
||||||
.as('description');
|
|
||||||
|
|
||||||
cy.get('@description').clear();
|
cy.get('@description').clear();
|
||||||
cy.get('@description').type(newDescription);
|
cy.get('@description').type(newDescription);
|
||||||
|
|
||||||
|
interceptURL('PATCH', '/api/v1/glossaries/*', 'saveGlossary');
|
||||||
cy.get('[data-testid="save"]').click();
|
cy.get('[data-testid="save"]').click();
|
||||||
|
|
||||||
cy.get('.tw-modal-container').should('not.exist');
|
cy.get('.tw-modal-container').should('not.exist');
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@saveGlossary', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="viewer-container"]')
|
cy.get('[data-testid="viewer-container"]')
|
||||||
.contains(newDescription)
|
.contains(newDescription)
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
@ -270,15 +277,18 @@ describe('Glossary page should work properly', () => {
|
|||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('personal');
|
.type('personal');
|
||||||
cy.wait(500);
|
cy.get('[id*="-option-0"]').should('contain', 'Personal');
|
||||||
|
|
||||||
cy.get('[id*="-option-0"]').scrollIntoView().should('be.visible').click();
|
cy.get('[id*="-option-0"]').scrollIntoView().should('be.visible').click();
|
||||||
|
|
||||||
|
interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'saveData');
|
||||||
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
||||||
|
verifyResponseStatusCode('@saveData', 200);
|
||||||
cy.get('[data-testid="glossary-term"]')
|
cy.get('[data-testid="glossary-term"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.contains('PersonalData.Personal')
|
.contains('PersonalData.Personal')
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
// updating description
|
// updating description
|
||||||
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
||||||
cy.get('.tw-modal-container').should('be.visible');
|
cy.get('.tw-modal-container').should('be.visible');
|
||||||
@ -288,9 +298,10 @@ describe('Glossary page should work properly', () => {
|
|||||||
cy.get('@description').clear();
|
cy.get('@description').clear();
|
||||||
cy.get('@description').type(newDescription);
|
cy.get('@description').type(newDescription);
|
||||||
cy.get('[data-testid="save"]').click();
|
cy.get('[data-testid="save"]').click();
|
||||||
cy.get('.tw-modal-container').should('not.exist');
|
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@saveData', 200);
|
||||||
|
|
||||||
|
cy.get('.tw-modal-container').should('not.exist');
|
||||||
|
|
||||||
cy.get('[data-testid="viewer-container"]')
|
cy.get('[data-testid="viewer-container"]')
|
||||||
.contains(newDescription)
|
.contains(newDescription)
|
||||||
@ -332,23 +343,30 @@ describe('Glossary page should work properly', () => {
|
|||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
searchEntity(entity);
|
searchEntity(entity);
|
||||||
cy.wait(500);
|
|
||||||
|
interceptURL('GET', '/api/v1/feed*', 'getEntityDetails');
|
||||||
|
|
||||||
cy.get('[data-testid="table-link"]').first().contains(entity).click();
|
cy.get('[data-testid="table-link"]').first().contains(entity).click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
|
|
||||||
//Add tag to breadcrumb
|
//Add tag to breadcrumb
|
||||||
cy.get('[data-testid="tag-container"] [data-testid="tags"]')
|
cy.get('[data-testid="tag-container"] [data-testid="tags"]')
|
||||||
.eq(0)
|
.eq(0)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.get('[class*="-control"]').should('be.visible').type(term);
|
cy.get('[class*="-control"]').should('be.visible').type(term);
|
||||||
cy.wait(500);
|
cy.get('[id*="-option-0"]').should('contain', term);
|
||||||
cy.get('[id*="-option-0"]').should('be.visible').click();
|
cy.get('[id*="-option-0"]').should('be.visible').click();
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
||||||
).contains(term);
|
).contains(term);
|
||||||
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/feed/count*', 'saveTag');
|
||||||
|
|
||||||
|
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@saveTag', 200);
|
||||||
cy.get('[data-testid="entity-tags"]')
|
cy.get('[data-testid="entity-tags"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -360,13 +378,14 @@ describe('Glossary page should work properly', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.get('[class*="-control"]').should('be.visible').type(term);
|
cy.get('[class*="-control"]').should('be.visible').type(term);
|
||||||
cy.wait(500);
|
cy.get('[id*="-option-0"]').should('contain', term);
|
||||||
cy.get('[id*="-option-0"]').should('be.visible').click();
|
cy.get('[id*="-option-0"]').should('be.visible').click();
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
||||||
).contains(term);
|
).contains(term);
|
||||||
|
|
||||||
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@saveTag', 200);
|
||||||
cy.get(`[data-testid="tag-${glossary}.${term}"]`)
|
cy.get(`[data-testid="tag-${glossary}.${term}"]`)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -386,14 +405,18 @@ describe('Glossary page should work properly', () => {
|
|||||||
it('Remove Glossary term from entity should work properly', () => {
|
it('Remove Glossary term from entity should work properly', () => {
|
||||||
const term = NEW_GLOSSARY_TERMS.term_1.name;
|
const term = NEW_GLOSSARY_TERMS.term_1.name;
|
||||||
const entity = SEARCH_ENTITY_TABLE.table_3.term;
|
const entity = SEARCH_ENTITY_TABLE.table_3.term;
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/search/query*', 'assetTab');
|
||||||
// go assets tab
|
// go assets tab
|
||||||
goToAssetsTab(term);
|
goToAssetsTab(term);
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@assetTab', 200);
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/feed*', 'entityDetails');
|
||||||
cy.get('[data-testid="column"] > :nth-child(1) > a')
|
cy.get('[data-testid="column"] > :nth-child(1) > a')
|
||||||
.contains(entity)
|
.contains(entity)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@entityDetails', 200);
|
||||||
// redirect to entity detail page
|
// redirect to entity detail page
|
||||||
cy.get('[data-testid="entity-tags"]')
|
cy.get('[data-testid="entity-tags"]')
|
||||||
.find('[data-testid="edit-button"]')
|
.find('[data-testid="edit-button"]')
|
||||||
@ -445,17 +468,18 @@ describe('Glossary page should work properly', () => {
|
|||||||
cy.get('[data-testid="confirmation-text-input"]')
|
cy.get('[data-testid="confirmation-text-input"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(DELETE_TERM);
|
.type(DELETE_TERM);
|
||||||
|
interceptURL('DELETE', '/api/v1/glossaries/*', 'getGlossary');
|
||||||
cy.get('[data-testid="confirm-button"]')
|
cy.get('[data-testid="confirm-button"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.should('not.disabled')
|
.should('not.disabled')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@getGlossary', 200);
|
||||||
|
|
||||||
cy.get('.Toastify__toast-body')
|
cy.get('.Toastify__toast-body')
|
||||||
.contains('Glossary deleted successfully!')
|
.contains('Glossary deleted successfully!')
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
cy.get('.Toastify__close-button > svg > path').should('be.visible').click();
|
cy.get('.Toastify__close-button > svg > path').should('be.visible').click();
|
||||||
cy.wait(500);
|
cy.contains('Add New Glossary').should('be.visible');
|
||||||
cy.contains('Add New Glossary').should('be.visible');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { uuid } from '../../common/common';
|
import { descriptionBox, interceptURL, uuid, verifyResponseStatusCode } from '../../common/common';
|
||||||
|
|
||||||
const roles = {
|
const roles = {
|
||||||
dataConsumer: 'Data Consumer',
|
dataConsumer: 'Data Consumer',
|
||||||
@ -130,13 +130,11 @@ describe('Policy page should work properly', () => {
|
|||||||
cy.get('[data-testid="policy-name"]').should('be.visible').type(policyName);
|
cy.get('[data-testid="policy-name"]').should('be.visible').type(policyName);
|
||||||
|
|
||||||
//Enter description
|
//Enter description
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).eq(0).type(description);
|
||||||
.eq(0)
|
|
||||||
.type(description);
|
|
||||||
//Enter rule name
|
//Enter rule name
|
||||||
addRule(ruleName, ruleDescription, 1);
|
addRule(ruleName, ruleDescription, 1);
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
//Validate the added policy
|
//Validate the added policy
|
||||||
cy.get('[data-testid="inactive-link"]')
|
cy.get('[data-testid="inactive-link"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -178,12 +176,17 @@ describe('Policy page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Edit policy description', () => {
|
it('Edit policy description', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/policies/name/${policyName}*`,
|
||||||
|
'getSelectedPolicy'
|
||||||
|
);
|
||||||
//Click on created policy name
|
//Click on created policy name
|
||||||
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getSelectedPolicy', 200);
|
||||||
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
||||||
//Enter updated description
|
//Enter updated description
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.clear()
|
.clear()
|
||||||
.type(`${updatedDescription}-${policyName}`);
|
.type(`${updatedDescription}-${policyName}`);
|
||||||
@ -197,13 +200,20 @@ describe('Policy page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Add new rule', () => {
|
it('Add new rule', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/policies/name/${policyName}*`,
|
||||||
|
'getSelectedPolicy'
|
||||||
|
);
|
||||||
//Click on created policy name
|
//Click on created policy name
|
||||||
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
||||||
|
verifyResponseStatusCode('@getSelectedPolicy', 200);
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/policies/*', 'addRulepage');
|
||||||
//Click on add rule button
|
//Click on add rule button
|
||||||
cy.get('[data-testid="add-rule"]').should('be.visible').click();
|
cy.get('[data-testid="add-rule"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@addRulepage', 200);
|
||||||
|
|
||||||
addRule(newRuleName, newRuledescription, 0);
|
addRule(newRuleName, newRuledescription, 0);
|
||||||
|
|
||||||
@ -213,7 +223,9 @@ describe('Policy page should work properly', () => {
|
|||||||
.should('contain', ruleName);
|
.should('contain', ruleName);
|
||||||
|
|
||||||
//Verify other details
|
//Verify other details
|
||||||
cy.get('[data-testid="rule-name"]').last().scrollIntoView()
|
cy.get('[data-testid="rule-name"]')
|
||||||
|
.last()
|
||||||
|
.scrollIntoView()
|
||||||
.contains(ruleName)
|
.contains(ruleName)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
@ -236,41 +248,53 @@ describe('Policy page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Edit rule name for created Rule', () => {
|
it('Edit rule name for created Rule', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/policies/name/${policyName}*`,
|
||||||
|
'getSelectedPolicy'
|
||||||
|
);
|
||||||
//Click on created policy name
|
//Click on created policy name
|
||||||
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
||||||
|
|
||||||
cy.wait(2000);
|
verifyResponseStatusCode('@getSelectedPolicy', 200);
|
||||||
|
|
||||||
//Click on new rule manage button
|
//Click on new rule manage button
|
||||||
cy.get(`[data-testid="manage-button-${newRuleName}"]`)
|
cy.get(`[data-testid="manage-button-${newRuleName}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/policies/*', 'editRulepage');
|
||||||
cy.get('[data-testid="edit-rule"]').should('be.visible').click();
|
cy.get('[data-testid="edit-rule"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@editRulepage', 200);
|
||||||
|
|
||||||
//Enter new name
|
//Enter new name
|
||||||
cy.get('[data-testid="rule-name"]').clear().type(updatedRuleName);
|
cy.get('[data-testid="rule-name"]').clear().type(updatedRuleName);
|
||||||
|
|
||||||
|
interceptURL('PATCH', '/api/v1/policies/*', 'updateRule');
|
||||||
|
|
||||||
cy.get('[data-testid="submit-btn"]')
|
cy.get('[data-testid="submit-btn"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
verifyResponseStatusCode('@updateRule', 200);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
|
||||||
cy.url().should('include', policyName);
|
cy.url().should('include', policyName);
|
||||||
|
|
||||||
cy.get('[data-testid="rule-name"]').should(
|
cy.get('[data-testid="rule-name"]').should('contain', updatedRuleName);
|
||||||
'contain',
|
|
||||||
updatedRuleName
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Delete new rule', () => {
|
it('Delete new rule', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/policies/name/${policyName}*`,
|
||||||
|
'getSelectedPolicy'
|
||||||
|
);
|
||||||
//Click on created policy name
|
//Click on created policy name
|
||||||
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getSelectedPolicy', 200);
|
||||||
|
|
||||||
//Click on new rule manage button
|
//Click on new rule manage button
|
||||||
cy.get(`[data-testid="manage-button-${updatedRuleName}"]`)
|
cy.get(`[data-testid="manage-button-${updatedRuleName}"]`)
|
||||||
@ -286,19 +310,25 @@ describe('Policy page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Delete last rule and validate', () => {
|
it('Delete last rule and validate', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/policies/name/${policyName}*`,
|
||||||
|
'getSelectedPolicy'
|
||||||
|
);
|
||||||
//Click on created policy name
|
//Click on created policy name
|
||||||
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
cy.get('[data-testid="policy-name"]').contains(policyName).click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getSelectedPolicy', 200);
|
||||||
|
|
||||||
//Click on new rule manage button
|
//Click on new rule manage button
|
||||||
cy.get(`[data-testid="manage-button-${ruleName}"]`)
|
cy.get(`[data-testid="manage-button-${ruleName}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
interceptURL('PATCH', '/api/v1/policies/*', 'deletelastPolicy');
|
||||||
|
|
||||||
cy.get('[data-testid="delete-rule"]').should('be.visible').click();
|
cy.get('[data-testid="delete-rule"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@deletelastPolicy', 400);
|
||||||
|
|
||||||
cy.get('.Toastify__toast-body')
|
cy.get('.Toastify__toast-body')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { uuid } from '../../common/common';
|
import { descriptionBox, interceptURL, uuid, verifyResponseStatusCode } from '../../common/common';
|
||||||
|
|
||||||
const roles = {
|
const roles = {
|
||||||
dataConsumer: 'Data Consumer',
|
dataConsumer: 'Data Consumer',
|
||||||
@ -52,15 +52,14 @@ const removePolicyFromRole = (policyName) => {
|
|||||||
describe('Roles page should work properly', () => {
|
describe('Roles page should work properly', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
cy.intercept('GET', '*api/v1/roles*').as('getRoles');
|
|
||||||
|
interceptURL('GET', '*api/v1/roles*', 'getRoles');
|
||||||
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.get('[data-menu-id*="roles"]').should('be.visible').click();
|
cy.get('[data-menu-id*="roles"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait('@getRoles', { timeout: 15000 })
|
verifyResponseStatusCode('@getRoles', 200);
|
||||||
.its('response.statusCode')
|
|
||||||
.should('equal', 200);
|
|
||||||
|
|
||||||
cy.url().should('eq', 'http://localhost:8585/settings/access/roles');
|
cy.url().should('eq', 'http://localhost:8585/settings/access/roles');
|
||||||
});
|
});
|
||||||
@ -92,10 +91,8 @@ describe('Roles page should work properly', () => {
|
|||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
//Entering name
|
//Entering name
|
||||||
cy.get('#name').should('be.visible').type(roleName);
|
cy.get('#name').should('be.visible').type(roleName);
|
||||||
//Entering description
|
//Entering descrription
|
||||||
cy.get(
|
cy.get(descriptionBox).type(description);
|
||||||
'.toastui-editor-md-container > .toastui-editor > .ProseMirror'
|
|
||||||
).type(description);
|
|
||||||
//Select the policies
|
//Select the policies
|
||||||
cy.get('.ant-select').should('be.visible').click();
|
cy.get('.ant-select').should('be.visible').click();
|
||||||
|
|
||||||
@ -170,10 +167,8 @@ describe('Roles page should work properly', () => {
|
|||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
//Entering name
|
//Entering name
|
||||||
cy.get('#name').should('be.visible').type(roleName);
|
cy.get('#name').should('be.visible').type(roleName);
|
||||||
//Entering description
|
//Entering descrription
|
||||||
cy.get(
|
cy.get(descriptionBox).type(description);
|
||||||
'.toastui-editor-md-container > .toastui-editor > .ProseMirror'
|
|
||||||
).type(description);
|
|
||||||
//Do not Select the policies
|
//Do not Select the policies
|
||||||
//Save the role
|
//Save the role
|
||||||
cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
|
cy.get('[data-testid="submit-btn"]').scrollIntoView().click();
|
||||||
@ -193,9 +188,7 @@ describe('Roles page should work properly', () => {
|
|||||||
.click();
|
.click();
|
||||||
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).clear().type(`${description}-updated`);
|
||||||
.clear()
|
|
||||||
.type(`${description}-updated`);
|
|
||||||
cy.get('[data-testid="save"]').should('be.visible').click();
|
cy.get('[data-testid="save"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.get('[data-testid="inactive-link"]').should('be.visible');
|
cy.get('[data-testid="inactive-link"]').should('be.visible');
|
||||||
|
@ -11,10 +11,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { descriptionBox, interceptURL, verifyResponseStatusCode } from '../../common/common';
|
||||||
import { service } from '../../constants/constants';
|
import { service } from '../../constants/constants';
|
||||||
|
|
||||||
const updateOwner = () => {};
|
|
||||||
|
|
||||||
describe('Services page should work properly', () => {
|
describe('Services page should work properly', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
@ -29,18 +28,17 @@ describe('Services page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Update service description', () => {
|
it('Update service description', () => {
|
||||||
|
interceptURL('GET', '/api/v1/config/airflow', 'getService');
|
||||||
cy.get(`[data-testid="service-name-${service.name}"]`)
|
cy.get(`[data-testid="service-name-${service.name}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getService', 200);
|
||||||
//need wait here
|
//need wait here
|
||||||
cy.get('[data-testid="edit-description"]')
|
cy.get('[data-testid="edit-description"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).clear().type(service.newDescription);
|
||||||
.clear()
|
|
||||||
.type(service.newDescription);
|
|
||||||
cy.get('[data-testid="save"]').click();
|
cy.get('[data-testid="save"]').click();
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="description"] > [data-testid="viewer-container"] > [data-testid="markdown-parser"] > :nth-child(1) > .toastui-editor-contents > p'
|
'[data-testid="description"] > [data-testid="viewer-container"] > [data-testid="markdown-parser"] > :nth-child(1) > .toastui-editor-contents > p'
|
||||||
@ -50,32 +48,35 @@ describe('Services page should work properly', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.skip('Update owner and check description', () => {
|
it.skip('Update owner and check description', () => {
|
||||||
|
interceptURL('GET', '/api/v1/config/airflow', 'getService');
|
||||||
cy.get(`[data-testid="service-name-${service.name}"]`)
|
cy.get(`[data-testid="service-name-${service.name}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getService', 200);
|
||||||
|
interceptURL('GET', '/api/v1/users/loggedInUser/groupTeams', 'editOwner');
|
||||||
cy.get('[data-testid="edit-Owner-icon"]')
|
cy.get('[data-testid="edit-Owner-icon"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@editOwner', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="dropdown-list"]')
|
cy.get('[data-testid="dropdown-list"]')
|
||||||
.contains('Teams')
|
.contains('Users')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="list-item"]')
|
cy.get('[data-testid="list-item"]')
|
||||||
.contains(service.Owner)
|
.contains(service.Owner)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.get('[data-testid="owner-dropdown"]').should('have.text', service.Owner);
|
cy.get('[data-testid="owner-dropdown"]').should('have.text', service.Owner);
|
||||||
//Checking if description exists after assigning the owner
|
//Checking if description exists after assigning the owner
|
||||||
cy.get(':nth-child(1) > .link-title').click();
|
cy.get(':nth-child(1) > .link-title').click();
|
||||||
//need wait here
|
//need wait here
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="viewer-container"]').contains(service.newDescription);
|
cy.get('[data-testid="viewer-container"]').contains(service.newDescription);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { addNewTagToEntity } from '../../common/common';
|
import { addNewTagToEntity, descriptionBox, interceptURL, verifyResponseStatusCode } from '../../common/common';
|
||||||
import { NEW_TAG, NEW_TAG_CATEGORY, SEARCH_ENTITY_TABLE } from '../../constants/constants';
|
import { NEW_TAG, NEW_TAG_CATEGORY, SEARCH_ENTITY_TABLE } from '../../constants/constants';
|
||||||
|
|
||||||
describe('Tags page should work', () => {
|
describe('Tags page should work', () => {
|
||||||
@ -51,7 +51,7 @@ describe('Tags page should work', () => {
|
|||||||
cy.get('[data-testid="name"]')
|
cy.get('[data-testid="name"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(NEW_TAG_CATEGORY.name);
|
.type(NEW_TAG_CATEGORY.name);
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(NEW_TAG_CATEGORY.description);
|
.type(NEW_TAG_CATEGORY.description);
|
||||||
|
|
||||||
@ -81,10 +81,14 @@ describe('Tags page should work', () => {
|
|||||||
cy.get('[data-testid="add-new-tag-button"]').should('be.visible').click();
|
cy.get('[data-testid="add-new-tag-button"]').should('be.visible').click();
|
||||||
cy.get('.tw-modal-container').should('be.visible');
|
cy.get('.tw-modal-container').should('be.visible');
|
||||||
cy.get('[data-testid="name"]').should('be.visible').type(NEW_TAG.name);
|
cy.get('[data-testid="name"]').should('be.visible').type(NEW_TAG.name);
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).should('be.visible').type(NEW_TAG.description);
|
||||||
.should('be.visible')
|
|
||||||
.type(NEW_TAG.description);
|
interceptURL('GET', '/api/v1/tags/*', 'createTag');
|
||||||
cy.get('[data-testid="saveButton"]').should('be.visible').click();
|
cy.get('[data-testid="saveButton"]').should('be.visible').click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@createTag', 200);
|
||||||
|
|
||||||
|
cy.get('[data-testid="table-body"]').should('contain', NEW_TAG.name);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Use newly created tag to any entity should work', () => {
|
it('Use newly created tag to any entity should work', () => {
|
||||||
@ -143,8 +147,14 @@ describe('Tags page should work', () => {
|
|||||||
cy.get('[data-testid="body-text"]')
|
cy.get('[data-testid="body-text"]')
|
||||||
.contains(`Are you sure you want to delete the tag "${NEW_TAG.name}"?`)
|
.contains(`Are you sure you want to delete the tag "${NEW_TAG.name}"?`)
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
|
interceptURL(
|
||||||
|
'DELETE',
|
||||||
|
`/api/v1/tags/${NEW_TAG_CATEGORY.name}/*`,
|
||||||
|
'deleteTag'
|
||||||
|
);
|
||||||
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
||||||
cy.wait(100);
|
verifyResponseStatusCode('@deleteTag', 200);
|
||||||
cy.get('.tw-modal-container').should('not.exist');
|
cy.get('.tw-modal-container').should('not.exist');
|
||||||
cy.get('.tableBody-cell').contains(NEW_TAG.name).should('not.exist');
|
cy.get('.tableBody-cell').contains(NEW_TAG.name).should('not.exist');
|
||||||
});
|
});
|
||||||
|
@ -11,9 +11,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { toastNotification, updateOwner, uuid } from '../../common/common';
|
import { descriptionBox, interceptURL, toastNotification, updateOwner, uuid, verifyResponseStatusCode } from '../../common/common';
|
||||||
|
|
||||||
const orgName = 'Organization';
|
|
||||||
const updateddescription = 'This is updated description';
|
const updateddescription = 'This is updated description';
|
||||||
|
|
||||||
const teamName = `team-ct-test-${uuid()}`;
|
const teamName = `team-ct-test-${uuid()}`;
|
||||||
@ -31,16 +30,18 @@ describe('Teams flow should work properly', () => {
|
|||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
||||||
|
interceptURL('GET', '/api/v1/users*', 'getTeams');
|
||||||
//Clicking on teams
|
//Clicking on teams
|
||||||
cy.get('[data-menu-id*="teams"]')
|
cy.get('[data-menu-id*="teams"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
verifyResponseStatusCode('@getTeams', 200);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Add new team', () => {
|
it('Add new team', () => {
|
||||||
|
interceptURL('GET', '/api/v1/teams*', 'addTeam');
|
||||||
//Fetching the add button and clicking on it
|
//Fetching the add button and clicking on it
|
||||||
cy.get('button')
|
cy.get('button')
|
||||||
.find('span')
|
.find('span')
|
||||||
@ -48,7 +49,8 @@ describe('Teams flow should work properly', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@addTeam', 200);
|
||||||
|
|
||||||
//Entering team details
|
//Entering team details
|
||||||
cy.get('[data-testid="name"]')
|
cy.get('[data-testid="name"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
@ -60,10 +62,12 @@ describe('Teams flow should work properly', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(TEAM_DETAILS.displayName);
|
.type(TEAM_DETAILS.displayName);
|
||||||
|
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox)
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type(TEAM_DETAILS.description);
|
.type(TEAM_DETAILS.description);
|
||||||
|
interceptURL('POST', '/api/v1/teams', 'saveTeam');
|
||||||
|
interceptURL('GET', '/api/v1/team*', 'createTeam');
|
||||||
|
|
||||||
//Saving the created team
|
//Saving the created team
|
||||||
cy.get('[form="add-team-form"]')
|
cy.get('[form="add-team-form"]')
|
||||||
@ -71,7 +75,8 @@ describe('Teams flow should work properly', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@saveTeam', 201);
|
||||||
|
verifyResponseStatusCode('@createTeam', 200);
|
||||||
|
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
|
||||||
@ -85,10 +90,10 @@ describe('Teams flow should work properly', () => {
|
|||||||
it('Add owner to created team', () => {
|
it('Add owner to created team', () => {
|
||||||
//Clicking on created team
|
//Clicking on created team
|
||||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||||
updateOwner()
|
updateOwner();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Add user to created team', () => {
|
it('Add user to created team', () => {
|
||||||
//Click on created team
|
//Click on created team
|
||||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||||
|
|
||||||
@ -98,25 +103,32 @@ it('Add user to created team', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
|
interceptURL('GET', '/api/v1/users?limit=100000', 'addUser');
|
||||||
|
interceptURL('GET', '/api/v1/users/*', 'getUsers');
|
||||||
cy.get('[data-testid="add-user"]')
|
cy.get('[data-testid="add-user"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@addUser', 200);
|
||||||
cy.wait(2000);
|
verifyResponseStatusCode('@getUsers', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="searchbar"]').type(TEAM_DETAILS.ownername);
|
cy.get('[data-testid="searchbar"]').type(TEAM_DETAILS.ownername);
|
||||||
|
|
||||||
cy.wait(500);
|
cy.wait(500);
|
||||||
|
|
||||||
cy.get('[data-testid="checkboxAddUser"]').should('be.visible').click();
|
cy.get('[data-testid="data-container"]').should(
|
||||||
|
'contain',
|
||||||
|
TEAM_DETAILS.ownername
|
||||||
|
);
|
||||||
|
cy.get('[data-testid="checkboxAddUser"]')
|
||||||
|
.first()
|
||||||
|
.should('be.visible')
|
||||||
|
.click();
|
||||||
|
|
||||||
//Saving the added user
|
//Saving the added user
|
||||||
|
interceptURL('PATCH', '/api/v1/teams/*', 'saveUser');
|
||||||
cy.get('[data-testid="AddUserSave"]').should('be.visible').click();
|
cy.get('[data-testid="AddUserSave"]').should('be.visible').click();
|
||||||
|
verifyResponseStatusCode('@saveUser', 200);
|
||||||
cy.wait(500);
|
|
||||||
//Asseting the added user
|
//Asseting the added user
|
||||||
cy.get('[data-testid="Users"]')
|
cy.get('[data-testid="Users"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
@ -140,8 +152,7 @@ it('Add user to created team', () => {
|
|||||||
//Click on confirm button
|
//Click on confirm button
|
||||||
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
||||||
|
|
||||||
// TODO: Remove cy.wait and wait for API to be completed before querying for new element
|
verifyResponseStatusCode('@saveUser', 200);
|
||||||
cy.wait(2000);
|
|
||||||
|
|
||||||
//Verify if user is removed
|
//Verify if user is removed
|
||||||
cy.get('[data-testid="Users"]')
|
cy.get('[data-testid="Users"]')
|
||||||
@ -149,7 +160,10 @@ it('Add user to created team', () => {
|
|||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.get('[data-testid="add-user"]').should('not.contain', TEAM_DETAILS.ownername);
|
cy.get('[data-testid="add-user"]').should(
|
||||||
|
'not.contain',
|
||||||
|
TEAM_DETAILS.ownername
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Join team should work properly', () => {
|
it('Join team should work properly', () => {
|
||||||
@ -166,10 +180,15 @@ it('Add user to created team', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Update description and display name for created team', () => {
|
it('Update description and display name for created team', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
||||||
|
'getSelectedTeam'
|
||||||
|
);
|
||||||
//Click on created team name
|
//Click on created team name
|
||||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
||||||
//Click on edit display name
|
//Click on edit display name
|
||||||
cy.get('[data-testid="edit-synonyms"]').should('be.visible').click();
|
cy.get('[data-testid="edit-synonyms"]').should('be.visible').click();
|
||||||
|
|
||||||
@ -180,25 +199,25 @@ it('Add user to created team', () => {
|
|||||||
.clear()
|
.clear()
|
||||||
.type(TEAM_DETAILS.updatedname);
|
.type(TEAM_DETAILS.updatedname);
|
||||||
|
|
||||||
|
interceptURL('PATCH', 'api/v1/teams/*', 'saveTeamName');
|
||||||
|
interceptURL('GET', '/api/v1/users*', 'updatedTeam');
|
||||||
//Save the updated display name
|
//Save the updated display name
|
||||||
cy.get('[data-testid="saveAssociatedTag"]')
|
cy.get('[data-testid="saveAssociatedTag"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
verifyResponseStatusCode('@saveTeamName', 200);
|
||||||
cy.wait(1000);
|
|
||||||
//Validate the updated display name
|
//Validate the updated display name
|
||||||
cy.get('[data-testid="header"]')
|
cy.get('[data-testid="header"]')
|
||||||
.find('.ant-typography')
|
.find('.ant-typography')
|
||||||
.should('contain', TEAM_DETAILS.updatedname);
|
.should('contain', TEAM_DETAILS.updatedname);
|
||||||
|
verifyResponseStatusCode('@updatedTeam', 200);
|
||||||
|
|
||||||
//Click on edit description button
|
//Click on edit description button
|
||||||
cy.get('[data-testid="edit-description"] > [data-testid="image"]').should('be.visible').click();
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
||||||
|
|
||||||
//Entering updated description
|
//Entering updated description
|
||||||
cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror')
|
cy.get(descriptionBox).clear().type(updateddescription);
|
||||||
.clear()
|
|
||||||
.type(updateddescription);
|
|
||||||
|
|
||||||
cy.get('[data-testid="save"]').should('be.visible').click();
|
cy.get('[data-testid="save"]').should('be.visible').click();
|
||||||
//Validating the updated description
|
//Validating the updated description
|
||||||
@ -267,9 +286,16 @@ it('Add user to created team', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Leave team flow should work properly', () => {
|
it('Leave team flow should work properly', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
||||||
|
'getSelectedTeam'
|
||||||
|
);
|
||||||
|
|
||||||
//Click on created team
|
//Click on created team
|
||||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
||||||
// //Click on Leave team
|
// //Click on Leave team
|
||||||
cy.get('[data-testid="leave-team-button"]').should('be.visible').click();
|
cy.get('[data-testid="leave-team-button"]').should('be.visible').click();
|
||||||
|
|
||||||
@ -282,23 +308,28 @@ it('Add user to created team', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Delete created team', () => {
|
it('Delete created team', () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
||||||
|
'getSelectedTeam'
|
||||||
|
);
|
||||||
//Click on created team
|
//Click on created team
|
||||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
||||||
|
|
||||||
cy.get('[data-testid="manage-button"]')
|
cy.get('[data-testid="manage-button"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
||||||
|
|
||||||
cy.get('[data-testid="delete-button-title"]')
|
cy.get('[data-testid="delete-button-title"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(1000);
|
|
||||||
//Click on permanent delete option
|
//Click on permanent delete option
|
||||||
cy.get('[data-testid="hard-delete-option"]')
|
cy.get('[data-testid="hard-delete-option"]')
|
||||||
.should('contain', TEAM_DETAILS.name)
|
.should('contain', TEAM_DETAILS.name)
|
||||||
@ -306,12 +337,14 @@ it('Add user to created team', () => {
|
|||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
||||||
|
|
||||||
|
interceptURL('DELETE', '/api/v1/teams/*', 'deleteTeam');
|
||||||
cy.get('[data-testid="confirm-button"]')
|
cy.get('[data-testid="confirm-button"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@deleteTeam', 200);
|
||||||
|
|
||||||
//Verify the toast message
|
//Verify the toast message
|
||||||
toastNotification('Team deleted successfully!');
|
toastNotification('Team deleted successfully!');
|
||||||
|
@ -22,7 +22,7 @@ const adminEmail = `${adminName}@gmail.com`;
|
|||||||
describe('Users flow should work properly', () => {
|
describe('Users flow should work properly', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]')
|
cy.get('[data-testid="appbar-item-settings"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -41,17 +41,7 @@ describe('Users flow should work properly', () => {
|
|||||||
addUser(userName, userEmail);
|
addUser(userName, userEmail);
|
||||||
|
|
||||||
//Validate if user is added in the User tab
|
//Validate if user is added in the User tab
|
||||||
cy.clickOnLogo();
|
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]')
|
|
||||||
.should('exist')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
cy.get('.ant-menu-title-content')
|
|
||||||
.contains('Users')
|
|
||||||
.should('exist')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
cy.get('[data-testid="searchbar"]')
|
cy.get('[data-testid="searchbar"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -76,7 +66,7 @@ describe('Users flow should work properly', () => {
|
|||||||
describe('Admin flow should work properly', () => {
|
describe('Admin flow should work properly', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.goToHomePage();
|
cy.goToHomePage();
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]')
|
cy.get('[data-testid="appbar-item-settings"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
@ -102,17 +92,7 @@ describe('Admin flow should work properly', () => {
|
|||||||
addUser(adminName, adminEmail);
|
addUser(adminName, adminEmail);
|
||||||
|
|
||||||
//Validate if user is added in the User tab
|
//Validate if user is added in the User tab
|
||||||
cy.clickOnLogo();
|
|
||||||
cy.wait(1000);
|
|
||||||
cy.get('[data-testid="appbar-item-settings"]')
|
|
||||||
.should('exist')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
cy.get('.ant-menu-title-content')
|
|
||||||
.contains('Admins')
|
|
||||||
.should('exist')
|
|
||||||
.should('be.visible')
|
|
||||||
.click();
|
|
||||||
cy.get('[data-testid="searchbar"]')
|
cy.get('[data-testid="searchbar"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
import { searchEntity, visitEntityTab } from '../../common/common';
|
import { interceptURL, searchEntity, verifyResponseStatusCode, visitEntityTab } from '../../common/common';
|
||||||
import { FOLLOWING_TITLE, MYDATA_SUMMARY_OPTIONS, MY_DATA_TITLE, NO_SEARCHED_TERMS, RECENT_SEARCH_TITLE, RECENT_VIEW_TITLE, SEARCH_ENTITY_DASHBOARD, SEARCH_ENTITY_PIPELINE, SEARCH_ENTITY_TABLE, SEARCH_ENTITY_TOPIC } from '../../constants/constants';
|
import { FOLLOWING_TITLE, MYDATA_SUMMARY_OPTIONS, MY_DATA_TITLE, NO_SEARCHED_TERMS, RECENT_SEARCH_TITLE, RECENT_VIEW_TITLE, SEARCH_ENTITY_DASHBOARD, SEARCH_ENTITY_PIPELINE, SEARCH_ENTITY_TABLE, SEARCH_ENTITY_TOPIC } from '../../constants/constants';
|
||||||
|
|
||||||
const tables = Object.values(SEARCH_ENTITY_TABLE);
|
const tables = Object.values(SEARCH_ENTITY_TABLE);
|
||||||
@ -86,19 +86,22 @@ describe('MyData page should work', () => {
|
|||||||
.should('have.class', 'active');
|
.should('have.class', 'active');
|
||||||
|
|
||||||
// click on the 1st result and go to entity details page and follow the entity
|
// click on the 1st result and go to entity details page and follow the entity
|
||||||
cy.wait(500);
|
interceptURL('GET', '/api/v1/feed*', 'getEntityDetails');
|
||||||
cy.get('[data-testid="table-link"]')
|
cy.get('[data-testid="table-link"]')
|
||||||
.first()
|
.first()
|
||||||
.contains(termObj.term, { matchCase: false })
|
.contains(termObj.term, { matchCase: false })
|
||||||
.click();
|
.click();
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
||||||
|
|
||||||
|
interceptURL('PUT', '/api/v1/*/*/followers', 'waitAfterFollow');
|
||||||
cy.get('[data-testid="follow-button"]').should('be.visible').click();
|
cy.get('[data-testid="follow-button"]').should('be.visible').click();
|
||||||
|
|
||||||
|
verifyResponseStatusCode('@waitAfterFollow', 200);
|
||||||
// go to manage tab and search for logged in user and set the owner
|
// go to manage tab and search for logged in user and set the owner
|
||||||
|
interceptURL('GET', '/api/v1/users/loggedInUser/groupTeams', 'getUsers');
|
||||||
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
||||||
|
|
||||||
cy.wait(500);
|
verifyResponseStatusCode('@getUsers', 200);
|
||||||
//Clicking on users tab
|
//Clicking on users tab
|
||||||
cy.get('[data-testid="dropdown-tab"]')
|
cy.get('[data-testid="dropdown-tab"]')
|
||||||
.contains('Users')
|
.contains('Users')
|
||||||
@ -111,7 +114,6 @@ describe('MyData page should work', () => {
|
|||||||
.should('exist')
|
.should('exist')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.click();
|
.click();
|
||||||
cy.wait(1000);
|
|
||||||
|
|
||||||
cy.get(':nth-child(2) > [data-testid="owner-link"]')
|
cy.get(':nth-child(2) > [data-testid="owner-link"]')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user