mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-24 00:48:36 +00:00
Fix cypress reload (#4874)
This commit is contained in:
parent
4395cae6b7
commit
07df80b098
@ -57,7 +57,15 @@ const testServiceCreationAndIngestion = (
|
|||||||
cy.get('[data-testid="schema-filter-pattern-checkbox"]').should('be.visible');
|
cy.get('[data-testid="schema-filter-pattern-checkbox"]').should('be.visible');
|
||||||
cy.get('[data-testid="add-ingestion-container"]').should('be.visible');
|
cy.get('[data-testid="add-ingestion-container"]').should('be.visible');
|
||||||
|
|
||||||
|
// Set all the sliders to off to disable sample data, data profiler etc.
|
||||||
|
cy.get('[data-testid="toggle-button-ingest-sample-data"]')
|
||||||
|
.should('exist')
|
||||||
|
.click();
|
||||||
|
cy.get('[data-testid="toggle-button-data-profiler"]').should('exist').click();
|
||||||
|
cy.get('[data-testid="toggle-button-mark-deleted"]').should('exist').click();
|
||||||
|
|
||||||
addIngestionInput();
|
addIngestionInput();
|
||||||
|
|
||||||
cy.get('[data-testid="next-button"]').should('exist').click();
|
cy.get('[data-testid="next-button"]').should('exist').click();
|
||||||
|
|
||||||
// Configure DBT Model
|
// Configure DBT Model
|
||||||
@ -84,24 +92,26 @@ const testServiceCreationAndIngestion = (
|
|||||||
|
|
||||||
// wait for ingestion to run
|
// wait for ingestion to run
|
||||||
cy.clock();
|
cy.clock();
|
||||||
cy.wait(30000);
|
cy.wait(10000);
|
||||||
|
|
||||||
cy.get('[data-testid="view-service-button"]').should('be.visible');
|
cy.get('[data-testid="view-service-button"]').should('be.visible');
|
||||||
cy.get('[data-testid="view-service-button"]').click();
|
cy.get('[data-testid="view-service-button"]').click();
|
||||||
|
|
||||||
// ingestions page
|
// ingestions page
|
||||||
|
const retryTimes = 15;
|
||||||
|
let retryCount = 0;
|
||||||
const testIngestionsTab = () => {
|
const testIngestionsTab = () => {
|
||||||
cy.get('[data-testid="Ingestions"]').should('be.visible');
|
cy.get('[data-testid="Ingestions"]').should('be.visible');
|
||||||
cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should(
|
cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
// click on the tab only for the first time
|
||||||
|
if (retryCount === 0) {
|
||||||
cy.get('[data-testid="Ingestions"]').click();
|
cy.get('[data-testid="Ingestions"]').click();
|
||||||
|
}
|
||||||
cy.get('[data-testid="add-new-ingestion-button"]').should('be.visible');
|
cy.get('[data-testid="add-new-ingestion-button"]').should('be.visible');
|
||||||
};
|
};
|
||||||
|
|
||||||
const retryTimes = 10;
|
|
||||||
let retryCount = 0;
|
|
||||||
const checkSuccessState = () => {
|
const checkSuccessState = () => {
|
||||||
testIngestionsTab();
|
testIngestionsTab();
|
||||||
retryCount++;
|
retryCount++;
|
||||||
@ -209,7 +219,7 @@ describe('login with SSO', () => {
|
|||||||
cy.get('[data-testid="schema-filter-pattern-checkbox"]').check();
|
cy.get('[data-testid="schema-filter-pattern-checkbox"]').check();
|
||||||
cy.get('[data-testid="filter-pattern-includes-schema"]')
|
cy.get('[data-testid="filter-pattern-includes-schema"]')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.type('testschema');
|
.type('TESTSCHEMA');
|
||||||
};
|
};
|
||||||
|
|
||||||
testServiceCreationAndIngestion(
|
testServiceCreationAndIngestion(
|
||||||
|
@ -81,6 +81,7 @@ const ConfigureIngestion = ({
|
|||||||
<ToggleSwitchV1
|
<ToggleSwitchV1
|
||||||
checked={includeView}
|
checked={includeView}
|
||||||
handleCheck={handleIncludeView}
|
handleCheck={handleIncludeView}
|
||||||
|
testId="include-views"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="tw-text-grey-muted tw-mt-3">
|
<p className="tw-text-grey-muted tw-mt-3">
|
||||||
@ -94,6 +95,7 @@ const ConfigureIngestion = ({
|
|||||||
<ToggleSwitchV1
|
<ToggleSwitchV1
|
||||||
checked={enableDataProfiler}
|
checked={enableDataProfiler}
|
||||||
handleCheck={handleEnableDataProfiler}
|
handleCheck={handleEnableDataProfiler}
|
||||||
|
testId="data-profiler"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="tw-text-grey-muted tw-mt-3">
|
<p className="tw-text-grey-muted tw-mt-3">
|
||||||
@ -108,6 +110,7 @@ const ConfigureIngestion = ({
|
|||||||
<ToggleSwitchV1
|
<ToggleSwitchV1
|
||||||
checked={ingestSampleData}
|
checked={ingestSampleData}
|
||||||
handleCheck={handleIngestSampleData}
|
handleCheck={handleIngestSampleData}
|
||||||
|
testId="ingest-sample-data"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="tw-text-grey-muted tw-mt-3">
|
<p className="tw-text-grey-muted tw-mt-3">
|
||||||
@ -121,6 +124,7 @@ const ConfigureIngestion = ({
|
|||||||
<ToggleSwitchV1
|
<ToggleSwitchV1
|
||||||
checked={enableDebugLog}
|
checked={enableDebugLog}
|
||||||
handleCheck={handleEnableDebugLog}
|
handleCheck={handleEnableDebugLog}
|
||||||
|
testId="enable-debug-log"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="tw-text-grey-muted tw-mt-3">Enable debug logging</p>
|
<p className="tw-text-grey-muted tw-mt-3">Enable debug logging</p>
|
||||||
@ -137,6 +141,7 @@ const ConfigureIngestion = ({
|
|||||||
handleMarkDeletedTables();
|
handleMarkDeletedTables();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
testId="mark-deleted"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="tw-text-grey-muted tw-mt-3">
|
<p className="tw-text-grey-muted tw-mt-3">
|
||||||
|
@ -17,13 +17,20 @@ import React from 'react';
|
|||||||
interface ToggleSwitchV1Props {
|
interface ToggleSwitchV1Props {
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
handleCheck: () => void;
|
handleCheck: () => void;
|
||||||
|
testId?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ToggleSwitchV1 = ({ checked, handleCheck }: ToggleSwitchV1Props) => {
|
const ToggleSwitchV1 = ({
|
||||||
|
checked,
|
||||||
|
handleCheck,
|
||||||
|
testId,
|
||||||
|
}: ToggleSwitchV1Props) => {
|
||||||
|
const id = testId ? `toggle-button-${testId}` : 'toggle-button';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames('toggle-switch', checked ? 'open' : null)}
|
className={classNames('toggle-switch', checked ? 'open' : null)}
|
||||||
data-testid="toggle-button"
|
data-testid={id}
|
||||||
onClick={handleCheck}>
|
onClick={handleCheck}>
|
||||||
<div className="switch" />
|
<div className="switch" />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user