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, testIngestionButton = true,
serviceCategory, serviceCategory,
shouldAddIngestion = true, shouldAddIngestion = true,
allowTestConnection = true,
}) => { }) => {
// Storing the created service name and the type of service // Storing the created service name and the type of service
// Select Service in step 1 // Select Service in step 1
@ -322,6 +323,7 @@ export const testServiceCreationAndIngestion = ({
interceptURL('GET', '/api/v1/automations/workflows/*', 'getWorkflow'); interceptURL('GET', '/api/v1/automations/workflows/*', 'getWorkflow');
if (allowTestConnection) {
cy.get('[data-testid="test-connection-btn"]').should('exist').click(); cy.get('[data-testid="test-connection-btn"]').should('exist').click();
verifyResponseStatusCode('@testConnectionStepDefinition', 200); verifyResponseStatusCode('@testConnectionStepDefinition', 200);
@ -344,6 +346,7 @@ export const testServiceCreationAndIngestion = ({
cy.contains('Connection test was successful').should('exist'); cy.contains('Connection test was successful').should('exist');
} }
}); });
}
interceptURL( interceptURL(
'GET', 'GET',
'/api/v1/services/ingestionPipelines/status', '/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', () => { describe('Add update and delete Integer custom properties', () => {
Object.values(ENTITIES).forEach((entity) => { 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`, () => { it(`Add Integer custom property for ${entity.name} Entities`, () => {
interceptURL( interceptURL(
@ -106,7 +106,7 @@ describe('Custom Properties should work properly', () => {
describe('Add update and delete String custom properties', () => { describe('Add update and delete String custom properties', () => {
Object.values(ENTITIES).forEach((entity) => { 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`, () => { it(`Add String custom property for ${entity.name} Entities`, () => {
interceptURL( interceptURL(
@ -182,7 +182,7 @@ describe('Custom Properties should work properly', () => {
describe('Add update and delete Markdown custom properties', () => { describe('Add update and delete Markdown custom properties', () => {
Object.values(ENTITIES).forEach((entity) => { 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`, () => { it(`Add Markdown custom property for ${entity.name} Entities`, () => {
interceptURL( interceptURL(

View File

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

View File

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

View File

@ -101,10 +101,6 @@ export default (on, config) => {
// Airflow // Airflow
config.env.airflowHostPort = env.CYPRESS_AIRFLOW_HOST_PORT; 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 // S3 storage
config.env.s3StorageAccessKeyId = env.CYPRESS_S3_STORAGE_ACCESS_KEY_ID; config.env.s3StorageAccessKeyId = env.CYPRESS_S3_STORAGE_ACCESS_KEY_ID;
config.env.s3StorageSecretAccessKey = config.env.s3StorageSecretAccessKey =

View File

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