Fixed action sequence to include multiple actions #4066

Merged
merged 2 commits into from Mar 21, 2017

Conversation

Projects
None yet
2 participants
@DavertMik
Member

DavertMik commented Mar 20, 2017

Fixes #4044

@DavertMik DavertMik added the WebDriver label Mar 20, 2017

src/Codeception/Util/ActionSequence.php
@@ -54,7 +56,9 @@ public static function build()
public function __call($action, $arguments)
{
- $this->actions[$action] = $arguments;
+ $key = "{$this->counter}.$action";

This comment has been minimized.

@Naktibalda

Naktibalda Mar 20, 2017

Member

Storing multiple pieces of information in a string is ugly, I think that it would be much more elegant to create Action object here.

@Naktibalda

Naktibalda Mar 20, 2017

Member

Storing multiple pieces of information in a string is ugly, I think that it would be much more elegant to create Action object here.

This comment has been minimized.

@DavertMik

DavertMik Mar 20, 2017

Member

yes, I agree not a perfect solution. Ok, I think I can rework it.

For output this action sequence should be transformed to a list of actions. So I was thinking to make it as visible array. Right now I think the ActionSequence can provide __toString and won't be translated to array.

@DavertMik

DavertMik Mar 20, 2017

Member

yes, I agree not a perfect solution. Ok, I think I can rework it.

For output this action sequence should be transformed to a list of actions. So I was thinking to make it as visible array. Right now I think the ActionSequence can provide __toString and won't be translated to array.

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Mar 21, 2017

Member

Improved, a code is a bit cleared; action sequence now executes actions on the context of given object.
I.e. it can clearly be used inside other modules. Current output look like this:

 I am on page "/form/example1"
  [GET] http://localhost:8000/form/example1
 I perform on ".rememberMe","see: 'Remember me', see: 'next time', dontSee: 'Login'"
  [InnerText] Remember me next time
  - see "Remember me"
  - see "next time"
  - don't see "Login"
 PASSED 
Member

DavertMik commented Mar 21, 2017

Improved, a code is a bit cleared; action sequence now executes actions on the context of given object.
I.e. it can clearly be used inside other modules. Current output look like this:

 I am on page "/form/example1"
  [GET] http://localhost:8000/form/example1
 I perform on ".rememberMe","see: 'Remember me', see: 'next time', dontSee: 'Login'"
  [InnerText] Remember me next time
  - see "Remember me"
  - see "next time"
  - don't see "Login"
 PASSED 
@Naktibalda

Thanks, the code looks much better now.

@DavertMik DavertMik merged commit 59257fc into 2.2 Mar 21, 2017

6 checks passed

continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
wercker/build Wercker pipeline passed
Details

@DavertMik DavertMik deleted the perform-on-fix branch Mar 21, 2017

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

Fixed action sequence to include multiple actions (#4066)
* Fixed action sequence to include multiple actions of same name. Fixes #4044

* action sequence to convert array to actions and execute them inside a context of an element
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment