Rename "Notification" to "Toast"

Since Nextcloud 17 the proper name for the old built-in notifications is
"Toast". Moreover, this will reduce ambiguity when using the
"notification" term to refer to elements in the Notifications app.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2019-11-20 17:09:52 +01:00
parent baf7092136
commit 0abff19aa9
2 changed files with 11 additions and 11 deletions

View File

@ -19,12 +19,12 @@ default:
- FilesAppContext
- FilesAppSharingContext
- LoginPageContext
- NotificationContext
- PublicShareContext
- SearchContext
- SettingsContext
- SettingsMenuContext
- ThemingAppContext
- ToastContext
- UsersSettingsContext
filters:
tags: "~@apache"
@ -48,12 +48,12 @@ default:
- FilesAppContext
- FilesAppSharingContext
- LoginPageContext
- NotificationContext
- PublicShareContext
- SearchContext
- SettingsContext
- SettingsMenuContext
- ThemingAppContext
- ToastContext
- UsersSettingsContext
filters:
tags: "@apache"

View File

@ -23,33 +23,33 @@
use Behat\Behat\Context\Context;
class NotificationContext implements Context, ActorAwareInterface {
class ToastContext implements Context, ActorAwareInterface {
use ActorAware;
/**
* @return Locator
*/
public static function notificationMessage($message) {
public static function toastMessage($message) {
return Locator::forThe()->xpath("//*[contains(concat(' ', normalize-space(@class), ' '), ' toastify ') and normalize-space(text()) = '$message']")->
descendantOf(self::notificationContainer())->
describedAs("$message notification");
descendantOf(self::toastContainer())->
describedAs("$message toast");
}
/**
* @return Locator
*/
private static function notificationContainer() {
private static function toastContainer() {
return Locator::forThe()->id("content")->
describedAs("Notification container");
describedAs("Toast container");
}
/**
* @Then I see that the :message notification is shown
* @Then I see that the :message toast is shown
*/
public function iSeeThatTheNotificationIsShown($message) {
public function iSeeThatTheToastIsShown($message) {
PHPUnit_Framework_Assert::assertTrue($this->actor->find(
self::notificationMessage($message), 10)->isVisible());
self::toastMessage($message), 10)->isVisible());
}
}