Skip to content

Instantly share code, notes, and snippets.

@palmic
Created March 6, 2012 10:42
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save palmic/1985634 to your computer and use it in GitHub Desktop.
Save palmic/1985634 to your computer and use it in GitHub Desktop.
Acount login feature
Feature: management login
As a account owner
I want to login to my account management
Background:
Given We are logged out
And We have no user
And I create new account
Scenario: management login
When I go to new account info edit #behat native step
Then User is not authenticated #behat native step
And Response status code is 401 #behat native step
And I should see "sf_guard signin" form
When I login as "created account owner"
Then User is authenticated #behat native step
And I should see "created account" "info" edit
When We are logged out
Then User is not authenticated #behat native step
$steps->Given('/^We are logged out$/', function($world) use ($steps) {
$steps->When('I go to signout', $world)
->And('I was redirected', $world)
->Then('User is not authenticated', $world)
;
});
$steps->Given('/^We have no user$/', function($world) use($steps)
{
$steps->Given('We have no book saved', $world);
// delete all accounts...
});
$steps->When('/^I create new account$/', function($world) use ($steps)
{
$steps->When('I go to new account form', $world)
->And('I submit account', $world)
->And('I follow redirect', $world);
});
// finds form by MVC action name trough form action URL
$steps->Then('/^I should see "([^"]*)" form$/', function($world, $kw)
{
$action = sfContext::getInstance()->getRouting()->generate(str_replace(' ', '_', $kw));
$world->browser->with('response')->checkElement('form[action="' . $action . '"]');
});
$steps->When('/^I login as "created account owner"$/', function($world)
{
$world->browser->click('form input[type="submit"]', array('signin' => array(
'username' => $world->dataFormAccountCreate['User']['cs']['email'],
'password' => $world->dataFormAccountCreate['User']['password'],
)))->followRedirect();
});
// checks if current response is concrete section of concrete viewName
$steps->Then('/^I should see "([^"]*)" "([^"]*)" edit$/', function($world, $viewName, $section)
{
$world->browser
->with('response')->checkElement('h1', $viewName)
->with('response')->checkElement('#menu-tabs li#menu-views-more-section-'.$section.' strong')
;
});
@waleedulhaque
Copy link

I want to developing a app.`{0 0 1 0}

true *error 0 0 0 0 1}}\

@manlux12
Copy link

manlux12 commented Nov 6, 2020

i wanna create a website

@Prince5123
Copy link

How do i create a website

@jeny262
Copy link

jeny262 commented Jul 29, 2021

How do i create a website

@Agarg89
Copy link

Agarg89 commented Aug 24, 2021

But not log in problem comes account login github

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment