Skip to content

Commit 18092dd

Browse files
committed
API Deprecate BasicContext::theActiveElementShouldBe()
1 parent acc744c commit 18092dd

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/Context/BasicContext.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
use SilverStripe\BehatExtension\Utility\StepHelper;
3030
use SilverStripe\BehatExtension\Utility\DebugTools;
3131
use SilverStripe\MinkFacebookWebDriver\FacebookWebDriver;
32+
use Facebook\WebDriver\Remote\RemoteWebElement;
33+
use SilverStripe\Dev\Deprecation;
34+
35+
use function PHPUnit\Framework\assertSame;
3236

3337
/**
3438
* BasicContext
@@ -1711,9 +1715,12 @@ public function iTypeInTheField(string $data)
17111715
* @Given /^the active element should be "([^"]+)"$/
17121716
*
17131717
* Example: And the active element should be "selector"
1718+
*
1719+
* @depreacted 6.1.0 Use theFieldShouldHaveFocus() instead which is more reliable
17141720
*/
17151721
public function theActiveElementShouldBe(string $selector)
17161722
{
1723+
Deprecation::notice('6.1.0', 'Use theFieldShouldHaveFocus() instead which is more reliable');
17171724
$driver = $this->getSession()->getDriver()->getWebDriver();
17181725
$element = $driver->findElement(WebDriverBy::cssSelector($selector));
17191726
Assert::assertNotNull($element, sprintf('Element %s not found', $selector));

0 commit comments

Comments
 (0)