Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix data source flaky tests #1383

Merged
merged 13 commits into from
Jun 12, 2024
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// clear cache
cy.clearCache();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the page', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
after(() => {
// Clean up after all test are run
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});

it('should successfully load the listing page & have 2 records in table', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ if (Cypress.env('DATASOURCE_MANAGEMENT_ENABLED')) {
});
after(() => {
// Clean up after all test are run
cy.deleteAllDataSourcesOnUI();
cy.deleteAllDataSources();
// remove the default data source
cy.setAdvancedSetting({
defaultDataSource: '',
});
});
it('The first data source is the default data source', () => {
cy.visitDataSourcesListingPage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ Cypress.Commands.add('singleDeleteDataSourceByTitle', (dataSourceTitle) => {
.should('exist') // Ensure the button exists
.should('be.visible') // Ensure the button is visible
.click({ force: true }); // Click the button
cy.wait(1000);

cy.wait(2000);
cy.visitDataSourcesListingPage();
});

Expand Down
Loading