This repository was archived by the owner on Mar 17, 2020. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 7 files changed +90
-38
lines changed 
administrator/modules/mod_login/tmpl 
Page/Acceptance/Administrator 
Step/Acceptance/Administrator Expand file tree Collapse file tree 7 files changed +90
-38
lines changed Original file line number Diff line number Diff line change 2525							<?php  echo  JText::_ ('JGLOBAL_USERNAME ' ); ?> 
2626						</label>
2727					</span>
28- 					<input name="username" tabindex="1" id="mod-login-username" type="text" class="input-medium" placeholder="<?php  echo  JText::_ ('JGLOBAL_USERNAME ' ); ?> " size="15" autofocus="true" />
28+ 					<input name="username" tabindex="1" id="mod-login-username" type="text" class="input-medium" placeholder="<?php  echo  JText::_ ('JGLOBAL_USERNAME ' ); ?> " size="15" autofocus="true" data-tests="username" />
2929					<a href="<?php  echo  JUri::root (); ?> index.php?option=com_users&view=remind" class="btn width-auto hasTooltip" title="<?php  echo  JText::_ ('MOD_LOGIN_REMIND ' ); ?> ">
3030						<span class="icon-help"></span>
3131					</a>
4141							<?php  echo  JText::_ ('JGLOBAL_PASSWORD ' ); ?> 
4242						</label>
4343					</span>
44- 					<input name="passwd" tabindex="2" id="mod-login-password" type="password" class="input-medium" placeholder="<?php  echo  JText::_ ('JGLOBAL_PASSWORD ' ); ?> " size="15"/>
44+ 					<input name="passwd" tabindex="2" id="mod-login-password" type="password" class="input-medium" placeholder="<?php  echo  JText::_ ('JGLOBAL_PASSWORD ' ); ?> " size="15" data-tests="password" />
4545					<a href="<?php  echo  JUri::root (); ?> index.php?option=com_users&view=reset" class="btn width-auto hasTooltip" title="<?php  echo  JText::_ ('MOD_LOGIN_RESET ' ); ?> ">
4646						<span class="icon-help"></span>
4747					</a>
8484		<div class="control-group">
8585			<div class="controls">
8686				<div class="btn-group">
87- 					<button tabindex="3" class="btn btn-primary btn-block btn-large">
87+ 					<button tabindex="3" class="btn btn-primary btn-block btn-large" data-tests="log in" >
8888						<span class="icon-lock icon-white"></span> <?php  echo  JText::_ ('MOD_LOGIN_LOGIN ' ); ?> 
8989					</button>
9090				</div>
Original file line number Diff line number Diff line change 1+ <?php 
2+ namespace  Page \Acceptance \Administrator ;
3+ 
4+ class  Login extends  \AcceptanceTester
5+ {
6+ 	/** 
7+      * @When I login into Joomla Administrator with username :arg1 and password :arg1 
8+      */ 
9+     public  function  login ($ username , $ password )
10+     {
11+ 			$ I  = $ this  ;
12+ 			$ I ->amOnPage ('administrator/ ' );
13+ 			$ I ->fillField (['css '  => 'input[data-tests="username"] ' ], $ username );
14+ 			$ I ->fillField (['css '  => 'input[data-tests="password"] ' ], $ password );
15+ 			$ I ->click (['css '  => 'button[data-tests="log in"] ' ]);
16+     }
17+ }
Original file line number Diff line number Diff line change 1+ <?php 
2+ namespace  Step \Acceptance \Administrator ;
3+ 
4+ class  User extends  \AcceptanceTester
5+ {
6+ 	/** 
7+ 	 * @Given I am registered administrator named :arg1 
8+ 	 */ 
9+ 	public  function  iAmRegisteredAdministratorNamed ($ arg1 )
10+ 	{
11+ 		$ I  = $ this  ;
12+ 		$ I ->comment ('@todo ' );
13+ 	}
14+ 
15+ 	/** 
16+ 	 * @Then I should see administrator dashboard 
17+ 	 */ 
18+ 	public  function  iShouldSeeAdministratorDashboard ()
19+ 	{
20+ 		$ I  = $ this  ;
21+ 		$ I ->comment ('@todo ' );
22+ 	}
23+ }
Original file line number Diff line number Diff line change @@ -30,4 +30,10 @@ modules:
3030            language : ' English (United Kingdom)'     #  Language in which you want the Application to be Installed
3131        AcceptanceHelper :
3232            url : ' http://localhost/tests/joomla-cms3'   #  the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here
33- error_level : " E_ALL & ~E_STRICT & ~E_DEPRECATED" 
33+ error_level : " E_ALL & ~E_STRICT & ~E_DEPRECATED" 
34+ gherkin :
35+     contexts :
36+         default :
37+             - AcceptanceTester 
38+             - Step\Acceptance\Administrator\User 
39+             - Page\Acceptance\Administrator\Login 
Original file line number Diff line number Diff line change 11<?php 
2- // Here you can initialize variables that will be available to your tests 
3- 
4- \Codeception \Util \Autoload::registerSuffix ('Steps ' , __DIR__ . DIRECTORY_SEPARATOR  . '_steps ' );
Original file line number Diff line number Diff line change 1+ Feature : administrator login 
2+   In order to manage my web application
3+   As administrator
4+   I  need to be able to login
5+ 
6+   Scenario : Successful login 
7+     Given  I am registered administrator named "admin" 
8+     When  I login into Joomla Administrator with username "admin"  and password "admin" 
9+     Then  I should see administrator dashboard
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments