public function performOn($element, $actions, $timeout = 10)
    {
        $this->waitForElement($element, $timeout);
        $this->setBaseElement($element);
        $this->debugSection('InnerText', $this->getBaseElement()->getText());

        if (is_callable($actions)) {
            $actions($this);
            $this->setBaseElement();
            return;
        }
        if (is_array($actions)) {
            $actions = ActionSequence::build()->fromArray($actions);
        }

        if (!$actions instanceof ActionSequence) {
            throw new \InvalidArgumentException("2nd parameter, actions should be callback, ActionSequence or array");
        }

        $actions->run($this);
        $this->setBaseElement();
    }
public function performOn($element, $actions, $timeout = 10)
    {
        $this->waitForElement($element, $timeout);
        $this->setBaseElement($element);
        $this->debugSection('InnerText', $this->getBaseElement()->getText());

        if (is_callable($actions)) {
            $actions($this);
            $this->setBaseElement();
            return;
        }
        if (is_array($actions)) {
            $actions = ActionSequence::build()->fromArray($actions);
        }

        if (!$actions instanceof ActionSequence) {
            throw new \InvalidArgumentException("2nd parameter, actions should be callback, ActionSequence or array");
        }

        $actions->run($this);
        $this->setBaseElement();
    }
public function performOn ( $ element , $ actions , $ timeout = 10 ) { $ this -> waitForElement ( $ element , $ timeout ) ; $ this -> setBaseElement ( $ element ) ; $ this -> debugSection ( 'InnerText' , $ this -> getBaseElement ( ) -> getText ( ) ) ; if ( is_callable ( $ actions ) ) { $ actions ( $ this ) ; $ this -> setBaseElement ( ) ; return ; } if ( is_array ( $ actions ) ) { $ actions = ActionSequence :: build ( ) -> fromArray ( $ actions ) ; } if ( ! $ actions instanceof ActionSequence ) { throw new \ InvalidArgumentException ( "2nd parameter, actions should be callback, ActionSequence or array" ) ; } $ actions -> run ( $ this ) ; $ this -> setBaseElement ( ) ; }
Waits for element and runs a sequence of actions inside its context.
Actions can be defined with array, callback, or `Codeception\Util\ActionSequence` instance.

Actions as array are recommended for simple to combine "waitForElement" with assertions;
`waitForElement($el)` and `see('text', $el)` can be simplified to:

```php
<?php
$I->performOn($el, ['see' => 'text']);
```

List of actions can be pragmatically build using `Codeception\Util\ActionSequence`:

```php
<?php
$I->performOn('.model', ActionSequence::build()
->see('Warning')
->see('Are you sure you want to delete this?')
->click('Yes')
);
```

Actions executed from array or ActionSequence will print debug output for actions, and adds an action name to
exception on failure.

Whenever you need to define more actions a callback can be used. A WebDriver module is passed for argument:

```php
<?php
$I->performOn('.rememberMe', function (WebDriver $I) {
$I->see('Remember me next time');
$I->seeElement('#LoginForm_rememberMe');
$I->dontSee('Login');
});
```

In 3rd argument you can set number a seconds to wait for element to appear

@param $element
@param $actions
@param int $timeout
Waits for element and runs a sequence of actions inside its context . Actions can be defined with array callback or Codeception \ Util \ ActionSequence instance .