I am using doxygen for my personal project and desire to use any type of UML language on page created by myself (markdown page). I do not mean to use it in code (it does work), but on a document created by myself, refer to example underneath:
# Example
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
```plantuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
```
```mermaid
sequenceDiagram
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob:Another authentication Response
Bob --> Alice: Another authentication Response
```
#startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
#enduml
\startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response
Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
\enduml
And here is the output:
While this text works (mermaid) for typora and plantuml generates together with mermaid on gitlab.
doxygen -x Doxyfile output:
# Difference with default Doxyfile 1.8.17 (9b14bf58c30a02ef19abebec280568532dc58ed4)
PROJECT_NAME = Name
PROJECT_NUMBER = 0.0.1
PROJECT_BRIEF = "Brief"
OUTPUT_DIRECTORY = out
INLINE_INHERITED_MEMB = YES
INPUT = ./files \
../src/
RECURSIVE = YES
PLANTUML_JAR_PATH = /home/<SURNAME>/Installations/plantuml.jar
Question is:
How to use uml diagrams in custom markdown file in doxygen.
It is probably too late for you but doxygen added now the function to integrate plantuml in markdown with version 1.9.4.
There you can see the examples of how you can include plantuml in your markdown file:
https://github.com/doxygen/doxygen/pull/9198
Now it's possible to use backticks like this:
```plantuml
Your Diagram
```
Related
Basically I want to achieve this:
1.user: I want apple.
bot: You want apple right?
2.user: I also want banana.
bot: You want apple and banana right?
Here apple and banana are all parameters of the same fruit entity. In my webook backend I want to receive [apple, banana] when the user entered 2nd sentence, so the bot needs to remember all the fruit (parameters) users gave during the conversation.
I was playing around with dialogflow context. I know it could pass parameters between different intents. But at here I'm using the same intent buyFruit, so the output context only has the new fruit parameters user entered in a new sentence:
1.user: I want apple. -> outputContext.parameters = [apple]
2.user: I also want banana. -> outputContext.parameters = [banana]
I couldn't find a way to get the fruit parameters user said in previous sentences. In another word, I want outputContext.parameters = [apple, banana] in the second webhook request. Does anyone know how to achieve this?
You edited the question and did not respond to my answer. I feel you may not really know what question you are asking.
Use context, create your own, store the data in your python application. Its pretty simple.
Please, respectfully take the time to either comment on the direct result, further ask a more concise question or mark as answered.
I found the solution to this. I will assume you understand how to use fulfillment, and adding webhooks. If not, feel free to visit here or shoot a question.
For this, there are 3 necessary parts. Dialogflow, your fulfillment code ( I used flask and python), and communication between the two. Enable Webhook, fill in the appropriate local machine url (for this I used NGROK).
I created a cart and a function for creating and maintaining said cart. Below is the code:
from flask import Flask, request
app = Flask(__name__)
##Create the cart
cart = []
#create a route for the webhook
#app.route('/webhook', methods=['GET', 'POST'])
def webhook():
req = request.get_json(silent=True, force=True)
fulfillmentText = ''
query_result = req.get('queryResult')
if query_result.get('action') == 'order.wings':
food_data = query_result['parameters']
##create temp dictionary so we always extract correct order data
temp_dictionary = []
for item in food_data:
temp_dictionary.append(item)
##add items to cart
new_item = []
for item in temp_dictionary:
new_item.append(food_data[item])
cart.append(new_item)
print(cart)
fulfillmentText = "Added Wings to Cart"
return {
"fulfillmentText": fulfillmentText,
"source": "webhookdata"
}
#run the app
if __name__ == '__main__':
app.run()
My question is much more conceptual than ever. I'd like to describe a good scenario using the Cucumber feature file where I have to have for each row of my Data table a new access token from the Identity Provider.
I.e
Scenario:
Given <Code Authorization>
And <Access Token>
And The client has the following information
| email | FirstName | Phone |
| xpto# | Richard | 343242|
When the client via Post /xpto
Then The API response a Json file
| code | response |
| 200 | xpto |
I'll use a Data Table for this kind of approach. However, I cannot give a static Access Token because it will expire. I should get a new one every time when my test run but It is not my test it self. The Token is just a Data that I have to have to test my scenario.
Is it ok call a REST in an Given Step? If I do this I am mixing up the objective of my scenarios.
Any thougts are welcome not for your mind but by the book. :-)
Kind Regards,
It seems that you need the token in order to set up the scenario. In that case it is fine to have that in a Given step. You can perform REST or other calls in step definitions for that Given step. For ex: It may look something like below. You can change wordings as you like but try to word it in a manner that shows initial state of the application.
Given I have a token for this scenario
And The client has the following information
| email | FirstName | Phone |
|xpto# | Richard | 343242|
...
...
Given steps are meant to establish a given state. It is considered best practice in BDD. You can find this information in official BDD docs here
Also , if you want to read more about the purpose and structure of Given , When and Then , be sure to have a look here
I am working with Cucumber and Groovy in Katalon Studio. I have the cucumber feature file where it has Multiple Scenario Outlines as mentioned below.
When I run the cucumber feature file, it should run the TestCase1 of first section in the scenario outline along with the steps and TestCase1 of second section in scenario outline.
But, it is running the first section of feature file TestCase1 and TestCase2 first. That means it is just loggining with given credentials and closing the browser.
For reference, below mentioned the step definition code also.
Cucumber Feature File:
#Login1
Feature: Title of your feature
I want to use this template for my feature file
#Login1 `**SECTION ONE**`
Scenario Outline: Login into GMP Application
Given running indicator flag
And User is on GMP Application Login Screen
When User enters the in the Login
And User enters the in the password
And User clicks on the ok button
Then User logged in successful at Home Screen
Examples:
| atid | pwd1 | runind | -> Header
| nm1013 | test01g | Y | -> TestCase1
| nm0313 | test02g | Y | -> TestCase2
#Login1 `**SECTION TWO**`
Scenario Outline: Click on the Create Inquiry Menu Item
Given User is on GMP Home Screen
When user click on the Inquiry menu item
And select the billing mode should be
And user click create inquiry item from the heading
Then it should displays create inquiry pagef
Examples:
| contract | -> Header
| GS00T07NSD0007 | -> TestCase1
| GS00T07NSD0007 | -> TestCase2
Step Definition
#Given(“running indicator flag (.*)”)
def run_indicator_flag(String ind1) {
println "Passing Indicator " + ind1
}
#And(“User is on GMP Application Login Screen”)
def user_on_GMP_Application_Login_Screen() {
boolean store2a
WebUI.openBrowser(’’)
WebUI.navigateToUrl(‘https://URL’, FailureHandling.STOP_ON_FAILURE)
}
#When(“User enters the (.*) in the Login”)
def user_enter_userid_in_the_Login(String uid) {
WebUI.setText(findTestObject(‘Object Repository/ORTC01/Page_/input_userid’),
uid, FailureHandling.STOP_ON_FAILURE)
}
#And(“User enters the (.*) in the password”)
def User_enters_the_in_the_password(String pwd5) {
WebUI.setText(findTestObject(‘Object
Repository/ORTC01/Page_/input_password’), pwd5,
FailureHandling.STOP_ON_FAILURE)
}
First of all you cannot connect scenarios in Cucumber. Each scenario is a separate test that starts from nothing, does something and then resets back to nothing.
Secondly a scenario outline is just a way to write several scenarios in a more compact form. Each set of examples in an outline causes a single scenario to be created and run. I would strongly recommend you avoid using Scenario Outlines
Good scenarios describe WHAT is being done without getting into HOW things are done. Your scenarios are full of HOW things are done which makes them complex and very difficult to work with. You should push all the HOW down into your step definitions (or better still helper methods called by your step definitions.
If you do these things you will be able to write scenarios that will look something like
Scenario: Create a billing enquiry
Given I have a bill
And I am logged in
When I enquire about my bill
Then ...
Note: How the above scenario is much shorter and has no detail about HOW you do anything.
Scenario Outline: verify handling "#" in code
Given user logs in to url "<url>"
When User enters Username "<UserName>" in username field
And User enters Password "<password>" in Password field
Then user should be logged in as <"screenName">
Examples:
|username|password|screenName|
|user |pwd# |User 1|
In above scenario, I want to pass the password "pwd#" as a parameter.
How do I handle this by ensuring the # is not treated to comment out the remaining portion of the line.
Kindly help me.
I added a backslash and it seemed OK. The editor didn't like it but it ran.
Given I have a \#2 web services
step looked like:
Given(/^I have a \\\#(\d+) web services$/) do |num|
expect(num).to eq(num.to_i.to_s)
end
Output looked like:
#pound
Scenario: client rest GET
Given I have a \#2 web services
1 scenario (1 passed)
1 step (1 passed)
0m0.005s
BTW, I only added the \# in the step to begin with then ran cuke. I told me what the step def characters needed to be. It's a good friend if you know what I mean.
We're using Cucumber and Selenium with Ruby. After reading the documentation on hooks I've tried my hand at setting a few tags to set (for example) some environment variables.
Here's a contrived example that demonstrates the problem.
When I establish a Before hook like so:
Before('#tag1', '#tag2') do
puts "in the before hook!"
end
It'll take effect with a scenario defined like so:
#tag1 #tag2
Scenario Outline: This is a test scenario
Given I run my first step for "<user>"
Then I complete my test
#firstrun
Scenarios:
|user|
|fred|
#secondrun
Scenarios:
|user|
|barney|
..however if I move #tag1 and #tag2 to the individual scenarios and not the scenario outline, the hook is never called, for instance:
#secondrun #tag1 #tag2
Scenarios:
|user|
|barney|
Is it possible to 'hook in' individual scenarios, or just the outlines?
Typically with scenario outlines the table of values you're testing is tied to that, not separate scenarios.
E.g
ScenarioOutline
Given I am on gmails website
When I login as <user> with <password>
Then I am able to view my primary inbox
Example:
| user | password |
| Fred | xd13#%& |