2022-08-17 19:08:35 +05:30
|
|
|
/*
|
|
|
|
* Copyright 2021 Collate
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2022-09-26 19:43:34 +05:30
|
|
|
import { addTeam, descriptionBox, interceptURL, login, toastNotification, updateOwner, uuid, verifyResponseStatusCode } from '../../common/common';
|
2022-09-23 16:05:54 +05:30
|
|
|
import { LOGIN } from '../../constants/constants';
|
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
const updateddescription = 'This is updated description';
|
|
|
|
|
|
|
|
const teamName = `team-ct-test-${uuid()}`;
|
|
|
|
const TEAM_DETAILS = {
|
|
|
|
name: teamName,
|
|
|
|
displayName: teamName,
|
|
|
|
updatedname: `${teamName}-updated`,
|
2022-09-26 19:43:34 +05:30
|
|
|
teamType: 'Department',
|
2022-08-17 19:08:35 +05:30
|
|
|
description: `This is ${teamName} description`,
|
|
|
|
ownername: 'Aaron Johnson',
|
|
|
|
assetname: 'dim_address',
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('Teams flow should work properly', () => {
|
|
|
|
beforeEach(() => {
|
2022-09-23 16:05:54 +05:30
|
|
|
login(LOGIN.username, LOGIN.password);
|
2022-08-17 19:08:35 +05:30
|
|
|
cy.goToHomePage();
|
|
|
|
|
|
|
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('GET', '/api/v1/users*', 'getTeams');
|
2022-08-17 19:08:35 +05:30
|
|
|
//Clicking on teams
|
|
|
|
cy.get('[data-menu-id*="teams"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@getTeams', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
});
|
|
|
|
|
2022-08-19 19:34:01 +05:30
|
|
|
it('Add new team', () => {
|
2022-09-26 19:43:34 +05:30
|
|
|
addTeam(TEAM_DETAILS);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
cy.reload();
|
|
|
|
|
|
|
|
//asserting the added values
|
|
|
|
cy.get('table').find('.ant-table-row').should('contain', TEAM_DETAILS.name);
|
|
|
|
cy.get('table')
|
|
|
|
.find('.ant-table-row')
|
|
|
|
.should('contain', TEAM_DETAILS.description);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Add owner to created team', () => {
|
|
|
|
//Clicking on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
2022-09-14 19:19:42 +05:30
|
|
|
updateOwner();
|
2022-08-17 19:08:35 +05:30
|
|
|
});
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
it('Add user to created team', () => {
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
//Clicking on users tab
|
|
|
|
cy.get('[data-testid="Users"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('GET', '/api/v1/users?limit=100000', 'addUser');
|
|
|
|
interceptURL('GET', '/api/v1/users/*', 'getUsers');
|
2022-09-07 18:50:29 +05:30
|
|
|
cy.get('[data-testid="add-user"]')
|
|
|
|
.scrollIntoView()
|
2022-08-17 19:08:35 +05:30
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@addUser', 200);
|
|
|
|
verifyResponseStatusCode('@getUsers', 200);
|
2022-09-07 18:50:29 +05:30
|
|
|
cy.get('[data-testid="searchbar"]').type(TEAM_DETAILS.ownername);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
cy.wait(500);
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get('[data-testid="data-container"]').should(
|
|
|
|
'contain',
|
|
|
|
TEAM_DETAILS.ownername
|
|
|
|
);
|
|
|
|
cy.get('[data-testid="checkboxAddUser"]')
|
|
|
|
.first()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
//Saving the added user
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/teams/*', 'saveUser');
|
2022-08-17 19:08:35 +05:30
|
|
|
cy.get('[data-testid="AddUserSave"]').should('be.visible').click();
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@saveUser', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
//Asseting the added user
|
|
|
|
cy.get('[data-testid="Users"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('.ant-table-row').should('contain', TEAM_DETAILS.ownername);
|
|
|
|
|
|
|
|
//Removing the added user
|
2022-09-06 06:42:42 +05:30
|
|
|
cy.get('[data-testid="remove-user-btn"] > [data-testid="image"]')
|
2022-08-26 14:14:22 +05:30
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
//Validating the user added
|
|
|
|
cy.get('[data-testid="body-text"]').should(
|
|
|
|
'contain',
|
|
|
|
TEAM_DETAILS.ownername
|
|
|
|
);
|
|
|
|
|
|
|
|
//Click on confirm button
|
|
|
|
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
2022-08-26 14:14:22 +05:30
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@saveUser', 200);
|
2022-08-26 14:14:22 +05:30
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
//Verify if user is removed
|
2022-09-07 18:50:29 +05:30
|
|
|
cy.get('[data-testid="Users"]')
|
|
|
|
.should('exist')
|
2022-08-17 19:08:35 +05:30
|
|
|
.should('be.visible')
|
2022-09-07 18:50:29 +05:30
|
|
|
.click();
|
2022-08-17 19:08:35 +05:30
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get('[data-testid="add-user"]').should(
|
|
|
|
'not.contain',
|
|
|
|
TEAM_DETAILS.ownername
|
|
|
|
);
|
2022-08-17 19:08:35 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('Join team should work properly', () => {
|
|
|
|
//Click on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
//Click on join teams button
|
|
|
|
cy.get('[data-testid="join-teams"]').should('be.visible').click();
|
|
|
|
|
|
|
|
//Verify toast notification
|
|
|
|
toastNotification('Team joined successfully!');
|
|
|
|
|
|
|
|
cy.get('body').find('[data-testid="leave-team-button"]').should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Update description and display name for created team', () => {
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
|
|
|
'getSelectedTeam'
|
|
|
|
);
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on created team name
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on edit display name
|
|
|
|
cy.get('[data-testid="edit-synonyms"]').should('be.visible').click();
|
|
|
|
|
|
|
|
//Enter the updated team name
|
|
|
|
cy.get('[data-testid="synonyms"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.clear()
|
|
|
|
.type(TEAM_DETAILS.updatedname);
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('PATCH', 'api/v1/teams/*', 'saveTeamName');
|
2022-09-20 19:57:13 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`api/v1/users?fields=teams,roles&team=${TEAM_DETAILS.name}&limit=15`,
|
|
|
|
'getTeam'
|
|
|
|
);
|
2022-08-17 19:08:35 +05:30
|
|
|
//Save the updated display name
|
|
|
|
cy.get('[data-testid="saveAssociatedTag"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-20 19:57:13 +05:30
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
//Validate the updated display name
|
2022-09-20 19:57:13 +05:30
|
|
|
cy.get('[data-testid="team-heading"]').then(($el) => {
|
|
|
|
cy.wrap($el).should('have.text', TEAM_DETAILS.updatedname);
|
|
|
|
});
|
|
|
|
verifyResponseStatusCode('@saveTeamName', 200);
|
|
|
|
verifyResponseStatusCode('@getTeam', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
//Click on edit description button
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
//Entering updated description
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get(descriptionBox).clear().type(updateddescription);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="save"]').should('be.visible').click();
|
|
|
|
//Validating the updated description
|
|
|
|
cy.get('[data-testid="description"] p').should(
|
|
|
|
'contain',
|
|
|
|
updateddescription
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2022-09-03 18:25:21 +05:30
|
|
|
it.skip('Asset tab should work properly', () => {
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on created team name
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
cy.wait(500);
|
|
|
|
|
|
|
|
//Click on Asset tab
|
|
|
|
cy.get('[data-testid="Assets"]').should('be.visible').click();
|
|
|
|
|
|
|
|
//Click on explore tab
|
|
|
|
cy.get('.button-comp').contains('Explore').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
|
|
|
//Navigate to the asset name
|
|
|
|
cy.get('[data-testid="searchBox"]')
|
|
|
|
.should('exist')
|
|
|
|
.type(TEAM_DETAILS.assetname);
|
|
|
|
|
|
|
|
cy.get('[data-testid="data-name"]')
|
|
|
|
.contains(TEAM_DETAILS.assetname)
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
//Click on owner icon
|
|
|
|
cy.get('[data-testid="edit-Owner-icon"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
|
|
|
//Select the created team
|
|
|
|
cy.get('[data-testid="list-item"]')
|
|
|
|
.contains(TEAM_DETAILS.updatedname)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.wait(1000);
|
|
|
|
|
|
|
|
cy.reload();
|
|
|
|
|
|
|
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
|
|
|
//Clicking on teams
|
|
|
|
cy.get('[data-menu-id*="teams"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
//Click on created table
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
//Click on asset tab
|
|
|
|
cy.get('[data-testid="Assets"]').should('be.visible').click();
|
|
|
|
|
|
|
|
//Verify the added asset
|
|
|
|
cy.get('[data-testid="user-card-container"]')
|
|
|
|
.find('[data-testid="dataset-link"]')
|
|
|
|
.should('contain', TEAM_DETAILS.assetname);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Leave team flow should work properly', () => {
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
|
|
|
'getSelectedTeam'
|
|
|
|
);
|
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
// //Click on Leave team
|
|
|
|
cy.get('[data-testid="leave-team-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
// //Click on confirm button
|
|
|
|
cy.get('[data-testid="save-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
toastNotification('Left the team successfully');
|
|
|
|
|
|
|
|
cy.get('body').find('[data-testid="join-teams"]').should('exist');
|
|
|
|
});
|
|
|
|
|
2022-09-26 19:43:34 +05:30
|
|
|
it('Permanently deleting soft deleted team should work properly', () => {
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
|
|
|
'getSelectedTeam'
|
|
|
|
);
|
2022-09-26 19:43:34 +05:30
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
|
|
|
|
2022-09-03 12:17:35 +05:30
|
|
|
cy.get('[data-testid="delete-button-title"]')
|
2022-08-26 14:14:22 +05:30
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-26 19:43:34 +05:30
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.disabled');
|
|
|
|
|
|
|
|
cy.get('[data-testid="discard-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button-title"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
//Click on soft delete option
|
|
|
|
cy.get('[data-testid="soft-delete-option"]')
|
|
|
|
.should('contain', TEAM_DETAILS.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
|
|
|
|
|
|
|
interceptURL('DELETE', '/api/v1/teams/*', 'softDeleteTeam');
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@softDeleteTeam', 200);
|
|
|
|
|
|
|
|
//Verify the toast message
|
|
|
|
toastNotification('Team deleted successfully!');
|
|
|
|
|
|
|
|
//Check if soft deleted team is shown when 'Deleted Teams' switch is on
|
|
|
|
cy.get('table').should('not.contain', TEAM_DETAILS.name);
|
|
|
|
|
|
|
|
cy.get('[data-testid="show-deleted-switch"').should('exist').click();
|
|
|
|
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
|
|
|
'getSelectedTeam'
|
|
|
|
);
|
|
|
|
|
|
|
|
cy.get('table').should('contain', TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button-title"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
//Check if soft delete option is not present
|
|
|
|
cy.get('[data-testid="soft-delete-option"]').should('not.exist');
|
|
|
|
|
|
|
|
//Click on permanent delete option
|
|
|
|
cy.get('[data-testid="hard-delete-option"]')
|
|
|
|
.should('contain', TEAM_DETAILS.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
|
|
|
|
|
|
|
interceptURL('DELETE', '/api/v1/teams/*', 'deleteTeam');
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@deleteTeam', 200);
|
|
|
|
|
|
|
|
//Verify the toast message
|
|
|
|
toastNotification('Team deleted successfully!');
|
|
|
|
|
|
|
|
//Validating the deleted team
|
|
|
|
|
|
|
|
cy.get('table').should('not.contain', TEAM_DETAILS.name);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Permanently deleting a team without soft deleting should work properly', () => {
|
|
|
|
//Add a new team
|
|
|
|
addTeam(TEAM_DETAILS);
|
|
|
|
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/teams/name/${TEAM_DETAILS.name}*`,
|
|
|
|
'getSelectedTeam'
|
|
|
|
);
|
|
|
|
//Click on created team
|
|
|
|
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@getSelectedTeam', 200);
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button-title"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.disabled');
|
|
|
|
|
|
|
|
cy.get('[data-testid="discard-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button-title"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
//Check if soft delete option is present
|
|
|
|
cy.get('[data-testid="soft-delete-option"]')
|
|
|
|
.should('contain', TEAM_DETAILS.name)
|
|
|
|
.should('be.visible');
|
|
|
|
|
2022-08-17 19:08:35 +05:30
|
|
|
//Click on permanent delete option
|
|
|
|
cy.get('[data-testid="hard-delete-option"]')
|
|
|
|
.should('contain', TEAM_DETAILS.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]').type('DELETE');
|
2022-09-14 19:19:42 +05:30
|
|
|
|
|
|
|
interceptURL('DELETE', '/api/v1/teams/*', 'deleteTeam');
|
2022-08-17 19:08:35 +05:30
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@deleteTeam', 200);
|
2022-08-17 19:08:35 +05:30
|
|
|
|
|
|
|
//Verify the toast message
|
|
|
|
toastNotification('Team deleted successfully!');
|
|
|
|
|
|
|
|
//Validating the deleted team
|
|
|
|
|
2022-08-19 19:34:01 +05:30
|
|
|
cy.get('table').should('not.contain', TEAM_DETAILS.name);
|
2022-08-17 19:08:35 +05:30
|
|
|
});
|
|
|
|
});
|