Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
80e0d56a
Commit
80e0d56a
authored
10 years ago
by
Waqas Khalid
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6368 from sjackso/login_error_fix
Login error fix TNL-140
parents
7a9ec6bd
c44fe736
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
0 deletions
+59
-0
AUTHORS
+1
-0
cms/djangoapps/contentstore/features/signup.feature
+15
-0
cms/djangoapps/contentstore/features/signup.py
+34
-0
cms/static/js/factories/login.js
+9
-0
No files found.
AUTHORS
View file @
80e0d56a
...
...
@@ -186,3 +186,4 @@ Afzal Wali <afzaledx@edx.org>
Julien Romagnoli <julien.romagnoli@fbmx.net>
Wenjie Wu <wuwenjie718@gmail.com>
Aamir <aamir.nu.206@gmail.com>
Steve Jackson <sjackso@ixoreus.net>
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/features/signup.feature
View file @
80e0d56a
...
...
@@ -27,3 +27,18 @@ Feature: CMS.Sign in
When
I fill in and submit the signin form
And
I wait for
"2"
seconds
Then
I should see that the path is
"/course/"
Scenario
:
Login with mistyped credentials
Given
I have opened a new course in Studio
And
I am not logged in
And
I visit the Studio homepage
When
I click the link with the text
"Sign In"
Then
I should see that the path is
"/signin"
And
I should not see a login error message
And
I fill in and submit the signin form incorrectly
Then
I should see a login error message
And
I edit the password field
Then
I should not see a login error message
And
I submit the signin form
And
I wait for
"2"
seconds
Then
I should see that the path is
"/course/"
This diff is collapsed.
Click to expand it.
cms/djangoapps/contentstore/features/signup.py
View file @
80e0d56a
...
...
@@ -2,6 +2,7 @@
# pylint: disable=redefined-outer-name
from
lettuce
import
world
,
step
from
nose.tools
import
assert_true
,
assert_false
# pylint: disable=no-name-in-module
@step
(
'I fill in the registration form$'
)
...
...
@@ -36,3 +37,36 @@ def i_fill_in_the_signin_form(step):
login_form
.
find_by_name
(
'password'
)
.
fill
(
'test'
)
login_form
.
find_by_name
(
'submit'
)
.
click
()
world
.
retry_on_exception
(
fill_login_form
)
@step
(
u'I should( not)? see a login error message$'
)
def
i_should_see_a_login_error
(
step
,
should_not_see
):
if
should_not_see
:
# the login error may be absent or invisible. Check absence first,
# because css_visible will throw an exception if the element is not present
if
world
.
is_css_present
(
'div#login_error'
):
assert_false
(
world
.
css_visible
(
'div#login_error'
))
else
:
assert_true
(
world
.
css_visible
(
'div#login_error'
))
@step
(
u'I fill in and submit the signin form incorrectly$'
)
def
i_goof_in_the_signin_form
(
step
):
def
fill_login_form
():
login_form
=
world
.
browser
.
find_by_css
(
'form#login_form'
)
login_form
.
find_by_name
(
'email'
)
.
fill
(
'robot+studio@edx.org'
)
login_form
.
find_by_name
(
'password'
)
.
fill
(
'oops'
)
login_form
.
find_by_name
(
'submit'
)
.
click
()
world
.
retry_on_exception
(
fill_login_form
)
@step
(
u'I edit the password field$'
)
def
i_edit_the_password_field
(
step
):
password_css
=
'form#login_form input#password'
world
.
css_fill
(
password_css
,
'test'
)
@step
(
u'I submit the signin form$'
)
def
i_submit_the_signin_form
(
step
):
submit_css
=
'form#login_form button#submit'
world
.
css_click
(
submit_css
)
This diff is collapsed.
Click to expand it.
cms/static/js/factories/login.js
View file @
80e0d56a
...
...
@@ -12,6 +12,15 @@ define(['jquery.cookie', 'utility'], function() {
});
}
// Clear the login error message when credentials are edited
$
(
'input#email'
).
on
(
'input'
,
function
()
{
$
(
'#login_error'
).
removeClass
(
'is-shown'
);
});
$
(
'input#password'
).
on
(
'input'
,
function
()
{
$
(
'#login_error'
).
removeClass
(
'is-shown'
);
});
$
(
'form#login_form'
).
submit
(
function
(
event
)
{
event
.
preventDefault
();
var
submit_data
=
$
(
'#login_form'
).
serialize
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment