-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d1f3250
commit 1a952c6
Showing
13 changed files
with
66 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
Feature: Register | ||
Scenario: User enters valid details to create a new account | ||
# Given the user has the register form modal open | ||
# And the user enters all details | ||
# When the user clicks on the register button | ||
# Then application creates a new user account | ||
# And the login modal opens on top of the register for the user to login | ||
Given the user is on the register page | ||
When the user enters all form required details | ||
Then user submits the register form | ||
Then I should see the text "Get started and login to your account" | ||
|
||
Scenario: User enters incorrect details or missing mandatory fields | ||
# Given the user has the register form modal open | ||
# And the user enters some fields | ||
# When the user clicks on the register button | ||
# Then the form displays the required errors | ||
Given the user is on the register page | ||
Then user submits the register form | ||
Then the form displays the required errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
import { When } from "@badeball/cypress-cucumber-preprocessor"; | ||
import { clickOnText } from "./rtlDescriptors"; | ||
import { homePageDescriptor } from "../../e2e/pageDescriptors"; | ||
|
||
When("I enter user email and password", () => { | ||
homePageDescriptor.emailLoginInput().type("[email protected]"); | ||
homePageDescriptor.passwordLoginInput().type("Password@123"); | ||
cy.get("input[name='email']").type("[email protected]"); | ||
cy.get("input[name='password']").type("Password@123"); | ||
}); | ||
|
||
When("I click to login button", () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
import { Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
import { homePageDescriptor } from "../../e2e/pageDescriptors"; | ||
import { Given, Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
|
||
Given("the user is on the register page", () => { | ||
cy.visit("/register"); | ||
}); | ||
|
||
Then("I open the menu drawer", () => { | ||
homePageDescriptor.menuBtn().click(); | ||
cy.get("[data-cy='menu-toggle']").click(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { When, Then } from "@badeball/cypress-cucumber-preprocessor"; | ||
import { clickOnText, findByText } from "./rtlDescriptors"; | ||
|
||
When("the user enters all form required details", () => { | ||
cy.get("[data-cy='input-register-email']").type("[email protected]"); | ||
cy.get("[data-cy='input-register-password']").type("Password@123"); | ||
cy.get("[data-cy='input-passwordConfirm']").type("Password@123"); | ||
cy.get("[data-cy='input-firstName']").type("Richard"); | ||
}); | ||
|
||
Then("user submits the register form", () => { | ||
clickOnText("Register"); | ||
}); | ||
|
||
Then("the form displays the required errors", () => { | ||
findByText("Enter a valid email."); | ||
findByText("Enter a password."); | ||
findByText("Enter a confirm password."); | ||
findByText("Enter a first name."); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,11 +84,23 @@ export function RegisterForm() { | |
return ( | ||
<FormProvider {...form}> | ||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6 py-4"> | ||
<FormInput name="email" type="email" label="Email address" placeholder="[email protected]" /> | ||
<FormInput | ||
name="email" | ||
type="email" | ||
label="Email address" | ||
placeholder="[email protected]" | ||
dataCy="input-register-email" | ||
/> | ||
|
||
<div> | ||
<div className="flex flex-col space-y-2 md:flex-row md:space-x-4 md:space-y-0"> | ||
<FormInput name="password" type="password" label="Password" placeholder="*******" /> | ||
<FormInput | ||
name="password" | ||
type="password" | ||
label="Password" | ||
placeholder="*******" | ||
dataCy="input-register-password" | ||
/> | ||
<FormInput name="passwordConfirm" type="password" label="Password confirmation" placeholder="*******" /> | ||
</div> | ||
|
||
|
@@ -143,7 +155,7 @@ export function RegisterForm() { | |
)} | ||
|
||
<Button type="submit" fullWidth disabled={isLoadingRegister} loading={isLoadingRegister}> | ||
Create | ||
Register | ||
</Button> | ||
</form> | ||
</FormProvider> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters