cypress: fixed aut cypress part 2 (#14059)

This commit is contained in:
Shailesh Parmar 2023-11-22 10:39:46 +05:30 committed by GitHub
parent 511c8ec8b7
commit dc1d465b7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 57 deletions

View File

@ -253,6 +253,7 @@ export const testServiceCreationAndIngestion = ({
testIngestionButton = true,
serviceCategory,
shouldAddIngestion = true,
allowTestConnection = true,
}) => {
// Storing the created service name and the type of service
// Select Service in step 1
@ -322,28 +323,30 @@ export const testServiceCreationAndIngestion = ({
interceptURL('GET', '/api/v1/automations/workflows/*', 'getWorkflow');
cy.get('[data-testid="test-connection-btn"]').should('exist').click();
if (allowTestConnection) {
cy.get('[data-testid="test-connection-btn"]').should('exist').click();
verifyResponseStatusCode('@testConnectionStepDefinition', 200);
verifyResponseStatusCode('@testConnectionStepDefinition', 200);
verifyResponseStatusCode('@createWorkflow', 201);
// added extra buffer time as triggerWorkflow API can take up to 2minute to provide result
verifyResponseStatusCode('@triggerWorkflow', 200, {
responseTimeout: 120000,
});
cy.get('[data-testid="test-connection-modal"]').should('exist');
cy.get('.ant-modal-footer > .ant-btn-primary')
.should('exist')
.contains('OK')
.click();
verifyResponseStatusCode('@getWorkflow', 200);
cy.get('[data-testid="messag-text"]').then(($message) => {
if ($message.text().includes('partially successful')) {
cy.contains('Test connection partially successful').should('exist');
} else {
cy.contains('Connection test was successful').should('exist');
}
});
verifyResponseStatusCode('@createWorkflow', 201);
// added extra buffer time as triggerWorkflow API can take up to 2minute to provide result
verifyResponseStatusCode('@triggerWorkflow', 200, {
responseTimeout: 120000,
});
cy.get('[data-testid="test-connection-modal"]').should('exist');
cy.get('.ant-modal-footer > .ant-btn-primary')
.should('exist')
.contains('OK')
.click();
verifyResponseStatusCode('@getWorkflow', 200);
cy.get('[data-testid="messag-text"]').then(($message) => {
if ($message.text().includes('partially successful')) {
cy.contains('Test connection partially successful').should('exist');
} else {
cy.contains('Connection test was successful').should('exist');
}
});
}
interceptURL(
'GET',
'/api/v1/services/ingestionPipelines/status',

View File

@ -34,7 +34,7 @@ describe('Custom Properties should work properly', () => {
describe('Add update and delete Integer custom properties', () => {
Object.values(ENTITIES).forEach((entity) => {
const propertyName = `entity${entity.name}test${uuid()}`;
const propertyName = `addcyentity${entity.name}test${uuid()}`;
it(`Add Integer custom property for ${entity.name} Entities`, () => {
interceptURL(
@ -106,7 +106,7 @@ describe('Custom Properties should work properly', () => {
describe('Add update and delete String custom properties', () => {
Object.values(ENTITIES).forEach((entity) => {
const propertyName = `entity${entity.name}test${uuid()}`;
const propertyName = `addcyentity${entity.name}test${uuid()}`;
it(`Add String custom property for ${entity.name} Entities`, () => {
interceptURL(
@ -182,7 +182,7 @@ describe('Custom Properties should work properly', () => {
describe('Add update and delete Markdown custom properties', () => {
Object.values(ENTITIES).forEach((entity) => {
const propertyName = `entity${entity.name}test${uuid()}`;
const propertyName = `addcyentity${entity.name}test${uuid()}`;
it(`Add Markdown custom property for ${entity.name} Entities`, () => {
interceptURL(

View File

@ -319,7 +319,9 @@ describe('Teams flow should work properly', () => {
cy.get('[data-testid="team-heading"]')
.should('be.visible')
.contains(TEAM_DETAILS.updatedName);
cy.get('[data-testid="manage-button"]').click();
cy.get(
'[data-testid="team-detail-header"] [data-testid="manage-button"]'
).click();
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
@ -381,10 +383,9 @@ describe('Teams flow should work properly', () => {
.should('be.visible')
.contains(TEAM_DETAILS.updatedName);
cy.get('[data-testid="manage-button"]')
.should('exist')
.should('be.visible')
.click();
cy.get(
'[data-testid="team-detail-header"] [data-testid="manage-button"]'
).click();
cy.get('[data-menu-id*="delete-button"]').should('be.visible');
@ -435,10 +436,9 @@ describe('Teams flow should work properly', () => {
.click();
verifyResponseStatusCode('@getSelectedTeam', 200);
cy.get('[data-testid="manage-button"]')
.should('exist')
.should('be.visible')
.click();
cy.get(
'[data-testid="team-detail-header"] [data-testid="manage-button"]'
).click();
cy.get('[data-menu-id*="delete-button"]').should('be.visible');

View File

@ -15,24 +15,18 @@ import {
deleteCreatedService,
goToAddNewServicePage,
testServiceCreationAndIngestion,
updateDescriptionForIngestedTables,
uuid,
} from '../../common/common';
import {
API_SERVICE,
MYDATA_SUMMARY_OPTIONS,
SERVICE_TYPE,
} from '../../constants/constants';
import { API_SERVICE, SERVICE_TYPE } from '../../constants/constants';
const serviceType = 'Mlflow';
const serviceName = `${serviceType}-ct-test-${uuid()}`;
const modelName = 'ElasticnetWineModel';
const description = `This is ${modelName} description`;
const connectionInput = () => {
cy.get('#root\\/trackingUri').type(Cypress.env('mlModelTrackingUri'));
cy.get('#root\\/trackingUri').type('mlModelTrackingUri');
checkServiceFieldSectionHighlighting('trackingUri');
cy.get('#root\\/registryUri').type(Cypress.env('mlModelRegistryUri'));
cy.get('#root\\/registryUri').type('mlModelRegistryUri');
checkServiceFieldSectionHighlighting('registryUri');
};
@ -57,19 +51,11 @@ describe('ML Flow Ingestion', () => {
serviceName,
type: SERVICE_TYPE.MLModels,
serviceCategory: 'MlModel',
shouldAddIngestion: false,
allowTestConnection: false,
});
});
it('Update MlModel description and verify description after re-run', () => {
updateDescriptionForIngestedTables(
serviceName,
modelName,
description,
SERVICE_TYPE.MLModels,
MYDATA_SUMMARY_OPTIONS.mlmodels
);
});
it('delete created service', () => {
deleteCreatedService(
SERVICE_TYPE.MLModels,

View File

@ -101,10 +101,6 @@ export default (on, config) => {
// Airflow
config.env.airflowHostPort = env.CYPRESS_AIRFLOW_HOST_PORT;
// MlModel
config.env.mlModelTrackingUri = env.CYPRESS_ML_MODEL_TRACKING_URI;
config.env.mlModelRegistryUri = env.CYPRESS_ML_MODEL_REGISTRY_URI;
// S3 storage
config.env.s3StorageAccessKeyId = env.CYPRESS_S3_STORAGE_ACCESS_KEY_ID;
config.env.s3StorageSecretAccessKey =

View File

@ -1103,8 +1103,11 @@ const TeamDetailsV1 = ({
return (
<div className="teams-layout">
<Row className="h-full" data-testid=" team-details-container">
<Col className="teams-profile-container" span={24}>
<Row className="h-full" data-testid="team-details-container">
<Col
className="teams-profile-container"
data-testid="team-detail-header"
span={24}>
<Collapse
accordion
bordered={false}