mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
redirecting on login after being logout from administration dashboard
This commit is contained in:
parent
4c09714660
commit
ccae299769
5 changed files with 40 additions and 2 deletions
|
|
@ -0,0 +1,14 @@
|
|||
@administrator_login
|
||||
Feature: Redirecting on login page
|
||||
In order to access on my admin dashboard
|
||||
As a logged out Administrator
|
||||
I need to be redirected on login page
|
||||
|
||||
Background:
|
||||
Given the store operates on a single channel in "United States"
|
||||
And I have been logged out from administration
|
||||
|
||||
@ui
|
||||
Scenario: Redirecting on login page after being logout
|
||||
When I try to open administration dashboard
|
||||
Then I should be on login page
|
||||
|
|
@ -71,4 +71,14 @@ final class AdminSecurityContext implements Context
|
|||
|
||||
$this->sharedStorage->set('administrator', $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given I have been logged out from administration
|
||||
*/
|
||||
public function iHaveBeenLoggedOutFromAdministration()
|
||||
{
|
||||
$this->securityService->logOut();
|
||||
|
||||
$this->sharedStorage->set('administrator', null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace Sylius\Behat\Context\Ui\Admin;
|
|||
|
||||
use Behat\Behat\Context\Context;
|
||||
use Sylius\Behat\Page\Admin\DashboardPageInterface;
|
||||
use Sylius\Behat\Page\UnexpectedPageException;
|
||||
use Sylius\Component\Core\Formatter\StringInflector;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
|
|
@ -29,11 +30,14 @@ final class DashboardContext implements Context
|
|||
}
|
||||
|
||||
/**
|
||||
* @When I open administration dashboard
|
||||
* @When I (try to )open administration dashboard
|
||||
*/
|
||||
public function iOpenAdministrationDashboard()
|
||||
{
|
||||
$this->dashboardPage->open();
|
||||
try {
|
||||
$this->dashboardPage->open();
|
||||
} catch (UnexpectedPageException $e) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -82,6 +82,14 @@ final class LoginContext implements Context
|
|||
Assert::false($this->dashboardPage->isOpen());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given I should be on login page
|
||||
*/
|
||||
public function iShouldBeOnLoginPage()
|
||||
{
|
||||
Assert::true($this->loginPage->isOpen());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should be notified about bad credentials
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,9 +10,11 @@ default:
|
|||
- sylius.behat.context.transform.user
|
||||
|
||||
- sylius.behat.context.setup.channel
|
||||
- sylius.behat.context.setup.admin_security
|
||||
- sylius.behat.context.setup.admin_user
|
||||
- sylius.behat.context.setup.user
|
||||
|
||||
- sylius.behat.context.ui.admin.dashboard
|
||||
- sylius.behat.context.ui.admin.login
|
||||
filters:
|
||||
tags: "@administrator_login && @ui"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue