-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat: datasource homepage ui redesign and search functionality for the datasources #38360
Changes from 26 commits
edecabd
19d07d8
97b2197
a880be6
d9defc9
e5ed096
aeaeec2
35f1347
7c0f440
f652ddd
fdb2f41
8e3f1e2
7801328
bff9896
307be87
d1c8430
fdb8873
df2bd3c
3ec726c
17ed083
5e1877f
832c305
9622d18
e95fb60
58919a9
4f4ab22
e6494bd
a06b3fb
9c34a59
028d7f3
23a91a2
aa2489b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,8 +36,6 @@ describe( | |
); | ||
//mock datasource image | ||
cy.datasourceImageStyle("[data-testid=mock-datasource-image]"); | ||
//header text | ||
cy.datasourceContentWrapperStyle(".t--datasource-name"); | ||
//Name wrapper | ||
cy.get("[data-testid=mock-datasource-name-wrapper]") | ||
.should("have.css", "display", "flex") | ||
|
@@ -61,13 +59,9 @@ describe( | |
"[data-testid=database-datasource-content-wrapper]", | ||
); | ||
//Icon wrapper | ||
cy.datasourceIconWrapperStyle( | ||
"[data-testid=database-datasource-content-wrapper] .dataSourceImage", | ||
); | ||
cy.datasourceIconWrapperStyle("[data-testid=database-datasource-image]"); | ||
//Name | ||
cy.datasourceNameStyle( | ||
"[data-testid=database-datasource-content-wrapper] .textBtn", | ||
); | ||
cy.datasourceNameStyle(".t--plugin-name"); | ||
}); | ||
|
||
it("3. New API datasource card design", () => { | ||
|
@@ -87,7 +81,7 @@ describe( | |
//Icon wrapper | ||
cy.datasourceIconWrapperStyle(".content-icon"); | ||
//Name | ||
cy.datasourceNameStyle(".t--createBlankApiCard .textBtn"); | ||
cy.datasourceNameStyle(".t--createBlankApiCard .t--plugin-name"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Use data- attributes to avoid potential flakiness* |
||
}); | ||
|
||
after(() => { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,7 +170,7 @@ export class DataSources { | |
_usePreparedStatement = | ||
"input[name='actionConfiguration.pluginSpecifiedTemplates[0].value'][type='checkbox'], input[name='actionConfiguration.formData.preparedStatement.data'][type='checkbox']"; | ||
_mockDB = (dbName: string) => | ||
"//span[text()='" + | ||
"//p[text()='" + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid using XPath for Cypress tests. Here's an example diff proposing the change: - private _mockDB = (dbName: string) =>
- "//p[text()='" + dbName + "']/ancestor::div[contains(@class, 't--mock-datasource')][1]";
+ private _mockDB = (dbName: string) =>
+ `[data-testid="mock-datasource-${dbName}"]`;
|
||
dbName + | ||
"']/ancestor::div[contains(@class, 't--mock-datasource')][1]"; | ||
private _createBlankGraphQL = ".t--createBlankApiGraphqlCard"; | ||
|
@@ -203,7 +203,7 @@ export class DataSources { | |
_queryTimeout = "//input[@name='actionConfiguration.timeoutInMillisecond']"; | ||
_getStructureReq = "/api/v1/datasources/*/structure?ignoreCache=true"; | ||
_editDatasourceFromActiveTab = (dsName: string) => | ||
".t--datasource-name:contains('" + dsName + "')"; | ||
".t--plugin-name:contains('" + dsName + "')"; | ||
_mandatoryMark = "//span[text()='*']"; | ||
_deleteDSHostPort = ".t--delete-field"; | ||
_dsTabSchema = "[data-testid='t--tab-DATASOURCE_TAB']"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Switch to data- attributes for improved stability*
Using a CSS class
.t--plugin-name
can lead to flaky tests if the class name changes. Consider using a data-* attribute for more robust test selectors.