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

test: regression tests for import flow #38457

Merged
merged 8 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
@@ -0,0 +1,69 @@
import {
agHelper,
homePage,
gitSync,
appSettings,
locators,
} from "../../../../support/Objects/ObjectsCore";
import EditorNavigation, {
AppSidebar,
AppSidebarButton,
} from "../../../../support/Pages/EditorNavigation";
import ReconnectLocators from "../../../../locators/ReconnectLocators";

describe(
"Tests Import option for Git connected apps and normal apps",
{},
() => {
before(() => {
gitSync.CreateNConnectToGit();
});

it("1. Verify Import Option", () => {
let Datasource = [
"AWSLambda",
"Airtable",
"GSheets_RWDSelected",
"GSheets_RWDAll",
"Hubspot",
"gsheet",
"Twilio",
"Dynamo",
"ElasticSearch",
"Firestore",
"Movies",
"Mongo",
"Oracle",
"Redshift",
"PostGreSQL",
"SMTP",
"Snowflake",
"S3",
"Oauth2.0",
"Pixabay",
"OpenAI",
];
AppSidebar.navigate(AppSidebarButton.Settings);
agHelper.GetNClick(appSettings.locators._importHeader);
agHelper.AssertElementEnabledDisabled(appSettings.locators._importBtn);

homePage.NavigateToHome();
homePage.CreateNewApplication();
AppSidebar.navigate(AppSidebarButton.Settings);
agHelper.GetNClick(appSettings.locators._importHeader);
agHelper.AssertElementEnabledDisabled(
appSettings.locators._importBtn,
0,
false,
);
agHelper.GetNClick(appSettings.locators._importBtn);
homePage.ImportApp("TryToCoverMore.json", "", true);
agHelper.GetNClick(ReconnectLocators.SkipToAppBtn);

AppSidebar.navigate(AppSidebarButton.Data);
Datasource.forEach((ds) => {
agHelper.GetNAssertContains(locators._listItemTitle, ds);
});
});
},
);
1 change: 1 addition & 0 deletions app/client/cypress/fixtures/TryToCoverMore.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/client/cypress/limited-tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# To run only limited tests - give the spec names in below format:
cypress/e2e/Regression/ClientSide/VisualTests/JSEditorIndent_spec.js
cypress/e2e/Regression/ClientSide/PartialImportExport/VerifyImport_spec.ts
# For running all specs - uncomment below:
#cypress/e2e/**/**/*

Expand Down
1 change: 1 addition & 0 deletions app/client/cypress/support/Objects/CommonLocators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,5 @@ export class CommonLocators {
_editorTab = ".editor-tab";
_entityTestId = (entity: string) =>
`[data-testid="t--entity-item-${entity}"]`;
_listItemTitle = ".ads-v2-listitem__title";
}
2 changes: 2 additions & 0 deletions app/client/cypress/support/Pages/AppSettings/AppSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export class AppSettings {
_scrollArrows: ".scroll-arrows",
_getActivePage: (pageName: string) =>
`//span[contains(text(),"${pageName}")]//ancestor::a[contains(@class,'is-active')]`,
_importBtn: "[data-testid='t--app-setting-import-btn']",
_listItemTitle = ".ads-v2-listitem__title",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the syntax error in the object literal.

Use a colon (:) instead of an equals sign, otherwise it will not parse correctly as an object property. Also, consider adding or using a data-* attribute for greater stability instead of targeting a CSS class selector.

Apply this diff to fix the syntax error:

- _listItemTitle = ".ads-v2-listitem__title",
+ _listItemTitle: ".ads-v2-listitem__title",

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome (1.9.4)

[error] 64-64: Did you mean to use a :? An = can only follow a property name when the containing object literal is part of a destructuring pattern.

(parse)

};

public errorMessageSelector = (fieldId: string) => {
Expand Down
Loading