contexts icon indicating copy to clipboard operation
contexts copied to clipboard

Addidng additional examples to step definitons

Open sajjadhossain opened this issue 10 years ago • 8 comments

added additional documents, added examples to all step definitions for additional clarity when running 'behat -di' or 'behat -dl'

sajjadhossain avatar Jun 01 '15 19:06 sajjadhossain

Seems scrutenizer is failing at the below step which may be unrelated:

Installing SSH Keys 00:01 The command exited with code 1.

sajjadhossain avatar Jun 01 '15 20:06 sajjadhossain

Can you split your PR in two: on for the documentation for existing steps, second for new steps.

Don’t forget to add tests for the new steps.

sanpii avatar Jun 03 '15 11:06 sanpii

Sure thing, thanks for the feedback. As for tests around the new steps I assume you mean unit tests, which I am still unfamiliar with. Is there any way you can point me to an article or lesson of sorts that will make that learning-curve less intense? I've worked with PHPUnit with a very limited scope in my prior work.

sajjadhossain avatar Jun 03 '15 13:06 sajjadhossain

As for tests around the new steps I assume you mean unit tests

No, a behat tests. See tests/features/browser.feature

sanpii avatar Jun 03 '15 13:06 sanpii

Sure, thats cake! thanks!!! Also your context work is great and has taught me a lot!!!

sajjadhossain avatar Jun 03 '15 14:06 sajjadhossain

Ok so i added tests in browser.feature. Specifically:

Scenario: Regression for new step definitions added by sajjadhossain on 6/5/15
    Given I am on "/"
    And I am on a new session
    And I set my browser window size to 15 inch MacBook Retina
    And I set my browser window size to "500" x "500"
    When I go to "https://github.com/Behatch/contexts"
    And I scroll to the bottom
    And I scroll to the top
    When I go to "http://www.javascripter.net/faq/alert.htm"
    And I press "Try it now"
    And I confirm the popup
    Then I should see "Alert: Modal Message Box"

I also did some grammatical changes and follow @stof 's recommendations for examples and methods. Let me know if there is anything else I can do! Thanks again!

sajjadhossain avatar Jun 08 '15 21:06 sajjadhossain

Hmm thats odd, @sanpii I cant reproduce that error, mink allows me to resize my windows for all my tests using your context... I use the same implementation for my instance of Behat.

And I set my browser window size to 15 inch MacBook Retina # tests/features/browser.feature:86
  Window resizing is not supported by Behat\Mink\Driver\GoutteDriver (Behat\Mink\Exception\UnsupportedDriverActionException)

sajjadhossain avatar Jun 09 '15 15:06 sajjadhossain

@sanpii LMK if this addresses your initial concerns or if anything needs to be revisited, Thanks!

sajjadhossain avatar Jun 10 '15 18:06 sajjadhossain