mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
Replace SeeNotification by VerifyNotificationDisplayed assertion.
This commit is contained in:
parent
c487ed0a37
commit
036d1a4f51
|
@ -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);
|
||||
}
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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.");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user