Skip to content
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

Merged
merged 5 commits into from
Feb 9, 2018
Merged

EZP-28172 behat specs for content types #339

merged 5 commits into from
Feb 9, 2018

Conversation

m-tyrala
Copy link
Contributor

@m-tyrala m-tyrala commented Feb 7, 2018

Question Answer
Tickets
Bug fix? no
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

@m-tyrala m-tyrala changed the base branch from 1.0 to master February 7, 2018 14:57
@m-tyrala m-tyrala changed the base branch from master to 1.0 February 7, 2018 14:57
@m-tyrala m-tyrala changed the title [WIP] EZP-28172 content types EZP-28172 content types Feb 7, 2018
@andrerom andrerom changed the title EZP-28172 content types EZP-28172 behat specs for content types Feb 8, 2018
Copy link
Member

@mnocon mnocon left a 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',
Copy link
Member

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
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it removed?

Copy link
Contributor Author

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);
Copy link
Member

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();
Copy link
Member

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

Copy link
Member

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Member

@micszo micszo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lserwatka lserwatka merged commit bf02192 into ezsystems:1.0 Feb 9, 2018
@m-tyrala m-tyrala deleted the ezp-28172-content-types branch October 16, 2018 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants