diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-19 17:08:00 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-11-20 12:18:15 +0100 |
commit | 31e31a6f007957e4769ad2eaa7c9e3ea03ee1503 (patch) | |
tree | 558d7a13c3efd6e5313c33f6bb5d20faea1f3dc0 | |
parent | 9fc7e916f8e5181ea7a1bf7dbe35fdf2440019c9 (diff) |
Adjust acceptance tests to the virtual list for the message list
As the virtual list removes its child elements that are no longer
visible the index of the messages in the acceptance test is no longer an
absolute index for the whole list, but an index only for the currently
visible messages. However, as all the messages sent in each test fit in
the available space no message is hidden and the previous indexes are
still valid.
The only change needed is in the locator for chat messages; as they are
declared as direct children of their parent now they must be set as
descendants of the wrapper instead of as descendants of the message list
itself.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | tests/acceptance/features/bootstrap/ChatContext.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/acceptance/features/bootstrap/ChatContext.php b/tests/acceptance/features/bootstrap/ChatContext.php index cd599c4f7..c269cba18 100644 --- a/tests/acceptance/features/bootstrap/ChatContext.php +++ b/tests/acceptance/features/bootstrap/ChatContext.php @@ -99,9 +99,18 @@ class ChatContext implements Context, ActorAwareInterface { /** * @return Locator */ + public static function chatMessagesWrapper($chatAncestor) { + return Locator::forThe()->css(".wrapper")-> + descendantOf(self::chatMessagesList($chatAncestor))-> + describedAs("Wrapper for visible messages in the list of received chat messages"); + } + + /** + * @return Locator + */ public static function chatMessage($chatAncestor, $number) { return Locator::forThe()->xpath("li[not(contains(concat(' ', normalize-space(@class), ' '), ' systemMessage '))][$number]")-> - descendantOf(self::chatMessagesList($chatAncestor))-> + descendantOf(self::chatMessagesWrapper($chatAncestor))-> describedAs("Chat message $number in the list of received messages"); } @@ -110,7 +119,7 @@ class ChatContext implements Context, ActorAwareInterface { */ public static function groupedChatMessage($chatAncestor, $number) { return Locator::forThe()->xpath("li[not(contains(concat(' ', normalize-space(@class), ' '), ' systemMessage '))][position() = $number and contains(concat(' ', normalize-space(@class), ' '), ' grouped ')]")-> - descendantOf(self::chatMessagesList($chatAncestor))-> + descendantOf(self::chatMessagesWrapper($chatAncestor))-> describedAs("Grouped chat message $number in the list of received messages"); } |