Skip to content

Commit

Permalink
remove redundant test scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Apr 15, 2024
1 parent 93fcfbe commit bc493f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
49 changes: 0 additions & 49 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,62 +144,13 @@ public function iGoToTheSp1LoginPage()
$this->visit(self::SP1_LOGIN_PAGE);
}

/**
* @When I log in as a user who's password is NOT about to expire
*/
public function iLogInAsAUserWhosPasswordIsNotAboutToExpire()
{
$this->logInAs('distant_future', 'a');
}

/**
* @Then I should see a page indicating that I successfully logged in
*/
public function iShouldSeeAPageIndicatingThatISuccessfullyLoggedIn()
{
$this->assertResponseStatus(200);
$this->assertPageBodyContainsText('Your attributes');
}

protected function assertPageBodyContainsText(string $expectedText)
{
$page = $this->session->getPage();
$body = $page->find('css', 'body');
Assert::contains($body->getText(), $expectedText);
}

/**
* @When I log in as a user whose password is about to expire
*/
public function iLogInAsAUserWhosPasswordIsAboutToExpire()
{
$this->logInAs('near_future', 'b');
}

/**
* @Then I should see a page warning me that my password is about to expire
*/
public function iShouldSeeAPageWarningMeThatMyPasswordIsAboutToExpire()
{
$this->assertPageBodyContainsText('Password expiring soon');
}

/**
* @When I log in as a user whose password has expired
*/
public function iLogInAsAUserWhosPasswordHasExpired()
{
$this->logInAs('already_past', 'c');
}

/**
* @Then I should see a page telling me that my password has expired
*/
public function iShouldSeeAPageTellingMeThatMyPasswordHasExpired()
{
$this->assertPageBodyContainsText('Your password has expired');
}

private static function ensureFolderExistsForTestFile($filePath)
{
$folder = dirname($filePath);
Expand Down
12 changes: 0 additions & 12 deletions features/expirychecker.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,6 @@ Feature: Expiry Checker module
Background:
Given I go to the SP1 login page
And I click on the "IDP 1" tile

Scenario: Password is not about to expire
When I log in as a user who's password is NOT about to expire
Then I should see a page indicating that I successfully logged in

Scenario: Password is about to expire
When I log in as a user whose password is about to expire
Then I should see a page warning me that my password is about to expire

Scenario: Password has expired
When I log in as a user whose password has expired
Then I should see a page telling me that my password has expired

Scenario: Password will expire in the distant future
Given I provide credentials that will expire in the distant future
Expand Down

0 comments on commit bc493f0

Please sign in to comment.