-
Notifications
You must be signed in to change notification settings - Fork 4.1k
fix: enable form login spec improvement #40693
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
base: release
Are you sure you want to change the base?
Conversation
…th GitHub form handling
WalkthroughThis change replaces the deleted JavaScript Cypress test suite with a new TypeScript version that tests toggling form login/signup and GitHub OAuth settings. It also extends the Changes
Sequence Diagram(s)sequenceDiagram
participant Tester
participant AdminSettingsPage
participant App
Tester->>AdminSettingsPage: Navigate to Authentication Settings
AdminSettingsPage->>App: Open Authentication Tab
Tester->>AdminSettingsPage: Toggle Form Signup/Login (enable/disable)
AdminSettingsPage->>App: Update Auth Settings
App-->>Tester: Show Restart Notice
Tester->>App: Attempt Signup/Login
App-->>Tester: Show Success/Error or Hide UI Elements
Tester->>AdminSettingsPage: Fill and Save GitHub Auth Form
AdminSettingsPage->>App: Save GitHub OAuth Settings
App-->>Tester: Update Login Options
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used📓 Path-based instructions (1)`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
🧠 Learnings (1)app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (8)
⏰ Context from checks skipped due to timeout of 90000ms (7)
🔇 Additional comments (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15115952402. |
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.
Actionable comments posted: 3
🧹 Nitpick comments (3)
app/client/cypress/support/Pages/AdminSettings.ts (1)
12-12
: Consider using data attribute selector instead of class selector.While the
.t--settings-category-authentication
selector follows the project pattern, our guidelines recommend using data-* attributes for selectors rather than classes.- public _authenticationTab = ".t--settings-category-authentication"; + public _authenticationTab = "[data-cy=settings-category-authentication]";app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (2)
167-168
: Consider more specific selectors for absence checks.Instead of generic element type selectors, use more specific data-* attribute selectors.
- agHelper.AssertElementAbsence("form"); - agHelper.AssertElementAbsence(loginPage.signupLink); + agHelper.AssertElementAbsence(loginPage.loginForm); + agHelper.AssertElementAbsence(loginPage.signupLink);Ensure loginPage.loginForm is defined with a data-* attribute in the LoginPage.json file.
187-189
: Use data- attributes for element assertions.*Replace generic element type selectors with specific data-* attribute selectors.
- agHelper.AssertElementAbsence(adminSettings.loginWithGithub); - agHelper.AssertElementExist("form"); - agHelper.AssertElementExist(loginPage.signupLink); + agHelper.AssertElementAbsence(adminSettings.loginWithGithub); + agHelper.AssertElementExist(loginPage.loginForm); + agHelper.AssertElementExist(loginPage.signupLink);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.js
(0 hunks)app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
(1 hunks)app/client/cypress/support/Pages/AdminSettings.ts
(3 hunks)
💤 Files with no reviewable changes (1)
- app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.js
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
app/client/cypress/support/Pages/AdminSettings.ts
🧠 Learnings (1)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (2)
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34781
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_DuplicateLabel_spec.ts:14-16
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In Cypress tests for the Appsmith project, ensure that login is performed via API using `LoginFromAPI` to avoid UI flakiness.
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34781
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_DuplicateLabel_spec.ts:14-16
Timestamp: 2024-07-12T07:45:03.955Z
Learning: In Cypress tests for the Appsmith project, ensure that login is performed via API using `LoginFromAPI` to avoid UI flakiness.
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-lint / client-lint
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
- GitHub Check: build
🔇 Additional comments (9)
app/client/cypress/support/Pages/AdminSettings.ts (3)
3-3
: Good practice importing locators from a JSON file.This keeps selectors centralized and consistent across tests.
52-55
: Well-structured navigation method.This navigation helper properly encapsulates the steps needed to get to the authentication settings tab, which improves code reusability.
57-71
: Good implementation of GitHub form interaction.This method efficiently handles GitHub OAuth configuration with proper environment variable usage and clear action steps.
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (6)
10-35
: Well-structured helper function with proper assertions.The
toggleFormSignupLoginAndSave
function efficiently manages form login/signup settings with good conditional logic. It properly waits for toast notifications to disappear before proceeding.
47-51
: Good helper function for GitHub form interaction.This function properly leverages the AdminSettings page object method and includes appropriate waits for UI updates.
76-105
: Well-structured setup in before hook.The setup code properly ensures the required preconditions are met before tests run, with good conditional logic to check and toggle settings only when needed.
134-134
: Good usage of LoginFromAPI.Using the API login method aligns with our best practices and reduces test flakiness.
146-146
: Good usage of LoginFromAPI in the second test.Consistent use of API login methods throughout the test suite.
171-171
: Consistent use of LoginFromAPI for authentication.Good practice to use API methods for login operations.
agHelper.AssertContains( | ||
"Signup is restricted on this instance of Appsmith", | ||
"exist", | ||
".ads-v2-callout__children", | ||
); |
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
Avoid using class selectors for assertions.
Replace the class selector with a data-* attribute selector for the error message.
- agHelper.AssertContains(
- "Signup is restricted on this instance of Appsmith",
- "exist",
- ".ads-v2-callout__children",
- );
+ agHelper.AssertContains(
+ "Signup is restricted on this instance of Appsmith",
+ "exist",
+ "[data-cy=signup-restricted-message]",
+ );
🤖 Prompt for AI Agents
In
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
between lines 128 and 132, the assertion uses a class selector
".ads-v2-callout__children" which is brittle. Replace this class selector with a
data-* attribute selector that uniquely identifies the error message element to
make the test more stable and maintainable.
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
Outdated
Show resolved
Hide resolved
agHelper.TypeText("[type='email']", email); | ||
agHelper.TypeText("[type='password']", password); | ||
agHelper.GetNClick("[type='submit']"); |
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
Avoid attribute selectors for form elements.
Use data-* attributes instead of type attributes for form elements as per our coding guidelines.
- agHelper.TypeText("[type='email']", email);
- agHelper.TypeText("[type='password']", password);
- agHelper.GetNClick("[type='submit']");
+ agHelper.TypeText(loginPage.emailInput, email);
+ agHelper.TypeText(loginPage.passwordInput, password);
+ agHelper.GetNClick(loginPage.submitBtn);
Ensure these locators are defined in the LoginPage.json file with data-* attributes.
📝 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.
agHelper.TypeText("[type='email']", email); | |
agHelper.TypeText("[type='password']", password); | |
agHelper.GetNClick("[type='submit']"); | |
agHelper.TypeText(loginPage.emailInput, email); | |
agHelper.TypeText(loginPage.passwordInput, password); | |
agHelper.GetNClick(loginPage.submitBtn); |
🤖 Prompt for AI Agents
In
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
around lines 124 to 126, replace the attribute selectors using type='email',
type='password', and type='submit' with selectors that use data-* attributes
according to our coding guidelines. Update the locators to use data attributes
defined in the LoginPage.json file, and modify the test code to reference these
new data-* attribute selectors instead of the type attributes.
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15115952402.
|
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15129654808. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15129654808.
|
|
||
agHelper.AssertElementVisibility(adminSettings.saveButton); | ||
agHelper.GetNClick(adminSettings.saveButton); | ||
agHelper.WaitUntilToastDisappear("Successfully saved"); |
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.
can we move all these functions to AdminSettings helper please? Lets keep only the tests here.
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15254776512. |
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.
Actionable comments posted: 6
♻️ Duplicate comments (3)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (3)
10-13
: Use LogOutviaAPI instead of UI logout.Per our coding guidelines, prefer API methods for logout operations to improve test reliability.
- const logoutFromApp = () => { - agHelper.GetNClick(homePage.profileMenu); - agHelper.GetNClick(homePage.signOutIcon); - }; + const logoutFromApp = () => { + cy.LogOutviaAPI(); + };
69-71
: Avoid attribute selectors for form elements.Use data-* attributes instead of type attributes for form elements as per our coding guidelines.
- agHelper.TypeText("[type='email']", email); - agHelper.TypeText("[type='password']", password); - agHelper.GetNClick("[type='submit']"); + agHelper.TypeText(loginPage.emailInput, email); + agHelper.TypeText(loginPage.passwordInput, password); + agHelper.GetNClick(loginPage.submitBtn);Ensure these locators are defined in the LoginPage.json file with data-* attributes.
73-77
: Avoid using class selectors for assertions.Replace the class selector with a data-* attribute selector for the error message.
- agHelper.AssertContains( - "Signup is restricted on this instance of Appsmith", - "exist", - ".ads-v2-callout__children", - ); + agHelper.AssertContains( + "Signup is restricted on this instance of Appsmith", + "exist", + "[data-cy=signup-restricted-message]", + );
🧹 Nitpick comments (2)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (1)
10-18
: Move helper functions to AdminSettings helper.As suggested in previous comments, consider moving these helper functions to the AdminSettings helper class to keep only the tests in this file and improve reusability.
app/client/cypress/support/Pages/AdminSettings.ts (1)
75-79
: Consider reducing the timeout value.The 200-second timeout (200000ms) seems excessive. Consider using a more reasonable timeout like 30-60 seconds to prevent tests from hanging too long.
- this.agHelper.AssertElementAbsence(AdminsSettings.restartNotice, 200000); + this.agHelper.AssertElementAbsence(AdminsSettings.restartNotice, 60000);
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
(1 hunks)app/client/cypress/support/Pages/AdminSettings.ts
(3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`app/client/cypress/**/**.*`: Review the following e2e test code written using the Cypress test library. Ensure that: - Follow best practices for Cypress code and e2e automation. ...
app/client/cypress/**/**.*
: Review the following e2e test code written using the Cypress test library. Ensure that:
- Follow best practices for Cypress code and e2e automation.
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
app/client/cypress/support/Pages/AdminSettings.ts
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
🧠 Learnings (1)
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts (3)
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34781
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_DuplicateLabel_spec.ts:14-16
Timestamp: 2024-10-08T15:32:34.115Z
Learning: In Cypress tests for the Appsmith project, ensure that login is performed via API using `LoginFromAPI` to avoid UI flakiness.
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34781
File: app/client/cypress/e2e/Regression/ClientSide/Widgets/Button/ButtonGroup_DuplicateLabel_spec.ts:14-16
Timestamp: 2024-07-12T07:45:03.955Z
Learning: In Cypress tests for the Appsmith project, ensure that login is performed via API using `LoginFromAPI` to avoid UI flakiness.
Learnt from: sagar-qa007
PR: appsmithorg/appsmith#34955
File: app/client/cypress/e2e/Regression/ClientSide/ActionExecution/General_settingsTe_Spec.ts:33-33
Timestamp: 2024-10-08T15:32:34.114Z
Learning: Follow best practices for Cypress code and e2e automation:
- Avoid using cy.wait in code.
- Avoid using cy.pause in code.
- Avoid using agHelper.sleep().
- Use locator variables for locators and do not use plain strings.
- Use data-* attributes for selectors.
- Avoid Xpaths, Attributes, and CSS path.
- Avoid selectors like .btn.submit or button[type=submit].
- Perform logins via API with LoginFromAPI.
- Perform logout via API with LogOutviaAPI.
- Perform signup via API with SignupFromAPI.
- Avoid using it.only.
- Avoid using after and aftereach in test cases.
- Use multiple assertions for expect statements.
- Avoid using strings for assertions.
- Do not use duplicate filenames even with different paths.
- Avoid using agHelper.Sleep, this.Sleep in any file in code.
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: client-lint / client-lint
- GitHub Check: client-unit-tests / client-unit-tests
- GitHub Check: client-build / client-build
- GitHub Check: client-prettier / prettier-check
🔇 Additional comments (4)
app/client/cypress/support/Pages/AdminSettings.ts (4)
3-5
: Imports look good.The new imports follow the established pattern for locator files.
14-14
: Property follows best practices.Uses appropriate data-* attribute selector.
54-57
: Navigation method is well-implemented.Properly reuses existing navigation logic and follows the established pattern.
59-73
: Form filling logic is correct.Properly uses environment variables for OAuth credentials and follows the established pattern.
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); | ||
|
||
agHelper.AssertElementVisibility(homePage.homeIcon); | ||
agHelper.GetNClick(homePage.homeIcon, 0, true, 2500); |
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.
Remove explicit timeout parameters that mimic cy.wait.
The timeout parameters in GetNClick
calls effectively function as wait statements, which should be avoided.
- agHelper.GetNClick(homePage.homeIcon, 0, true, 2500);
+ agHelper.GetNClick(homePage.homeIcon, 0, true);
- agHelper.GetNClick(homePage.homeIcon, 0, true, 2500);
+ agHelper.GetNClick(homePage.homeIcon, 0, true);
Also applies to: 118-118
🤖 Prompt for AI Agents
In
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
at line 114 (and also at line 118), the explicit timeout parameters in the
GetNClick function are used to create wait-like behavior, which is discouraged.
Remove these timeout arguments from the GetNClick calls to prevent unnecessary
delays and rely on Cypress's default command timeout handling. Ensure the
function calls are updated accordingly without the timeout parameters.
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
Outdated
Show resolved
Hide resolved
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
Outdated
Show resolved
Hide resolved
.should("contain.text", "Are you sure?"); | ||
agHelper.GetNClick(adminSettings.disconnectBtn); | ||
agHelper.WaitUntilEleAppear(adminSettings.restartNotice); | ||
agHelper.AssertElementAbsence(adminSettings.restartNotice, 200000); |
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.
Replace long timeout with proper assertions.
The 200000ms timeout in AssertElementAbsence
is effectively a wait statement. Use proper UI assertions or wait conditions instead.
- agHelper.AssertElementAbsence(adminSettings.restartNotice, 200000);
+ agHelper.WaitUntilEleDisappear(adminSettings.restartNotice);
📝 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.
agHelper.AssertElementAbsence(adminSettings.restartNotice, 200000); | |
agHelper.WaitUntilEleDisappear(adminSettings.restartNotice); |
🤖 Prompt for AI Agents
In
app/client/cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts
at line 127, the use of a 200000ms timeout in AssertElementAbsence acts as a
long wait, which is inefficient and unreliable. Replace this with Cypress's
built-in assertions that automatically wait for the element to be absent,
removing the explicit timeout and ensuring the test is more robust and faster.
public checkAndDisableGithub() { | ||
// Check if GitHub is connected and disconnect if needed | ||
this.agHelper.GetNClick(AdminsSettings.githubButton); | ||
cy.get("body").then(($body) => { | ||
if ($body.find(AdminsSettings.disconnectBtn).length > 0) { | ||
// GitHub is connected, need to disconnect | ||
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | ||
this.agHelper | ||
.GetElement(AdminsSettings.disconnectBtn) | ||
.should("contain.text", "Are you sure?"); | ||
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | ||
this.agHelper.WaitUntilEleAppear(AdminsSettings.restartNotice); | ||
this.agHelper.AssertElementAbsence( | ||
AdminsSettings.restartNotice, | ||
200000, | ||
); | ||
this.agHelper.WaitForCondition(() => | ||
this.agHelper.AssertContains("GitHub authentication", "exist"), | ||
); | ||
} else { | ||
// GitHub is already disconnected, go back to auth settings | ||
this.agHelper.GetNClick(AdminsSettings.authenticationTab); | ||
} | ||
}); | ||
} |
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
Refactor to use consistent helper methods.
This method uses cy.get()
directly and jQuery methods, which violates the established pattern. Use agHelper methods for consistency.
- cy.get("body").then(($body) => {
- if ($body.find(AdminsSettings.disconnectBtn).length > 0) {
+ this.agHelper.GetElement(AdminsSettings.disconnectBtn).then(($element) => {
+ if ($element.length > 0) {
Also reduce the timeout:
- this.agHelper.AssertElementAbsence(
- AdminsSettings.restartNotice,
- 200000,
- );
+ this.agHelper.AssertElementAbsence(
+ AdminsSettings.restartNotice,
+ 60000,
+ );
📝 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.
public checkAndDisableGithub() { | |
// Check if GitHub is connected and disconnect if needed | |
this.agHelper.GetNClick(AdminsSettings.githubButton); | |
cy.get("body").then(($body) => { | |
if ($body.find(AdminsSettings.disconnectBtn).length > 0) { | |
// GitHub is connected, need to disconnect | |
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | |
this.agHelper | |
.GetElement(AdminsSettings.disconnectBtn) | |
.should("contain.text", "Are you sure?"); | |
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | |
this.agHelper.WaitUntilEleAppear(AdminsSettings.restartNotice); | |
this.agHelper.AssertElementAbsence( | |
AdminsSettings.restartNotice, | |
200000, | |
); | |
this.agHelper.WaitForCondition(() => | |
this.agHelper.AssertContains("GitHub authentication", "exist"), | |
); | |
} else { | |
// GitHub is already disconnected, go back to auth settings | |
this.agHelper.GetNClick(AdminsSettings.authenticationTab); | |
} | |
}); | |
} | |
public checkAndDisableGithub() { | |
// Check if GitHub is connected and disconnect if needed | |
this.agHelper.GetNClick(AdminsSettings.githubButton); | |
this.agHelper.GetElement(AdminsSettings.disconnectBtn).then(($element) => { | |
if ($element.length > 0) { | |
// GitHub is connected, need to disconnect | |
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | |
this.agHelper | |
.GetElement(AdminsSettings.disconnectBtn) | |
.should("contain.text", "Are you sure?"); | |
this.agHelper.GetNClick(AdminsSettings.disconnectBtn); | |
this.agHelper.WaitUntilEleAppear(AdminsSettings.restartNotice); | |
this.agHelper.AssertElementAbsence( | |
AdminsSettings.restartNotice, | |
60000, | |
); | |
this.agHelper.WaitForCondition(() => | |
this.agHelper.AssertContains("GitHub authentication", "exist"), | |
); | |
} else { | |
// GitHub is already disconnected, go back to auth settings | |
this.agHelper.GetNClick(AdminsSettings.authenticationTab); | |
} | |
}); | |
} |
🤖 Prompt for AI Agents
In app/client/cypress/support/Pages/AdminSettings.ts lines 81 to 105, the method
uses cy.get() and direct jQuery methods instead of the existing agHelper helper
methods, which should be used for consistency. Replace cy.get() and jQuery
find() with appropriate agHelper methods, and reduce the timeout for assertions
as suggested. Ensure all element interactions and assertions use agHelper
methods for uniformity and update the timeout parameter accordingly.
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15259373241. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15259373241.
|
/ci-test-limit-count run_count=10 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15259677069. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15259677069.
|
/ci-test-limit-count run_count=2 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15262930304. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15262930304.
|
…ethods and improving element assertions
/ci-test-limit-count run_count=1 update_snapshot=false specs_to_run=cypress/e2e/Regression/ClientSide/FormLogin/EnableFormLogin_spec.ts |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/15269760508. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15269760508.
|
objectsCoreAdminSettings.NavigateToAuthenticationSettings(); | ||
objectsCoreAdminSettings.toggleFormSignupLoginAndSave(true, "signup"); | ||
}); | ||
}, |
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.
Please add the section under comment // validating form signup is disabled
from the original file. That cross checks this setting change to true now allows signups without any callout.
cy.LoginFromAPI(Cypress.env("USERNAME"), Cypress.env("PASSWORD")); | ||
|
||
agHelper.AssertElementVisibility(homePage.homeIcon); | ||
agHelper.GetNClick(homePage.homeIcon, 0, true, 2500); |
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.
why do we need this?
objectsCoreAdminSettings.toggleFormSignupLoginAndSave(true, "login"); | ||
agHelper.AssertElementVisibility(homePage.homeIcon); | ||
agHelper.GetNClick(homePage.homeIcon, 0, true, 2500); | ||
objectsCoreAdminSettings.NavigateToAuthenticationSettings(false); |
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.
Steps 76 and 77 not needed. Might as well update 78 to:
objectsCoreAdminSettings.NavigateToAuthenticationSettings(true)
.should("contain.text", "Are you sure?"); | ||
agHelper.GetNClick(adminSettings.disconnectBtn); | ||
agHelper.WaitUntilEleAppear(adminSettings.restartNotice); | ||
agHelper.AssertElementAbsence(adminSettings.restartNotice, 200000); |
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.
lets remove line 85 and 86 and instead add:
agHelper.WaitUntilEleAppear(homePage.profileMenu)
This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected. |
Description
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15269749230
Commit: e0f22f9
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Tue, 27 May 2025 08:44:00 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit