Open deepakkp opened 4 years ago
I can share examples on Java what we implemented for our project. Galen test run is based on Selenium (Junit)
public static void generatePageDump(WebDriver driver, String pageName, String specPath) {
try {
new GalenPageDump(pageName).dumpPage(driver, SPEC_COMMON_PATH + specPath,
DUMP_PATH);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void generateSpecByPageDump(String specPath) {
SpecGenerator generator = new SpecGenerator();
SpecGeneratorOptions specGeneratorOptions = new SpecGeneratorOptions();
specGeneratorOptions.setUseGalenExtras(true);
try (InputStream inputStream =
new FileInputStream(DUMP_PATH + "/page.json");
OutputStream outputStream =
new FileOutputStream(SPEC_COMMON_PATH + specPath, true)) {
PageSpecGenerationResult pageSpecGenerationResult = generator.generate(inputStream, specGeneratorOptions);
String spec = generator.generatePageSpec(pageSpecGenerationResult, specGeneratorOptions);
outputStream.write(spec.getBytes());
} catch (IOException e) {
e.printStackTrace();
}
}
Hi team, please let us know how to generate spec files. we want to include commands in batch file and generate it or any particular spec generator method. please share the proper steps. i have tried below steps.but no luck.
http://galenframework.com/docs/reference-working-in-command-line/#SpecGenerator