mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
20 lines
705 B
TypeScript
20 lines
705 B
TypeScript
import Cucumber = require("cucumber");
|
|
import seleniumWebdriver = require("selenium-webdriver");
|
|
import Assert = require("assert");
|
|
import Fs = require("fs");
|
|
|
|
Cucumber.defineSupportCode(function ({ Given, When, Then }) {
|
|
When("I click on the link {stringInDoubleQuotes}", function (text: string) {
|
|
return this.driver.findElement(seleniumWebdriver.By.linkText(text)).click();
|
|
});
|
|
|
|
When("I click on the link of the email", function () {
|
|
const notif = Fs.readFileSync("./notifications/notification.txt").toString();
|
|
const regexp = new RegExp(/Link: (.+)/);
|
|
const match = regexp.exec(notif);
|
|
const link = match[1];
|
|
const that = this;
|
|
|
|
return this.driver.get(link);
|
|
});
|
|
}); |