Тёмный

How to write Gherkin scripts 

spriteCloud Media
Подписаться 407
Просмотров 60 тыс.
50% 1

Опубликовано:

 

28 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 46   
@StefanieBolzek
@StefanieBolzek 3 дня назад
Very helpfull. I will use it for our trainees. 💯
@luke1525
@luke1525 2 года назад
SOrry if this is a dumb quesiton, but coming to this new... how does this help testing/automation, if you still need to create the actual programming/script? I mean isn't this useless other than a sort of "note" or "logic brainstorm"? How does it actually get to that functional stage and at what point is the avg user lost to complexity and the dev/programmer steps in? Thanks in advance!
@andiafraga
@andiafraga Год назад
Hello! Thank you so much for your video! So, I understood that using a lot of "and" is not a good idea, it's terrible like you told. In this case, can I to reduce steps and abreviate my scenario?
@2cdneh
@2cdneh Месяц назад
This was very useful, although seeing scenario's instead of the correct word scenarios at the top of the screen was distracting.
@yemisadiq8346
@yemisadiq8346 Год назад
Well-explained. Thank you.
@vongan1147
@vongan1147 4 года назад
It’s exactly what I’m looking for. So great! Thanks! So on average, how many scenarios are there on 1 feature that you're working on?
@spriteCloud
@spriteCloud 4 года назад
Hi. Generally, the goal is to keep your feature organised. Personally, I feel if it raises above 10 scenario's (And I consider a Scenario outline with multiple examples and 1 scenario), then it might be a good moment to review the feature and see if you can split it up in multiple ones. For example, splitting up an Account feature into Authentication and Registration.
@korayavci954
@korayavci954 Год назад
Very nice explained!
@jesseabucejo7008
@jesseabucejo7008 6 лет назад
Great tutorial and really helpful! By the way, I just want to ask if gherkin can be also used for negative tests (validation tests, etc.)?
@spriteCloud
@spriteCloud 6 лет назад
Hi Jesse, thanks for your message. Negative tests are definately possible. Maybe this post helps you out a bit? www.spritecloud.com/2015/01/complex-workflows-with-cucumber/
@renepatznick2526
@renepatznick2526 2 года назад
Thanks for sharing this informations. Can you recommend to write all product requirements in a gherkins style or would you just focus on test scenarios when using gherkins? When it comes to the system requirements which are only describing the black box interfaces of a system, than it becomes all the time difficult to me, how i should define the interfaces between modules inside a system. I only see the possability to do it by creating an architectural design. But if the system becomes more and more complexety with a fixed system interface than i dont understand how to provide the developer with all relevant informations without extending the gherkins scenarion. Hope you have some impressions. Kind regards René
@tsesangdolkar5067
@tsesangdolkar5067 2 года назад
The video tutorial is just great and informative , thank you!
@pawel040408
@pawel040408 2 года назад
That was very useful explanation!
@lzshow
@lzshow 3 года назад
If you have 200 products do u have to put "chair" in the scenarios
@spriteCloud
@spriteCloud 3 года назад
Hi, I hope I understand you correctly here. In the end, the goal of writing a scenario is that it covers a unique part of functionality of the system. If there are no key differences between the 200 products, then using 1 product is fine. But, for example, if one of the products have an exception in the checkout, to pick a color or a different delivery method, then it is relevant to create a separate scenario for it. I hope that answers your question!
@supriyachaudhari5218
@supriyachaudhari5218 4 года назад
Thanks for the video. Just one question, What if I want to test all available payment options from the application . Do I really repeated my scenarios with different options or is there is any way to write it.
@spriteCloud
@spriteCloud 4 года назад
Hi Supriya, Thanks for your comment. In the video I chose to use When the user submits valid payment information, but this can also be more variable. Then with a Scenario Outline, you make sure you don't need to repeat yourself: Scenario Outline: Submit payment options Given the user is on the payment page with product "" When the user submits a valid "" payment Then the successfully place order message should display Examples: | product | payment-type | | Chair | Ideal | | Table | Credit card | | Spoon | PayPal |
@sushmareddy8529
@sushmareddy8529 3 года назад
Great work and I m expecting more videos, thank you
@juanbaquero8628
@juanbaquero8628 Год назад
very useful, thanks
@debjyotibanerjee9846
@debjyotibanerjee9846 4 года назад
Can a scenario be called upon multiple times without writing the same scenario multiple times? Suppose: Scenario1: Fill form. If we desire to fill a form multiple times back to back, is there any option to refer to scenario1, OR do we have to write the same scenario each time we need to fill a form?
@spriteCloud
@spriteCloud 4 года назад
Hi, Thanks for the question. If, for the specific test, it's important that something is filled in multiple times, it can be written as follows: Given the user is logged in re-submitting the the form "5" times When the user submits the form again Then it should not be allowed to submit the form Actually referring to scenario 1 is something for the test automation developer to solve. It could be by directly referring to the existing step "5.times { step "submit the form"}" , but the recommended way would be making a helper function: def submit_form; end # Submits the form with data def ensure_form_submitted_times(number_of_submits = 5) ensure_logged_in # Makes sure to log in the user, if not logged in already go_to_submit_form # Navigates to the form number_of_submits.times{ submit_form } end But again, this is a technical solution. The focus of this video is writing Gherkin steps in a logical, readable and dynamic manner, without worrying about the TA-developer to solve it.
@tankertango3282
@tankertango3282 5 лет назад
The best video about the topic so far, but.... to have a full image here's something missing and that bugs me. Would be great if you presented how to describe those cases when you having multiple options which leads to "branch", like "invalid bank details and warning message" to be able to visualize the correct way. That is kind of unclear how branches of scenarios could look like. Like mine main feature has 4 scenarios for example. but one of them "if was terminated" have 2 own cases. How to play around that...
@spriteCloud
@spriteCloud 5 лет назад
Good point, being able to branch is one of the main goals of this backtracking. We’ll put it on the list for future videos. Thanks!
@juanluismitchell
@juanluismitchell 3 года назад
I need to do a gherkin for a chat... which contains different variations and I would like to know if I need a scenario (given when then) for each question and answer ? for example Given the user is on the name question When the user send the name Then the chat should display the "lastname" question is that OK?
@spriteCloud
@spriteCloud 3 года назад
Hi Juan, I you notice a pattern in a scenario, like 1 variable in the when and 1 in the then, I would recommend a scenario outline. For forms like you're describing, it becomes a bit more advanced Gherkin, we like to do something like follows: Scenario Outline: auth10 - Registering with invalid credentials Given a new user is not registered yet When the user submits their registration with the following data: | email | password | password_confirm | | | | | Then an error with text "" should display Examples: | email | password | password_confirm | error | | invalid.com | 123456789 | 123456789 | Invalid email address | | email.,%$&*@spritecloud.com | 123456789 | 123456789 | Invalid email address | | _255RAND_CHARS_@spritecloud.com | 123456789 | 123456789 | is too long (maximum is 254 characters) | | invalid-test@spritecloud.com | 1234 | 1234 | Is too short (minimum is 8 characters) | | invalid-test@spritecloud.com | 123456789 | 987654321 | Doesn't match password | Then for successful cases, we have a separate scenario. Maybe handly for codeblocks, but it needs a login codeshare.io/OdNboN Might be other tools to share these kind of code blocks, just did a quick search
@haaajFAJF
@haaajFAJF 5 лет назад
Ok, but what about the independence between scenarios?
@spriteCloud
@spriteCloud 5 лет назад
The Given step is handling the independence of the scenario. That step always says: Before I start, I need to be here as that person with those parameters. The eventual independence is handled in the step definitions, this will need a follow-up video.
@ProGunz21
@ProGunz21 5 лет назад
u switch to small testcases that is right way. but all scenario should be independent each other. so they dont depend on previous step.
@spriteCloud
@spriteCloud 5 лет назад
The Given step is handling the independence of the scenario. That step always says: Before I start, I need to be here as that person with those parameters. The eventual independence is handled in the step definitions, this will need a follow-up video from our end. Stay tuned!
@femmefatale437
@femmefatale437 3 месяца назад
@@spriteCloud Did you ever create a follow-up video?
@bhargavichaitanya960
@bhargavichaitanya960 3 года назад
How to write the. code when it has navigations
@spriteCloud
@spriteCloud 3 года назад
Navigation tests don't have any depth in them if that makes any sense. So in Gherkin single Scenario Outline to test it: Scenario Outline: Navigation tests Given the user is on the homepage When the user clicks on the "" in the top navigation Then the "target-page" page should display successfully Outlines: |navigation-item|target-page| |home | Home | | contact | Contact | However, for these kinds of test, I'd recommend using a specialized tool for it, like Fink link checker: github.com/dantleech/fink You can export the results to www.calliope.pro if you want a nice overview instead of xml results.
@somigupta86
@somigupta86 5 лет назад
How do we validate text with apostrophe. Eg: And I should see “Looks like you’ve”
@spriteCloud
@spriteCloud 5 лет назад
This is something that should be parameterized. So the step would become: `And I should see the looks-like-you-have text present on the page` And a configuration file would translate that parameter to the actual text you’re looking for. That way you can manage all your content text in a single translation file. I really like doing this in .yml format, but .JSON or .XML or even .csv should work just as good.
@subashsweet
@subashsweet 5 лет назад
What is the difference between The Plan & Backtrack
@spriteCloud
@spriteCloud 5 лет назад
The Plan will stop if any of the steps in between fail. So you will not know the results of that happen afterwards. The Backtrack tests 1 thing per scenario, so there is no cascading effect on a failure. Besides that, the Backtracked scenarios are modular. Meaning that if anything changes, you only need to update one scenario for it.
@Business_Analyst
@Business_Analyst 3 года назад
Great work!
@spriteCloud
@spriteCloud 3 года назад
Thanks!
@rizcube
@rizcube 5 лет назад
Thanks it was useful.
@vaandarken
@vaandarken 6 лет назад
Thanks for this tutorial
@spriteCloud
@spriteCloud 6 лет назад
Thanks, good to hear that you like it!
@pyxis8286
@pyxis8286 2 года назад
Aren't all of those intermediate scenario unnecessary? You could just skip right to the last one. Or instead of creating so many 'Given' steps that will repeat a lot of the same code, you could have steps that build on each other (but do not repeat the same processes) ' like "Given the user is on the product 'Chair'" and "Given the user adds the 'Chair' to the shopping basket" and "Given the user continues to the payment page"
@VGLV888
@VGLV888 3 года назад
☑️✅
@unwanted333
@unwanted333 3 года назад
Ben jij Nederlander? Volgs mij wel 😀
@spriteCloud
@spriteCloud 3 года назад
Inderdaad, Gijs is een Nederlander. Onze bedrijf zit in Amsterdam!
Далее
A Real World Example of BDD
16:33
Просмотров 24 тыс.
How to Write User Stories Using ChatGPT
12:57
Просмотров 25 тыс.
Cucumber BDD Best Practices
35:26
Просмотров 93 тыс.