Last modified: 2014-01-22 12:47:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T51876, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 49876 - Group Cucumber step definitions by type, and sort steps in a group alphabetically
Group Cucumber step definitions by type, and sort steps in a group alphabetic...
Status: RESOLVED FIXED
Product: Wikimedia
Classification: Unclassified
Quality Assurance (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Željko Filipin
gci2013 https://www.mediawiki.org/wik...
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-20 13:32 UTC by Željko Filipin
Modified: 2014-01-22 12:47 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Željko Filipin 2013-06-20 13:32:42 UTC

    
Comment 1 Željko Filipin 2013-06-20 13:46:54 UTC
Cucumber step definitions[1] should be sorted alphabetically. This is how a definition looks like:

step_type(/^step name$/) do
  # ruby code
end

Example (from visual_editor_steps.rb[2]):

Given(/^I am at my user page$/) do
  visit(VisualEditorPage)
end
When /^I click Save page$/ do
  on(VisualEditorPage).save_page_element.click
end
Then /^Page text should contain the string$/ do
  @browser.text.should match Regexp.escape("Editing with #{@does_not_exist_page_name}")
end

Ruby code should be ignored. Steps should be grouped by type. "Given" steps should be grouped together, the same for "When" and "Then" steps. Inside the group, steps should be sorted alphabetically by step name.

For a good example on how steps should be grouped and sorted see aftv5_steps.rb[3] file.

1: https://github.com/wikimedia/qa-browsertests/tree/master/features/step_definitions
2: https://github.com/wikimedia/qa-browsertests/blob/master/features/step_definitions/visual_editor_steps.rb
3: https://github.com/wikimedia/qa-browsertests/blob/master/features/step_definitions/aftv5_steps.rb
Comment 2 Željko Filipin 2013-11-27 21:51:24 UTC
Jeff, I have just noticed this bug and thought it would be a good task for code-in. :)

Since this is an easy task, I would suggest that it is done for all our repositories (about 10 of them) that contain step files[1]

1: https://github.com/wikimedia/mediawiki-selenium#links
Comment 3 Željko Filipin 2013-11-27 21:59:14 UTC
I have just noticed that you are using this bug as documentation, please ignore the comment above.
Comment 4 Mayank Madan 2013-12-01 11:00:28 UTC
The [2] link is no longer working as the file has been removed from the repository
Comment 5 Željko Filipin 2013-12-02 17:09:12 UTC
If you need more information (and you probably do), feel free to ask questions
here, at #wikimedia-qa freenode IRC channel or at QA mailing list:

https://lists.wikimedia.org/mailman/listinfo/qa
Comment 6 Jeff Hall 2013-12-03 16:50:46 UTC
Page looks great!

https://www.mediawiki.org/wiki/Manual:Coding_conventions/Cucumber
Comment 7 Željko Filipin 2013-12-03 17:41:01 UTC
Reopening, this bug is about implementing the convention, not documenting it. :)

Now that we have the document, I plan to update it and then we can have another task to implement the convention across all repositories.
Comment 8 Željko Filipin 2014-01-22 12:47:24 UTC
I have wrote all conventions that I could think of here:

https://www.mediawiki.org/wiki/Manual:Coding_conventions/Cucumber

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links