-
Notifications
You must be signed in to change notification settings - Fork 4.5k
test: Sign in and Sign up cases #39028
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
Changes from all commits
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,32 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { agHelper, homePage } from "../../../../support/Objects/ObjectsCore"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import SignupPageLocators from "../../../../locators/SignupPage.json"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import loginPage from "../../../../locators/LoginPage.json"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| import welcomePage from "../../../../locators/welcomePage.json"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| const emailOne = `sagarspecSignIn1.${Math.random().toString(36).substring(2, 25)}@appsmith.com`; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| const tempPassword = "testPassword"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| describe("Sign in and Sign up verification", { tags: ["@tag.SignIn"] }, () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("1. User can sign up to application with form.", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| homePage.LogOutviaAPI(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.VisitNAssert("/"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.AssertElementExist(SignupPageLocators.signupLink); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.GetNClick(SignupPageLocators.signupLink); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.AssertURL("/user/signup"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get(loginPage.username).type(emailOne); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get(loginPage.password).type(tempPassword, { log: false }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.get(loginPage.submitBtn).click(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.wait("@getConsolidatedData"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.AssertURL("/signup-success?"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.AssertContains("Brand New"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
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. Avoid using string assertions Replace direct string assertion with data-testid or constants. - agHelper.AssertContains("Brand New");
+ agHelper.AssertElementVisible(welcomePage.welcomeMessage);📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.GetNClick(welcomePage.proficiencyGroupButton, 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.GetNClick(welcomePage.useCaseGroupButton, 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| agHelper.ClickButton("Get started"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+10
to
+26
Contributor
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. Use SignupFromAPI instead of form-based signup According to the coding guidelines, signup should be performed via API using SignupFromAPI. - it("1. User can sign up to application with form.", () => {
- homePage.LogOutviaAPI();
- agHelper.VisitNAssert("/");
- agHelper.WaitUntilEleAppear(SignupPageLocators.forgetPasswordLink);
- agHelper.AssertElementExist(SignupPageLocators.signupLink);
- agHelper.GetNClick(SignupPageLocators.signupLink);
- agHelper.AssertURL("/user/signup");
- cy.get(loginPage.username).type(emailOne);
- cy.get(loginPage.password).type(tempPassword, { log: false });
- cy.get(loginPage.submitBtn).click();
- cy.wait("@getConsolidatedData");
- agHelper.AssertURL("/signup-success?");
- agHelper.AssertContains("Brand New");
- agHelper.GetNClick(welcomePage.proficiencyGroupButton, 0);
- agHelper.GetNClick(welcomePage.useCaseGroupButton, 0);
- agHelper.ClickButton("Get started");
+ it("1. User can sign up to application via API.", () => {
+ homePage.SignupFromAPI(emailOne, tempPassword);
+ // Verify post-signup flow
+ agHelper.AssertURL("/signup-success?");
+ agHelper.GetNClick(welcomePage.proficiencyGroupButton, 0);
+ agHelper.GetNClick(welcomePage.useCaseGroupButton, 0);
+ agHelper.ClickButton("Get started");
});📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
| it("2. User can sign in to application with form.", () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| homePage.LogOutviaAPI(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| cy.LoginFromAPI(emailOne, tempPassword); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| { | ||||||
| "username":"input[name='username']", | ||||||
| "password":"input[name='password']", | ||||||
| "submitBtn":"button[type='submit']", | ||||||
| "signupLink":".t--sign-up" | ||||||
| "username": "input[name='username'], input[name='email']", | ||||||
| "password": "input[name='password']", | ||||||
| "submitBtn": "button[type='submit']", | ||||||
|
Contributor
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. Use data-testid for button selector Replace type attribute selector with data-testid. - "submitBtn": "button[type='submit']",
+ "submitBtn": "[data-testid='t--submit-button']",📝 Committable suggestion
Suggested change
|
||||||
| "signupLink": ".t--sign-up" | ||||||
| } | ||||||
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 cy.wait and use proper assertions
Replace
cy.wait("@getConsolidatedData")with proper assertions to validate the response.📝 Committable suggestion