How we use a variable across markdown file

6 views
Skip to first unread message

Hung dao quang

unread,
Jul 11, 2021, 3:17:58 AM7/11/21
to concordion
Hi all,

 I have markdown file with structure:

- setUp at Background "#users=setUpSignInData()". However, the variable `users` could not work on Example sections. Is there any way to configure on Fixture file ?

====
### Scenario: User could log-into the application with valid information

#### Background:

Given there are [registered users](- "#users=setUpSignInData()") with information

- Pending user:
- Name: [](- "c:echo=#users.pending.firstName") [](- "c:echo=#users.pending.lastName")
- Username: [](- "c:echo=#users.pending.username")

- Activated user:
- Name: [](- "c:echo=#users.activated.firstName") [](- "c:echo=#users.activated.lastName")
- Username: [](- "c:echo=#users.activated.username")

##### [Example:](- "Activated user log-into system successfully") Activated user

When activated user [signs-into](- "signIn(#users.activated.username)") the application

##### [Example:](- "Register user log-into system successfully") Pending user

When pending user [signs-into](- "signIn(#users.pending.username)") the application

=====

Hung dao quang

unread,
Jul 16, 2021, 2:10:31 PM7/16/21
to concordion
Hi all,

 After researching on the Concordion github page, I found the way to re-use variable across markdown file
- using (- "before") in markdown file
- using @ConcordionScoped(Scope.SPECIFICATION) in Fixture file
Is there any things need to pay attention, feel free to share.

Screen Shot 2021-07-17 at 01.03.27.png

BTW, I would ask about the differences between @after/@before vs @afterExample/@beforeExample. Let's have a look at my case:
- after each example, I need to delete localStorage to cleanup the session. But if I used @afterExample it doesn't work but @After. 
thought ?

Screen Shot 2021-07-17 at 01.06.09.png

Thanks, 
Hung.
Reply all
Reply to author
Forward
0 new messages