Fix cypress reload (#4874)

This commit is contained in:
Vivek Ratnavel Subramanian 2022-05-11 02:51:01 -07:00 committed by GitHub
parent 4395cae6b7
commit 07df80b098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 8 deletions

View File

@ -57,7 +57,15 @@ const testServiceCreationAndIngestion = (
cy.get('[data-testid="schema-filter-pattern-checkbox"]').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();
cy.get('[data-testid="next-button"]').should('exist').click();
// Configure DBT Model
@ -84,24 +92,26 @@ const testServiceCreationAndIngestion = (
// wait for ingestion to run
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"]').click();
// ingestions page
const retryTimes = 15;
let retryCount = 0;
const testIngestionsTab = () => {
cy.get('[data-testid="Ingestions"]').should('be.visible');
cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should(
'have.text',
1
);
cy.get('[data-testid="Ingestions"]').click();
// click on the tab only for the first time
if (retryCount === 0) {
cy.get('[data-testid="Ingestions"]').click();
}
cy.get('[data-testid="add-new-ingestion-button"]').should('be.visible');
};
const retryTimes = 10;
let retryCount = 0;
const checkSuccessState = () => {
testIngestionsTab();
retryCount++;
@ -209,7 +219,7 @@ describe('login with SSO', () => {
cy.get('[data-testid="schema-filter-pattern-checkbox"]').check();
cy.get('[data-testid="filter-pattern-includes-schema"]')
.should('be.visible')
.type('testschema');
.type('TESTSCHEMA');
};
testServiceCreationAndIngestion(

View File

@ -81,6 +81,7 @@ const ConfigureIngestion = ({
<ToggleSwitchV1
checked={includeView}
handleCheck={handleIncludeView}
testId="include-views"
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">
@ -94,6 +95,7 @@ const ConfigureIngestion = ({
<ToggleSwitchV1
checked={enableDataProfiler}
handleCheck={handleEnableDataProfiler}
testId="data-profiler"
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">
@ -108,6 +110,7 @@ const ConfigureIngestion = ({
<ToggleSwitchV1
checked={ingestSampleData}
handleCheck={handleIngestSampleData}
testId="ingest-sample-data"
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">
@ -121,6 +124,7 @@ const ConfigureIngestion = ({
<ToggleSwitchV1
checked={enableDebugLog}
handleCheck={handleEnableDebugLog}
testId="enable-debug-log"
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">Enable debug logging</p>
@ -137,6 +141,7 @@ const ConfigureIngestion = ({
handleMarkDeletedTables();
}
}}
testId="mark-deleted"
/>
</div>
<p className="tw-text-grey-muted tw-mt-3">

View File

@ -17,13 +17,20 @@ import React from 'react';
interface ToggleSwitchV1Props {
checked: boolean;
handleCheck: () => void;
testId?: string;
}
const ToggleSwitchV1 = ({ checked, handleCheck }: ToggleSwitchV1Props) => {
const ToggleSwitchV1 = ({
checked,
handleCheck,
testId,
}: ToggleSwitchV1Props) => {
const id = testId ? `toggle-button-${testId}` : 'toggle-button';
return (
<div
className={classNames('toggle-switch', checked ? 'open' : null)}
data-testid="toggle-button"
data-testid={id}
onClick={handleCheck}>
<div className="switch" />
</div>