mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
8cf58d7b31
Ensure Remote-User and Remote-Groups can be forwarded to the backend app.
20 lines
923 B
TypeScript
20 lines
923 B
TypeScript
import Cucumber = require("cucumber");
|
|
import seleniumWebdriver = require("selenium-webdriver");
|
|
import CustomWorld = require("../support/world");
|
|
import Util = require("util");
|
|
import BluebirdPromise = require("bluebird");
|
|
|
|
Cucumber.defineSupportCode(function ({ Given, When, Then }) {
|
|
Then("I see header {stringInDoubleQuotes} set to {stringInDoubleQuotes}",
|
|
{ timeout: 5000 },
|
|
function (expectedHeaderName: string, expectedValue: string) {
|
|
return this.driver.findElement(seleniumWebdriver.By.tagName("body")).getText()
|
|
.then(function (txt: string) {
|
|
const expectedLine = Util.format("\"%s\": \"%s\"", expectedHeaderName, expectedValue);
|
|
if (txt.indexOf(expectedLine) > 0)
|
|
return BluebirdPromise.resolve();
|
|
else
|
|
return BluebirdPromise.reject(new Error(Util.format("No such header or with unexpected value.")));
|
|
});
|
|
})
|
|
}); |