2017-09-03 06:25:43 +07:00
|
|
|
import Cucumber = require("cucumber");
|
|
|
|
import fs = require("fs");
|
|
|
|
import BluebirdPromise = require("bluebird");
|
|
|
|
import ChildProcess = require("child_process");
|
|
|
|
|
2017-09-09 04:18:20 +07:00
|
|
|
Cucumber.defineSupportCode(function({ setDefaultTimeout }) {
|
|
|
|
setDefaultTimeout(20 * 1000);
|
|
|
|
});
|
|
|
|
|
2017-09-03 06:25:43 +07:00
|
|
|
Cucumber.defineSupportCode(function({ After, Before }) {
|
|
|
|
const exec = BluebirdPromise.promisify(ChildProcess.exec);
|
|
|
|
|
|
|
|
After(function() {
|
|
|
|
return this.driver.quit();
|
|
|
|
});
|
|
|
|
|
|
|
|
Before({tags: "@needs-test-config", timeout: 15 * 1000}, function () {
|
2017-08-08 21:03:12 +07:00
|
|
|
return exec("./scripts/example-commit/dc-example.sh -f docker-compose.test.yml up -d authelia && sleep 2");
|
2017-09-03 06:25:43 +07:00
|
|
|
});
|
|
|
|
|
|
|
|
After({tags: "@needs-test-config", timeout: 15 * 1000}, function () {
|
2017-08-08 21:03:12 +07:00
|
|
|
return exec("./scripts/example-commit/dc-example.sh up -d authelia && sleep 2");
|
2017-09-03 06:25:43 +07:00
|
|
|
});
|
|
|
|
});
|