mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MNT Add new behat function to allow deleting gridfield rows
This commit is contained in:
parent
3d64eac129
commit
2cafba2bd5
@ -12,6 +12,7 @@ use SilverStripe\BehatExtension\Context\MainContextAwareTrait;
|
||||
use SilverStripe\BehatExtension\Utility\StepHelper;
|
||||
use Symfony\Component\DomCrawler\Crawler;
|
||||
use Behat\Mink\Element\NodeElement;
|
||||
use Facebook\WebDriver\WebDriverExpectedCondition;
|
||||
use SilverStripe\SiteConfig\SiteConfig;
|
||||
|
||||
/**
|
||||
@ -445,6 +446,23 @@ JS;
|
||||
$button->click();
|
||||
}
|
||||
|
||||
/**
|
||||
* @When /^I click the "([^"]*)" button in the "([^"]*)" gridfield for the "([^"]*)" row, confirming the dialog$/
|
||||
* @param string $buttonLabel
|
||||
* @param string $gridFieldName
|
||||
* @param string $rowName
|
||||
*/
|
||||
public function stepIClickTheGridFieldButtonForRowConfirmingDialog($buttonLabel, $gridFieldName, $rowName)
|
||||
{
|
||||
$this->stepIClickTheGridFieldButtonForRow($buttonLabel, $gridFieldName, $rowName);
|
||||
$session = $this->getSession()->getDriver()->getWebDriver();
|
||||
$session->wait()->until(
|
||||
WebDriverExpectedCondition::alertIsPresent(),
|
||||
"Alert is expected"
|
||||
);
|
||||
$session->switchTo()->alert()->accept();
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds a button in the gridfield row
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user