-
Notifications
You must be signed in to change notification settings - Fork 47
[Behat] Add Behat test for issue EZP-25642 users 'Delete' button #553
base: master
Are you sure you want to change the base?
Changes from 6 commits
980df25
9eafc7f
d1591ab
b641dea
1fa996f
e79ba26
515e519
0538b73
98a533b
daaff8e
389f07a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,6 +313,32 @@ private function goToContentWithPath($path) | |
$this->clickOnTreePath($path); | ||
} | ||
|
||
/** | ||
* @Then I should see a :button action bar button | ||
* | ||
* @param string $buttonText Text of the element in the action bar | ||
*/ | ||
public function iShouldSeeActionBarButton($buttonText) | ||
{ | ||
$element = $this->getElementByText($buttonText, '.ez-actionbar-container .ez-action', '.action-label'); | ||
if (!$element) { | ||
throw new \Exception("Action bar button '$buttonText' not found"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File seems to be using
|
||
} | ||
} | ||
|
||
/** | ||
* @Then I should not see a :button action bar button | ||
* | ||
* @param string $buttonText Text of the element in the action bar | ||
*/ | ||
public function iShouldNotSeeActionBarButton($buttonText) | ||
{ | ||
$element = $this->getElementByText($buttonText, '.ez-actionbar-container .ez-action', '.action-label'); | ||
if ($element) { | ||
throw new \Exception("Action bar button '$buttonText' was found"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as above, except it should use a |
||
} | ||
} | ||
|
||
/** | ||
* @Then I am on the :name location view | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,17 @@ public function iCreateUser(TableNode $users = null) | |
} | ||
} | ||
|
||
/** | ||
* @When I go to (the) User :username page | ||
*/ | ||
public function goToUserPage($username) | ||
{ | ||
$this->iAmOnPage('Users'); | ||
$this->waitWhileLoading(); | ||
$this->clickOnTreePath("$username $username"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. actually, won't this work solely for users created in behat (same first/last name)? Correct/long approach would be to load the User's first/last name then use those values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a context problem, connected to what I have said above. We should/could store the created user's reference, so that we can easily navigate to it. It would avoid having to reference the same fake string, and we could use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But besides that, @joaoinacio is right.
If we end up with the scenario I gave as an example:
The first sentence would both create the user, and navigate to its page. It could do the navigation part by calling |
||
$this->sleep(); //safeguard for application delays | ||
} | ||
|
||
/** | ||
* @When I edit user :username | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,3 +67,10 @@ Feature: Use the eZ Users field | |
And I fill in "Password" with "12345" | ||
And I fill in "Confirm password" with "123456" | ||
Then I should see error messages | ||
|
||
@javascript @edge | ||
Scenario: Validate that users have the "Delete" button available | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The scenario describes something a bit different. What about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was really suggesting that the sentence was replaced. As I see it, the scenario covers the fact that "Send to trash" is replaced with "Delete". We can easily formulate that as one sentence. Or did you have something else in mind ? |
||
Given there is a User with name "One" | ||
When I go to User "One" page | ||
Then I should not see a "Send to thrash" action bar button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typo: thrash should be trash. |
||
And I should see a "Delete" action bar button | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could replace "and" with "but", I think it works too. And it sounds a bit better :-) |
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.
We should move this to an
ActionBarContext
.