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: Fix the S3 error case #39240

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const commonlocators = require("../../../../locators/commonlocators.json");

import {
agHelper,
assertHelper,
dataSources,
deployMode,
homePage,
Expand Down Expand Up @@ -45,6 +46,7 @@ describe(

//TestData & save datasource
dataSources.TestSaveDatasource();
agHelper.WaitUntilAllToastsDisappear();
// fetch bucket
cy.wait("@getDatasourceStructure").should(
"have.nested.property",
Expand Down Expand Up @@ -80,8 +82,7 @@ describe(
});

it("2. Generate CRUD page from datasource ACTIVE section", function () {
cy.NavigateToDSGeneratePage(datasourceName);

dataSources.GeneratePageForDS(datasourceName);
// fetch bucket
cy.wait("@getDatasourceStructure").should(
"have.nested.property",
Expand Down Expand Up @@ -129,12 +130,12 @@ describe(
cy.fillAmazonS3DatasourceForm();

//TestData source
cy.get(".t--test-datasource").click();
cy.wait("@testDatasource");
dataSources.TestDatasource(true);
agHelper.WaitUntilAllToastsDisappear();

//Save source
cy.get(".t--save-datasource").click();
cy.wait("@saveDatasource");
dataSources.SaveDatasource();
agHelper.WaitUntilAllToastsDisappear();

//Verify page after save clicked
// cy.get("@saveDatasource").then((httpResponse) => {
Expand Down
4 changes: 2 additions & 2 deletions app/client/cypress/support/Pages/DataSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class DataSources {
"//div[text()='" + name + "']/parent::div";
public _password =
"input[name $= '.datasourceConfiguration.authentication.password']";
private _testDs = ".t--test-datasource";
_saveDs = ".t--save-datasource";
public _testDs = ".t--test-datasource";
public _saveDs = ".t--save-datasource";
Comment on lines +88 to +89
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider keeping selectors private and exposing through methods.

While making selectors public enables direct access, it breaks encapsulation. Consider keeping them private and exposing functionality through methods.

-  public _testDs = ".t--test-datasource";
-  public _saveDs = ".t--save-datasource";
+  private _testDs = ".t--test-datasource";
+  private _saveDs = ".t--save-datasource";
+  public getTestDatasourceSelector() { return this._testDs; }
+  public getSaveDatasourceSelector() { return this._saveDs; }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public _testDs = ".t--test-datasource";
public _saveDs = ".t--save-datasource";
private _testDs = ".t--test-datasource";
private _saveDs = ".t--save-datasource";
public getTestDatasourceSelector() { return this._testDs; }
public getSaveDatasourceSelector() { return this._saveDs; }

_datasourceCard = ".t--datasource";
_dsMenuoptions = "div.t--datasource-menu-option";
_editButton = ".t--edit-datasource";
Expand Down
Loading