diff --git a/test/helpers/SeeNotification.ts b/test/helpers/SeeNotification.ts deleted file mode 100644 index 97865331..00000000 --- a/test/helpers/SeeNotification.ts +++ /dev/null @@ -1,9 +0,0 @@ -import SeleniumWebdriver, { WebDriver } from "selenium-webdriver"; -import Assert = require("assert"); - -export default async function(driver: WebDriver, message: string) { - await driver.wait(SeleniumWebdriver.until.elementLocated(SeleniumWebdriver.By.className("notification")), 5000) - const notificationEl = driver.findElement(SeleniumWebdriver.By.className("notification")); - const txt = await notificationEl.getText(); - Assert.equal(message, txt); -} \ No newline at end of file diff --git a/test/suites/minimal/scenarii/BadPassword.ts b/test/suites/minimal/scenarii/BadPassword.ts index 56165b5c..ddd4d51b 100644 --- a/test/suites/minimal/scenarii/BadPassword.ts +++ b/test/suites/minimal/scenarii/BadPassword.ts @@ -1,7 +1,7 @@ import FillLoginPageWithUserAndPasswordAndClick from '../../../helpers/FillLoginPageAndClick'; -import SeeNotification from '../../../helpers/SeeNotification'; import {AUTHENTICATION_FAILED} from '../../../../shared/UserMessages'; import VisitPageAndWaitUrlIs from '../../../helpers/behaviors/VisitPageAndWaitUrlIs'; +import VerifyNotificationDisplayed from '../../../helpers/assertions/VerifyNotificationDisplayed'; export default function() { /** @@ -17,7 +17,7 @@ export default function() { it('should get a notification message', async function () { this.timeout(10000); - await SeeNotification(this.driver, AUTHENTICATION_FAILED); + await VerifyNotificationDisplayed(this.driver, AUTHENTICATION_FAILED); }); }); } diff --git a/test/suites/minimal/scenarii/ResetPassword.ts b/test/suites/minimal/scenarii/ResetPassword.ts index 8d471aac..bc03484e 100644 --- a/test/suites/minimal/scenarii/ResetPassword.ts +++ b/test/suites/minimal/scenarii/ResetPassword.ts @@ -7,8 +7,8 @@ import FillField from "../../../helpers/FillField"; import {GetLinkFromEmail} from "../../../helpers/GetIdentityLink"; import FillLoginPageAndClick from "../../../helpers/FillLoginPageAndClick"; import IsSecondFactorStage from "../../../helpers/assertions/VerifyIsSecondFactorStage"; -import SeeNotification from '../../../helpers/SeeNotification'; import VisitPageAndWaitUrlIs from '../../../helpers/behaviors/VisitPageAndWaitUrlIs'; +import VerifyNotificationDisplayed from '../../../helpers/assertions/VerifyNotificationDisplayed'; export default function() { it("should reset password for john", async function() { @@ -57,6 +57,6 @@ export default function() { await FillField(this.driver, "password1", "newpass"); await FillField(this.driver, "password2", "badpass"); await ClickOn(this.driver, SeleniumWebDriver.By.id('reset-button')); - await SeeNotification(this.driver, "The passwords are different."); + await VerifyNotificationDisplayed(this.driver, "The passwords are different."); }); } diff --git a/test/suites/minimal/scenarii/TOTPValidation.ts b/test/suites/minimal/scenarii/TOTPValidation.ts index 60e508a9..fbd666ed 100644 --- a/test/suites/minimal/scenarii/TOTPValidation.ts +++ b/test/suites/minimal/scenarii/TOTPValidation.ts @@ -3,9 +3,9 @@ import WaitRedirected from '../../../helpers/WaitRedirected'; import ValidateTotp from '../../../helpers/ValidateTotp'; import VerifySecretObserved from "../../../helpers/assertions/VerifySecretObserved"; import LoginAndRegisterTotp from '../../../helpers/LoginAndRegisterTotp'; -import SeeNotification from '../../../helpers/SeeNotification'; import { AUTHENTICATION_TOTP_FAILED } from '../../../../shared/UserMessages'; import VisitPageAndWaitUrlIs from '../../../helpers/behaviors/VisitPageAndWaitUrlIs'; +import VerifyNotificationDisplayed from '../../../helpers/assertions/VerifyNotificationDisplayed'; export default function() { /** @@ -45,7 +45,7 @@ export default function() { }); it("get a notification message", async function() { - await SeeNotification(this.driver, AUTHENTICATION_TOTP_FAILED); + await VerifyNotificationDisplayed(this.driver, AUTHENTICATION_TOTP_FAILED); }); }); }