-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #118 from near/playwright-add-data-ids
Data-test-ids for playwright testing
- Loading branch information
Showing
7 changed files
with
21 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,13 +343,14 @@ function SignInPage() { | |
placeholder="[email protected]" | ||
type="email" | ||
id="email" | ||
data-test-id="add-device-email" | ||
required | ||
/> | ||
</label> | ||
|
||
</InputContainer> | ||
|
||
<Button type="submit" size="large" label="Continue" variant="affirmative" onClick={onSubmit} /> | ||
<Button type="submit" size="large" label="Continue" variant="affirmative" data-test-id="add-device-continue-button" onClick={onSubmit} /> | ||
</FormContainer> | ||
</StyledContainer> | ||
); | ||
|
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 |
---|---|---|
|
@@ -191,11 +191,11 @@ function CreateAccount() { | |
<StyledContainer> | ||
<FormContainer onSubmit={onSubmit}> | ||
<header> | ||
<h1>Create account</h1> | ||
<h1 data-test-id="heading_create">Create account</h1> | ||
<p className="desc"> | ||
<span>Have an account?</span> | ||
{' '} | ||
<Link to="/login">Sign in</Link> | ||
<Link to="/login" data-test-id="create_login_link">Sign in</Link> | ||
</p> | ||
</header> | ||
|
||
|
@@ -222,6 +222,7 @@ function CreateAccount() { | |
placeholder="[email protected]" | ||
type="email" | ||
id="email" | ||
data-test-id="email_create" | ||
/> | ||
<div className="select-mail-provider"> | ||
{emailProviders.map((provider) => { | ||
|
@@ -238,7 +239,7 @@ function CreateAccount() { | |
})} | ||
</div> | ||
<div className="subText"> | ||
<div className="error"> | ||
<div className="error" data-test-id="create_email_subtext_error"> | ||
<ErrorMessage | ||
errors={errors} | ||
name="email" | ||
|
@@ -280,6 +281,7 @@ function CreateAccount() { | |
setIsUsernameAvailable(isAccountAvailable); | ||
return null; | ||
}} | ||
data-test-id="username_create" | ||
placeholder="user_name" | ||
/> | ||
<div className="input-group-right"> | ||
|
@@ -291,14 +293,14 @@ function CreateAccount() { | |
{isUsernameAvailable && ( | ||
<div className="success"> | ||
<SuccessSvg /> | ||
<span>Account ID available</span> | ||
<span data-test-id="account_available_notice">Account ID available</span> | ||
</div> | ||
)} | ||
<ErrorMessage | ||
errors={errors} | ||
name="username" | ||
render={({ message }) => ( | ||
<div className="error"> | ||
<div className="error" data-test-id="create-error-subtext"> | ||
<ErrorSvg /> | ||
<span>{message}</span> | ||
</div> | ||
|
@@ -307,7 +309,7 @@ function CreateAccount() { | |
</div> | ||
</InputContainer> | ||
|
||
<Button label="Continue" variant="affirmative" type="submit" size="large" /> | ||
<Button label="Continue" variant="affirmative" type="submit" size="large" data-test-id="continue_button_create" /> | ||
</FormContainer> | ||
</StyledContainer> | ||
); | ||
|
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 |
---|---|---|
|
@@ -62,7 +62,7 @@ function Login() { | |
<LoginWrapper> | ||
<form onSubmit={onSubmit}> | ||
<header> | ||
<h1>Log In</h1> | ||
<h1 data-test-id="heading_login">Log In</h1> | ||
<p className="desc">Please enter your email</p> | ||
</header> | ||
|
||
|
@@ -77,6 +77,7 @@ function Login() { | |
}} | ||
placeholder="[email protected]" | ||
type="email" | ||
data-test-id="email_login" | ||
required | ||
/> | ||
</label> | ||
|
@@ -87,6 +88,7 @@ function Login() { | |
type="submit" | ||
label="Continue" | ||
variant="affirmative" | ||
data-test-id="login_button" | ||
onClick={onSubmit} | ||
/> | ||
</form> | ||
|
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