학습 목적으로 간단한 수락 테스트를 수행하려고합니다. 간단한 인증 시나리오입니다. 사용자가 /admin
을 입력하고 기록하지 않으면 /login
으로 리디렉션되어 양식을 채 웁니다.양식 필드를 채우기 위해 코드화를 얻을 수 없습니다.
1) Couldn't login with a password protected area in LoginCest.loginUserWithProperCredentials
Guy couldn't fill field "username","rafael": Field matching id|name|label|value or css or xpath selector does not exist
Scenario Steps:
5. I fill field "username","rafael" <==== RED
4. I see current url equals "/login"
3. I am on page "/admin"
2. So that I Perform administrative tasks
1. As a Site Owner
지금 여기 내보기입니다 : 내가 테스트를 실행하면
내가이 오류를 얻을 어떤 도움을 주시면 감사하겠습니다
class LoginCest
{
public function loginUserWithProperCredentials(WebGuy $I){
$I->am("Site Owner");
$I->wantTo("Login with a password protected area");
$I->lookForwardTo("Perform administrative tasks");
$I->amOnPage('/admin');
$I->seeCurrentUrlEquals('/login');
$I->fillField('username', 'rafael');
$I->fillField("password", "123456");
$I->click("Login");
$I->seeCurrentUrlEquals("/admin");
$I->see("Admin area", "h1");
}
}
: 여기
//create.blade.php
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
</head>
<body>
<h1>Login</h1>
{{ Form::open() }}
<div>
{{ Form::Label('username', 'Username') }}
{{ Form::Text('username', '') }}
</div>
<div>
{{ Form::label('password', 'Password') }}
{{ Form::password('password', '') }}
</div>
<div>
{{ Form::submit('Login') }}
</div>
{{ Form::close() }}
</body>
</html>
그리고 테스트입니다 .