Offline - GraphWalker/graphwalker-project GitHub Wiki
Offline means generating a test sequence once that can later be run automatically. Or just generating a sequence to prove that the model, with the path generator(s) together with the stop condition(s), works.
The syntax is:
java -jar graphwalker-cli-4.3.1.jar GLOBAL_OPTIONS offline OPTIONS -m <model-file> "GENERATOR(STOP_CONDITION)"Please note that the "GENERATOR(STOP_CONDITION)" should be enclosed within double-quotes.
Options
-
--model,-mThe model, as a graphml file, followed by generator with stop condition.
This option can occur multiple times. -
--unvisited,-uWill print the remaining unvisited elements in the model.
Default is false. -
--verbose,-oWill print more details
Default is false. -
--blocked,-bThis option enables or disables the BLOCKED feature. When
-b trueGraphWalker will filter out elements in models with the keyword BLOCKED. When-b falseGraphWalker will not filter out any elements in models with the keyword BLOCKED.
Default is true. -
--seed,-sThis option seeds the random generator with the provide number. Using a seeded number, will generate the same path every time it's run.
Example:
java -jar graphwalker-cli-4.3.1.jar offline -m model.graphml "random(edge_coverage(100))"The above should be read: Use the model model.graphml, generate a path using the random path generator, stop when the edge coverage is 100%.
Example:
Using an offline sequence in a test, where the model is from the home page.
java -jar graphwalker-cli-4.3.1.jar offline -m Login.graphml "a_star(reached_vertex(v_Browse))"
{"currentElementName":"e_Init"}
{"currentElementName":"v_ClientNotRunning"}
{"currentElementName":"e_StartClient"}
{"currentElementName":"v_LoginPrompted"}
{"currentElementName":"e_ValidPremiumCredentials"}
{"currentElementName":"v_Browse"}To get the element names only, run:
The jq program is from here: https://stedolan.github.io/jq/
java -jar graphwalker-cli-4.3.1.jar offline -m Login.graphml "a_star(reached_vertex(v_Browse))" | jq -r '.currentElementName'
e_Init
v_ClientNotRunning
e_StartClient
v_LoginPrompted
e_ValidPremiumCredentials
v_BrowseIf your test was written in java, you could put the sequence in a unit test:
@Test
public void Login_Smoke_Test() {
e_Init();
v_ClientNotRunning();
e_StartClient();
v_LoginPrompted();
e_ValidPremiumCredentials();
v_Browse();
}Example:
Seeding a test with a number.
java -jar graphwalker-cli-4.3.1.jar offline --seed 147945811993279 --model model.json "random(edge_coverage(100))"