@@ -11,9 +11,8 @@ describe('Log In Feature: Test Instructor Login', () => {
1111 cy . get ( '#cu-privacy-notice-button' ) . click ( ) ;
1212 cy . get ( '#guest-login' ) . click ( ) ;
1313 cy . get ( '#login-local>div.login-local-form' ) . should ( 'be.visible' ) ;
14- cy . get ( '#id_username' ) . type ( 'instructor_one' ) . blur ( ) ;
15- cy . get ( '#id_password' ) . type ( 'test' ) . blur ( ) ;
16- cy . get ( '#login-local input[type="submit"]' ) . click ( ) ;
14+ cy . login ( 'instructor_one' , 'test' ) ;
15+ cy . visit ( '/' ) ;
1716 cy . get ( '#course-title' ) . contains ( 'My Courses' ) ;
1817 cy . get ( '#sandboxes_link' ) . click ( ) ;
1918 cy . get ( '.choose-course' ) . should ( 'contain' , 'Sample Course' ) ;
@@ -31,9 +30,7 @@ describe('Log In Feature: Test Invalid login', () => {
3130 cy . get ( '#cu-privacy-notice-button' ) . click ( ) ;
3231 cy . get ( '#guest-login' ) . click ( ) ;
3332 cy . get ( '#login-local>div.login-local-form' ) . should ( 'be.visible' ) ;
34- cy . get ( '#id_username' ) . type ( 'foo' ) . blur ( ) ;
35- cy . get ( '#id_password' ) . type ( 'foo' ) . blur ( ) ;
36- cy . get ( '#login-local input[type="submit"]' ) . click ( ) ;
33+ cy . login ( 'foo' , 'foo' ) ;
3734 cy . title ( ) . should ( 'contain' , 'Login' ) ;
3835 } ) ;
3936} ) ;
@@ -45,9 +42,8 @@ describe('Log In Feature: Test Student Login', () => {
4542 cy . get ( '#cu-privacy-notice-button' ) . click ( ) ;
4643 cy . get ( '#guest-login' ) . click ( ) ;
4744 cy . get ( '#login-local>div.login-local-form' ) . should ( 'be.visible' ) ;
48- cy . get ( '#id_username' ) . type ( 'student_one' ) . blur ( ) ;
49- cy . get ( '#id_password' ) . type ( 'test' ) . blur ( ) ;
50- cy . get ( '#login-local input[type="submit"]' ) . click ( ) ;
45+ cy . login ( 'student_one' , 'test' ) ;
46+ cy . visit ( '/' ) ;
5147 cy . title ( ) . should ( 'contain' , 'Sample Course' ) ;
5248 cy . visit ( '/accounts/logout/?next=/' ) ;
5349 cy . title ( ) . should ( 'contain' , 'Splash' ) ;
@@ -61,9 +57,8 @@ describe('Log In Feature: Test Switch Course feature', () => {
6157 cy . get ( '#cu-privacy-notice-button' ) . click ( ) ;
6258 cy . get ( '#guest-login' ) . click ( ) ;
6359 cy . get ( '#login-local>div.login-local-form' ) . should ( 'be.visible' ) ;
64- cy . get ( '#id_username' ) . type ( 'student_three' ) . blur ( ) ;
65- cy . get ( '#id_password' ) . type ( 'test' ) . blur ( ) ;
66- cy . get ( '#login-local input[type="submit"]' ) . click ( ) ;
60+ cy . login ( 'student_three' , 'test' ) ;
61+ cy . visit ( '/' ) ;
6762
6863 cy . title ( ) . should ( 'contain' , 'My Courses' ) ;
6964 cy . get ( '#sandboxes_link' ) . click ( ) ;
0 commit comments