-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MNT Additional behat tests #226
MNT Additional behat tests #226
Conversation
8a319c6
to
19e1c55
Compare
19e1c55
to
a8efcd1
Compare
tests/behat/src/FeatureContext.php
Outdated
/** | ||
* @Given /^I type "([^"]+)" in the field$/ | ||
*/ | ||
public function iTypeInField(string $data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function iTypeInField(string $data) | |
public function iTypeInTheField(string $data) |
Method name should match Given regex
This method should be put into behat-extension BasicContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Moved in behat-extension
. See
tests/behat/src/FeatureContext.php
Outdated
/** | ||
* @Given /^the active element is "([^"]+)"$/ | ||
*/ | ||
public function isCurrentActiveElement(string $selector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** | |
* @Given /^the active element is "([^"]+)"$/ | |
*/ | |
public function isCurrentActiveElement(string $selector) | |
/** | |
* @Given /^the active element should be "([^"]+)"$/ | |
*/ | |
public function theActiveElementShouldBe(string $selector) |
Updated both Given regex and the method name to be a little more standard
You'll need to update references in feature files too
This method should be put into behat-extension BasicContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Moved in behat-extension
. See
tests/behat/src/FeatureContext.php
Outdated
/** | ||
* @Given /^I focus on the "([^"]+)" element$/ | ||
*/ | ||
public function theHasALinkInLinkField(string $selector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function theHasALinkInLinkField(string $selector) | |
public function iFocusOnTheElement(string $selector) |
Method name should match Given regex
This method should be put into behat-extension BasicContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. Moved in behat-extension
. See
tests/behat/src/FeatureContext.php
Outdated
use PHPUnit\Framework\Assert; | ||
use SilverStripe\BehatExtension\Context\SilverStripeContext; | ||
|
||
class FeatureContext extends SilverStripeContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the methods in this class to behat-extension BasicContext and delete this file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
behat.yml
Outdated
@@ -10,13 +10,13 @@ default: | |||
paths: | |||
- '%paths.modules.linkfield%/tests/behat/features' | |||
contexts: | |||
- SilverStripe\Framework\Tests\Behaviour\FeatureContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just leave this in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
behat.yml
Outdated
- SilverStripe\Framework\Tests\Behaviour\CmsFormsContext | ||
- SilverStripe\Framework\Tests\Behaviour\CmsUiContext | ||
- SilverStripe\BehatExtension\Context\BasicContext | ||
- SilverStripe\BehatExtension\Context\LoginContext | ||
- SilverStripe\LinkField\Tests\Behat\FeatureContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- SilverStripe\LinkField\Tests\Behat\FeatureContext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
behat.yml
Outdated
- SilverStripe\Framework\Tests\Behaviour\CmsFormsContext | ||
- SilverStripe\Framework\Tests\Behaviour\CmsUiContext | ||
- SilverStripe\BehatExtension\Context\BasicContext | ||
- SilverStripe\BehatExtension\Context\LoginContext | ||
- SilverStripe\LinkField\Tests\Behat\FeatureContext | ||
- SilverStripe\BehatExtension\Context\FixtureContext: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the FixtureContext bit to have the exact same indentation as this - it's very weird and it's like that for some reason that I forget, though I do know it definately works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
Given I add an extension "SilverStripe\FrameworkTest\LinkField\Extensions\LinkPageExtension" to the "Page" class | ||
And I go to "/dev/build?flush" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given I add an extension "SilverStripe\FrameworkTest\LinkField\Extensions\LinkPageExtension" to the "Page" class | |
And I go to "/dev/build?flush" | |
Given I add an extension "SilverStripe\FrameworkTest\LinkField\Extensions\LinkPageExtension" to the "Page" class | |
And I go to "/dev/build?flush" |
Use the same indentation for all the statements within Background/Scenario - that's generally what's done in other feature files in the code base
The this for the entire file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
And I press the "Enter" key globally | ||
And I wait for 2 seconds | ||
|
||
# Test accessability of the LinkField drag and drop |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Test accessability of the LinkField drag and drop | |
# Test accessibility of the LinkField keyboard sorting |
Drag and drop is using the mouse :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
And I should see "Page on this site" in the ".modal-header" element | ||
And I wait for 2 seconds | ||
|
||
# Test accessability of the modal form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Test accessability of the modal form | |
# Test accessibility of the modal form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
a19bac6
to
7df6170
Compare
7df6170
to
b0f9b6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, will merge when silverstripe/silverstripe-behat-extension#263 is merged and tagged
Have merged and released behat-extenstion pr, re-running behat tests on this pr now |
Description
Additional Behat tests to test user interaction with LinField using the keyboard.
Tests check the ability to create links and sort using "drag and drop".
Manual testing steps
Not required
Issues
Pull request checklist