-
Notifications
You must be signed in to change notification settings - Fork 57
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
EZP-28172 behat specs for content types #339
Conversation
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.
Looks nice! Couple of small things.
'plusButton' => '.ez-icon-create', | ||
'trashButton' => '.ez-icon-trash', | ||
'editButton' => 'tr:nth-child(%s) a[title=Edit]', | ||
'listHeader' => '.ez-table-header__headline', | ||
'tableHeader' => 'th', | ||
//'horizontalHeaders' => '.ez-table-header + .table,form thead th', |
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.
Please remove
@@ -81,15 +75,25 @@ public function clickListElement(string $name): void | |||
$this->context->getElementByText($name, $this->fields['listElementLink'])->click(); | |||
} | |||
|
|||
public function isElementOnList(string $name): bool | |||
public function isLinkedItemOnList(string $name): bool |
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 to be sure: it allows only to check whether an element which is a link is present? maybe isLinkElementOnList
? (At first I was wondering to what should this item be linked)
throw new ElementNotFoundException($this->context->getSession(), 'table header', $this->fields['listHeader']); | ||
} | ||
} | ||
|
||
public function verifyVisibility(): void | ||
{ | ||
$this->context->waitUntilElementIsVisible($this->fields['plusButton'], $this->defaultTimeout); |
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.
Why is it removed?
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.
Because this same structure is also in ContentTypePage, and there's no buttons, only tables with informations, so I leaved only list header checking.
|
||
public function selectFieldDefinition(string $fieldName) | ||
{ | ||
$this->context->findElement('#' . $this->fields['fieldTypesList'], $this->defaultTimeout)->selectOption($fieldName); |
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.
Maybe specify fieldTypesList
with the # already?
$this->context->findElement($this->fields['list']) | ||
); | ||
|
||
return $this->context->findElement(sprintf($this->fields['tableCell'], $rowPosition, '2'))->getText(); |
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.
You could use %d in format definition and pass 2 as a number
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.
🎉
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.
👍
Checklist:
$ composer fix-cs
)