Skip to content

Commit

Permalink
API Remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Nov 28, 2022
1 parent aa27715 commit 76fb54f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,7 @@ It's based on the `vendor/bin/behat -di @cms` output.
Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should not be checked$/
- Checks, that checkbox with specified in|name|label|value is unchecked.

Given /^(?:|I )attach the file "(?P[^"]*)" to "(?P<field>(?:[^"]|\\")*)" with HTML5$/

When /^I fill in the "(?P<field>([^"]*))" HTML field with "(?P<value>([^"]*))"$/
When /^I fill in the "(?P<field>([^"]*))" HTML field with "(?P<value>([^"]*))"$/

When /^I fill in "(?P<value>([^"]*))" for the "(?P<field>([^"]*))" HTML field$/

Expand Down
26 changes: 0 additions & 26 deletions src/Context/BasicContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace SilverStripe\BehatExtension\Context;

use SilverStripe\Dev\Deprecation;
use Exception;
use InvalidArgumentException;
use Behat\Behat\Context\Context;
Expand Down Expand Up @@ -619,31 +618,6 @@ protected function getWebDriverSession()
return $driver->getWebDriver();
}

/**
* @Given /^(?:|I )attach the file "(?P<path>[^"]*)" to "(?P<field>(?:[^"]|\\")*)" with HTML5$/
* @param string $field
* @param string $path
* @return Call\Given
*
* @deprecated 4.5.0 Use iAttachTheFileToTheField() instead
*/
public function iAttachTheFileTo($field, $path)
{
Deprecation::notice('4.5.0', 'Use iAttachTheFileToTheField() instead');
// Remove wrapped button styling to make input field accessible to Selenium
$js = <<<JS
let input = jQuery('[name="$field"]');
if(input.closest('.ss-uploadfield-item-info').length) {
while(!input.parent().is('.ss-uploadfield-item-info')) input = input.unwrap();
}
JS;

$this->getSession()->executeScript($js);
$this->getSession()->wait(1000);

return $this->getMainContext()->attachFileToField($field, $path);
}

/**
* Select an individual input from within a group, matched by the top-most label.
*
Expand Down

0 comments on commit 76fb54f

Please sign in to comment.