Problem/Motivation
Set up behat tool with c.o.
Write a BDD test suite for login/logout.
https://agaric.coop/blog/how-use-behavior-driven-development-drupal-behat
https://docs.behat.org/en/v2.5/quick_intro.html
https://www.drupal.org/drupalorg/docs/build/bdd-tests
Issue fork cloud-3226097
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
yutong.li commentedComment #3
yutong.li commentedComment #6
yutong.li commentedComment #7
yutong.li commentedComment #9
yutong.li commentedComment #10
yas@yutong.li
Thank you for adding the test scenarios. I posted my comment above. Please check the ones. Thanks!
Comment #11
kumikoono commented@Yutong, it looks good to me. Thanks for your work!
Comment #12
yutong.li commentedComment #13
yas@yutong.li
Thank you for updating the test case scenarios. I found the test case includes a validation of some specific string
Cloud Orchestrator, which is defined in the admin's configuration on Drupal Core. So Drupal Core shows that string, not fromcloudmodule.Comment #14
yas@yutong.li
I learned that Behat has Scenario Outlines. So I updated my above comment. To handle the testing environment specific strings, I think we can add placeholder(s)
<...>and the sectionExamples:. For example:I think we can preprocess our own magic string such as
{{...}}, so that{{site name}}can be replaced toCloud Orchestratoron runtime (by using a sed command or some other tool. Or, if we can directly place an environment variable of a shell intoExamples:section likeBEHAT_PARAMStowardsbehat.yml, that would be better.Comment #15
yutong.li commentedComment #16
yas@youtong.li
Thank you for the update. It looks perfect now. I'll merge the patch to
4.xbranch and close this issue as Fixed.Comment #17
yas@yutong.li
Since we merged the patch at #3224987: Set up behat to cloud module for BDD, could you please rebase your patch? Thanks!
Comment #18
yutong.li commentedComment #19
yutong.li commentedComment #20
yutong.li commentedComment #21
yas@yutong.li
Thank you for the update. I think the filename start with a capital letter, so it can be:
LoginLogout.featurein this case. Thanks!Comment #22
yutong.li commentedComment #23
yas@yutong.li
Thank you for the update. It looks good to me now. I'll merge the patch to
4.xand close this issue as Fixed.Comment #26
yas