mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
54854bacb1
Issuer is customizable in configuration so that a company can set its own name or website. If not provided, default value is 'authelia.com'. The username is used as label.
16 lines
632 B
TypeScript
16 lines
632 B
TypeScript
import Cucumber = require("cucumber");
|
|
import seleniumWebdriver = require("selenium-webdriver");
|
|
import Assert = require("assert");
|
|
|
|
Cucumber.defineSupportCode(function ({ Given, When, Then }) {
|
|
When("the otpauth url has label {stringInDoubleQuotes} and issuer \
|
|
{stringInDoubleQuotes}", function (label: string, issuer: string) {
|
|
return this.driver.findElement(seleniumWebdriver.By.id("qrcode"))
|
|
.getAttribute("title")
|
|
.then(function (title: string) {
|
|
const re = `^otpauth://totp/${label}\\?secret=[A-Z0-9]+&issuer=${issuer}$`;
|
|
Assert(new RegExp(re).test(title));
|
|
})
|
|
});
|
|
});
|