2017-07-27 04:45:26 +07:00
|
|
|
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 that = this;
|
2017-09-24 19:49:03 +07:00
|
|
|
return this.retrieveLatestMail()
|
|
|
|
.then(function (link: string) {
|
|
|
|
return that.driver.get(link);
|
|
|
|
});
|
2017-07-27 04:45:26 +07:00
|
|
|
});
|
|
|
|
});
|