Fixing tests for Notifications component (#3758)

This commit is contained in:
Marouan Bentaleb
2018-09-10 09:55:46 +01:00
committed by Eugenio Romano
parent 7fd3ffcf3f
commit 49a3749167
2 changed files with 13 additions and 5 deletions

View File

@@ -16,14 +16,11 @@
*/ */
import LoginPage = require('../pages/adf/loginPage'); import LoginPage = require('../pages/adf/loginPage');
import AcsUserModel = require('../models/ACS/acsUserModel'); import AcsUserModel = require('../models/ACS/acsUserModel');
import TestConfig = require('../test.config'); import TestConfig = require('../test.config');
import AlfrescoApi = require('alfresco-js-api-node'); import AlfrescoApi = require('alfresco-js-api-node');
import NotificationPage = require('../pages/adf/notificationPage'); import NotificationPage = require('../pages/adf/notificationPage');
import { browser } from 'protractor';
describe('Notifications Component', () => { describe('Notifications Component', () => {
@@ -45,6 +42,10 @@ describe('Notifications Component', () => {
await this.alfrescoJsApi.login(acsUser.id, acsUser.password); await this.alfrescoJsApi.login(acsUser.id, acsUser.password);
done();
});
beforeEach(async(done) => {
loginPage.loginToContentServicesUsingUserModel(acsUser); loginPage.loginToContentServicesUsingUserModel(acsUser);
notificationPage.goToNotificationsPage(); notificationPage.goToNotificationsPage();
@@ -59,7 +60,7 @@ describe('Notifications Component', () => {
}); });
it('[C279979] Should not show notification when the message is empty and button is clicked', () => { it('[C279979] Should not show notification when the message is empty and button is clicked', () => {
notificationPage.enterMessageField(''); notificationPage.clearMessage();
notificationPage.clickDefaultNotificationButton(); notificationPage.clickDefaultNotificationButton();
notificationPage.checkNotificationSnackBarIsNotDisplayed(); notificationPage.checkNotificationSnackBarIsNotDisplayed();
}); });

View File

@@ -123,6 +123,13 @@ var NotificationPage = function () {
this.clickActionButton = function () { this.clickActionButton = function () {
actionButton.click(); actionButton.click();
}; };
this.clearMessage = function () {
Util.waitUntilElementIsVisible(messageField);
messageField.clear();
messageField.sendKeys('a');
messageField.sendKeys(protractor.Key.BACK_SPACE);
}
}; };
module.exports = NotificationPage; module.exports = NotificationPage;