I am in the process of creating javadocs for all of my page objects and modules. When I generate the java docs, any links to Geb documentation do not work.
According to this stack overflow question: Javadocs link to external javadoc
one would need a local copy of the documentation in order to interface to 2 sets of documentation, but I am not sure where I go to download the Geb documentation in this fashion.
I figured out how to do this without downloading the documentation by configuring a groovy task like so and running it.
groovydoc{
docTitle = "My GroovyDoc"
windowTitle = "Page Objects GroovyDoc"
groovyClasspath = configurations.groovyDoc
destinationDir = new File(<My File Path>)
link("http://gebish.org/manual/current/api/", "geb")
}
Related
Background of the Question:
Earlier Issue:
I have already asked this question in the past with attached thread below but the use case was different in that case. I just needed a way to print the JSON into stdout using (NodeJS) cucumber-js. I used Native Cucumber parsing using cucumber CLI commands as per (https://github.com/cucumber/cucumber-js/blob/main/docs/formatters.md).
How to convert cucumber gherkin feature files into JSON or AST format?
Current Issue:
I want to Parse Gherkin Feature Files to JSON using Java. These JSON files would be later interpreted and rendered into a front end dashboard where we could filter feature files based on tags, scenarios and text match for features.
I came through React cucumber (https://github.com/cucumber/react-components) Library but this is more of a JS Based solution and I need to process the Parsed Feature file JSON before passing to the view layer.
Can someone please provide the code snippet for parsing Gherkin Feature file to JSON in Java. I went through below threads but all are using deprecated code.
Cucumber feature file - parsing to an object
How to parse Cucumber feature file in java or groovy?
and a few more.
Please provide an example code snippet if possible. Thanks in Advance :)
You can use io.cucumber.junit.Cucumber for reference. Briefly in your case you would do the following:
public class Main {
public static void main(String[] args){
RuntimeOptions runtimeOptions = new CucumberPropertiesParser()
.parse(CucumberProperties.fromSystemProperties())
.addDefaultFeaturePathIfAbsent()
.build();
SynchronizedEventBus bus = synchronize(new TimeServiceEventBus(Clock.systemUTC(), UUID::randomUUID));
FeatureParser parser = new FeatureParser(bus::generateId);
Supplier<ClassLoader> classLoader = ClassLoaders::getDefaultClassLoader;
FeaturePathFeatureSupplier featureSupplier = new FeaturePathFeatureSupplier(classLoader, runtimeOptions,
parser);
List<Feature> features = featureSupplier.get();
ObjectMapper objectMapper = new ObjectMapper();
System.out.println(objectMapper.writeWithDefaultPrettyPrinter().writeValueAsString(features));
}
}
Just like WS-Policies, Swagger , WSDLs, WADLs etc.Can APIs be added as a custom asset in the G-reg?
As far as I understand you need to introduce a new content type artifact(WSDL, WADL, Policy and Schemas are known as content type artifacts) to G-Reg. To upload such artifact programmatically you need to write some custom code which is called handlers and extensions,
Handlers
Please find this blog post which explains a basic handler for your requirement. Other than that please refer below sample media type handlers available in G-Reg(carbon-registry)
WSDLMediaTypeHandler.java
SwaggerMediaTypeHandler.java
WADLMediaTypeHandler.java
GC Eextensions
If you're introducing a content type artifact it is must write a publisher and store extensions to get it work in pub/store. However, users can upload such artifacts in admin/mgt console just by deploying the handler correctly.
Please find this question to get an idea of the extension creation.
I know the script to do this is:
local StarterGui = game:GetService('StarterGui')
StarterGui:SetCoreGuiEnabled (Enum.CoreGuiType.Chat, false)
and
local StarterGui = game:GetService("StarterGui")
StarterGui:SetCoreGuiEnabled(0,false)
but what kind of scripts do these go in and where do I put the scripts?
Use it in a LocalScript. The wiki page clearly states:
This item should be used with a LocalScript in order to work as expected in online mode.
Source: http://wiki.roblox.com/index.php?title=API:Class/StarterGui/SetCoreGuiEnabled
If you don't know where to put the scripts, you should go over the basics on the wiki: http://wiki.roblox.com/index.php?title=Intro_to_Scripting
(It doesn't really tell you where to put LocalScripts, but on the page of LocalScript it certainly clearly does)
I've started to use Galen framework to test the layout of my website pages and I also have my other test, written in Selenium, integrated into Jenkins.
I'm using Java+JUnit+Maven and I would like to know if anyone has managed to integrate the Galen reporting into Jenkins and how.
Because for the moment I am using something like:
assertThat(layoutReport.errors(), is(0));
which tells me if there were errors in the tests but not where.
Thanks!
P.S. If someone with reputation could make the tag galen-framework so that we can group these type of questions, it would be great :D
In your case you could use Galen for generating HTML reports as it normally does when you run tests with it. Though you will have to manage the creation of GalenTestInfo objects.
Here is how the HTML report generation works. Imagine you have somewhere obtainAllTests method defined which returns a list of all executed tests.
List<GalenTestInfo> tests = obtainAllTests();
new HtmlReportBuilder().build(tests, "target/galen-html-reports");
Somewhere in your code you could create a GalenTestInfo and add it to some collection:
GalenTestInfo testInfo = GalenTestInfo.fromString("Here goes the name of your test");
Once you have done the layout checking and obtained LayoutReport object you could add this report to the report of the test. Here is how you can do it:
LayoutReport layoutReport = Galen.checkLayout(driver,
specPath, includedTags, null,
new Properties(), null);
testInfo.getReport().layout(layoutReport, "A title for your layout check");
You can find more insights in this project https://github.com/galenframework/galen-sample-java-tests. It has a basic setup for Galen tests in Java + TestNG + Maven. The reports in it are collected in a singleton GalenReportsContainer. There is also a reporter implemented in GalenReportingListener which takes all those tests from GalenReportsContainer and generates HTML reports.
You can see a full example for Java (TestNG and JUnit) and JavaScript here:
https://github.com/hypery2k/galen_samples.
I use the HTML Plugin together with Jenkins, see example here
I want to query my CCNet server to find out the status of the builds. I've heard rumor that there's a (ReST?) API of sorts, but I can't seem to find any documentation for it.
Is there any documentation for it, or do I need to download the CCNet source code and start reading?
EDIT: I found the endpoint /XmlStatusReport.aspx, which gives an XML overview of all projects. The same filename in any folder gives exactly the same response, though, so I'm afraid that might be the only API there is.
As an alternative to the XML you already mentioned yourself, you could use remoting as the CCTray app does. If you reference ThoughtWorks.CruiseControl.Remote.dll form the CruiseControl.NET\server folder you can instantiate CruiseServerRemotingClient and use it to retrieve information from the server.
The following snippet prints out the list of projects on the server and their build statuses:
CruiseServerRemotingClient client = new CruiseServerRemotingClient("tcp://ccnetserver:21234/CruiseManager.rem");
ProjectStatus[] statusList = client.GetProjectStatus();
foreach (ProjectStatus status in statusList)
{
Console.WriteLine("{0}: {1}", status.Name, status.BuildStatus);
}
You could also retrieve the log for the latest build in XML format as follows:
string buildName = client.GetLatestBuildName("Jasenje");
Console.WriteLine(client.GetLog("Jasenje", buildName));
I haven't managed to find any real documentation for the API but at least there are XML comments with brief descriptions of methods and parameters.