Skip to content

Commit

Permalink
ISSUE-337: test
Browse files Browse the repository at this point in the history
  • Loading branch information
tatevikg1 committed Dec 18, 2024
1 parent b7b5901 commit 2b45ef7
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 28 deletions.
4 changes: 2 additions & 2 deletions tests/features/bootstrap/BaseContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function spins($closure, $tries = 10)
}

/**
* @When something long is taking long but should output :text
* @When /^something long is taking long but should output :([^"]+)$/
*/
public function somethingLongShouldOutput($text)
{
Expand All @@ -68,7 +68,7 @@ public function somethingLongShouldOutput($text)
}

/**
* @Then do something on a button that might not be there yet
* @Then /^do something on a button that might not be there yet$/
*/
public function doSomethingNotThereYet()
{
Expand Down
20 changes: 10 additions & 10 deletions tests/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function throwExpectationException($message)
}

/**
* @When something long is taking long but should output :text
* @When /^something long is taking long but should output :([^"]+)$/
*/
public function somethingLongShouldOutput($text)
{
Expand All @@ -137,7 +137,7 @@ public function somethingLongShouldOutput($text)
}

/**
* @Then do something on a button that might not be there yet
* @Then /^do something on a button that might not be there yet$/
*/
public function doSomethingNotThereYet()
{
Expand Down Expand Up @@ -203,15 +203,15 @@ public function getToken()
}

/**
* @When I fill in :arg1 with a valid username
* @When /^I fill in :arg1 with a valid username$/
*/
public function iFillInWithAValidUsername($arg1)
{
$this->fillField($arg1, $this->params['admin_username']);
}

/**
* @When I fill in :arg1 with a valid password
* @When /^I fill in :arg1 with a valid password/
*/
public function iFillInWithAValidPassword($arg1)
{
Expand Down Expand Up @@ -258,7 +258,7 @@ public function iHaveNotYetCreatedCampaigns()
}

/**
* @Given /^I have subscriber with email "([^"]*)"/
* @Given /^I have subscriber with email "([^"]*)"$/
*/
public function iHaveSubscriber($email)
{
Expand Down Expand Up @@ -293,7 +293,7 @@ public function generateUrl($params)

/**
* @param $num
* @Then /^I wait for .* (second|seconds)/
* @Then /^I wait for .* (second|seconds)$/
*/
public function iWaitForSeconds($num)
{
Expand All @@ -310,16 +310,16 @@ public function iWaitForTheAjaxResponse()
}

/**
* @Given I go back
*/
* @Given /^I go back$/
*/
public function iGoBack()
{
$this->getSession()->getDriver()->back();
}

/**
* @When I confirm the popup
*/
* @When /^I confirm the popup$/
*/
public function iConfirmThePopup()
{
$this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
Expand Down
16 changes: 8 additions & 8 deletions tests/features/bootstrap/MailContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct($mail_dir)
* Empty mails directory before scenario
*
* @BeforeScenario @emptySentMail
* @Then I have empty mailbox
* @Then /^I have empty mailbox$/
*/
public function iHaveEmptyEmailBox()
{
Expand All @@ -40,7 +40,7 @@ public function iHaveEmptyEmailBox()
}

/**
* @Given /I should have email sent with the following:/
* @Given /^I should have email sent with the following:$/
*/
public function iHaveSentEmailWithTheFollowing(TableNode $node)
{
Expand Down Expand Up @@ -86,7 +86,7 @@ public function iHaveSentEmailWithTheFollowing(TableNode $node)


/**
* @Given /I should have email sent from address "(.*)"/
* @Given /^I should have email sent from address "(.*)"$/
* @throws Exception
*/
public function iHaveEmailSentFromAddress($from)
Expand All @@ -100,7 +100,7 @@ public function iHaveEmailSentFromAddress($from)
}

/**
* @Given /I should have email sent from "(.*)"/
* @Given /^I should have email sent from "(.*)"$/
*/
public function iHaveEmailSentFrom($senderName)
{
Expand All @@ -113,7 +113,7 @@ public function iHaveEmailSentFrom($senderName)
}

/**
* @Given /I should have email sent to address "(.*)"/
* @Given /^I should have email sent to address "(.*)"$/
*/
public function iHaveEmailSentToAddress($to)
{
Expand All @@ -126,7 +126,7 @@ public function iHaveEmailSentToAddress($to)
}

/**
* @Given /^I should have email sent to "(.*)"/
* @Given /^I should have email sent to "(.*)"$/
*/
public function iHaveEmailSentToName($toName)
{
Expand All @@ -139,7 +139,7 @@ public function iHaveEmailSentToName($toName)
}

/**
* @Given /I should have email sent contains "(.*)"/
* @Given /^I should have email sent contains "(.*)"$/
* @throws AssertSentEmailException
*/
public function iHaveEmailSentContains($expected)
Expand Down Expand Up @@ -225,4 +225,4 @@ private function getMailFiles()

class AssertSentEmailException extends \Exception
{
}
}
2 changes: 1 addition & 1 deletion tests/features/bootstrap/ScreenshotContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function takeScreenshotAfterFailedStep($event)
}

/**
* @Then take a screenshot
* @Then /^take a screenshot$/
*/
public function takeAScreenshot()
{
Expand Down
12 changes: 5 additions & 7 deletions tests/features/bootstrap/SubscriberContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ public function beforeScenario(BeforeScenarioScope $scope)

/**
* @param string $list
* @param array $table
*
* @Given /I have "(.*)" list with the following subscribers:/
* @param PyStringNode $stringNode
* @throws Exception
* @Given /^I have "(.*)" list with the following subscribers:$/
*/
public function iHaveSubscribersForList($list, PyStringNode $stringNode)
public function iHaveSubscribersForList(string $list, PyStringNode $stringNode)
{
$rows = $stringNode->getStrings();
$db = $this->featureContext->getMysqli();
Expand Down Expand Up @@ -137,9 +136,8 @@ public function iHaveList($name, $owner = null, $description=null)
}



/**
* @Given /I want to send campaign with title "(.*)"/
* @Given /^I want to send campaign with title "(.*)"$/
*/
public function iWantToSendCampaignWithTitle($title)
{
Expand Down Expand Up @@ -167,7 +165,7 @@ public function iWantToSendCampaignWithTitle($title)

/**
* @param $name
* @Given /^I check "(.*)" as target list/
* @Given /^I check "(.*)" as target list$/
*/
public function iCheckAsTargetList($name)
{
Expand Down

0 comments on commit 2b45ef7

Please sign in to comment.