Closed (fixed)
Project:
Drupal.org BDD
Version:
6.x-1.x-dev
Component:
Step definitions
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
10 May 2012 at 02:31 UTC
Updated:
13 Dec 2012 at 12:55 UTC
Jump to comment: Most recent file
Comments
Comment #1
pradeeprkara commentedPlease let me know if someone is working on this issue.
Thank you
Comment #2
eliza411 commentedNo one is actively working on this. We took a trial run at writing features at our user group meetup, and this is one of those issues. Please feel free to start working on it.
Comment #3
sachin2dhoni commentedI will start working on this.
Comment #4
sachin2dhoni commentedTagging to sprint 3
Comment #5
sachin2dhoni commentedAs we are not able to login with any user in the git6site ,I have written the feature by taking reference of drupal.org with logged in user as "ksbalajisundar" and taken the posts based on this user.
Once the git6site issue: #1720134: Script the re-creation of all needed test user accounts and passwords for git6site is fixed, I will change the "logged in user" with git user and take the posts of the changed user and modify in the feature and update the patch accordingly.
Attaching the patch file.
Comment #6
sachin2dhoni commentedComment #7
eliza411 commentedPlease review the Given/When/Then structures in the .feature file
http://drupal.org/node/1578324#important
Comment #8
sachin2dhoni commentedI have modified the structures in the .feature file as per standards.
Attaching the updated patch file.
Comment #9
eliza411 commentedI'm getting the following PHP Fatal error after applying and running:
Comment #10
pradeeprkara commentedtagging as sprint 4
Comment #11
sachin2dhoni commentedMade corrections and uploaded the patch.
Please review it.
Comment #12
eliza411 commentedWhile you're making changes, would you tab out the table endings for readability?
We need the full Feature statement:
In order to keep track of responses to issues I've posted
As an authenticated user
I want to find them listed all in a single place
This is your Then statement (and this is one of those weird ones that has no When in the scenario; that seems right in this case)
This should be And, not then, because of the adjustment above.
This scenario should begin with a Then statement and all of the first page pagination scenarios should probably precede the scenarios that follow posts.
Comment #13
sachin2dhoni commentedMade necessary changes as below.
Commit log:75dfa57
Once confirmed will roll out a patch.
Comment #14
eliza411 commentedOne small style correction remains:
should be more like:
Some larger content questions:
Site user will be recreated every time a new database is pulled. All the data for site user will be blank. We need an effective strategy to:
a) delete any posts for the site user if they exist
b) create the data necessary to execute the test
This is something we need to be looking at for all tests: will this pass on both a new copy of the database and one that's been around a while?
Comment #15
eliza411 commentedAdditionally, the step definitions in the patch are missing from this commit, so the tests can't really be executed. Note that I just did a clean up of step language to account for both singular and plural ... any time that you're counting 'at least X' the step should account for the variation.
For example,
@Given /^I should see at least \'(\d+)" new replies for the post$/would read
@Given /^I should see at least \'(\d+)" new (?:reply|replies) for the post$/The ?: allows you to group this without creating a backreference (which means it won't be awkwardly bolded in the test output).
With more regular plurals, you may see something more like post(?:|s) which allows either nothing or an s on the end of post.
Also, this particular definition has a mismatched quotes:
\'(\d+)"should be"(\d+)"Comment #16
eliza411 commentedSee #1742962: [meta] Create data for tests re: creating test data.
Comment #17
sachin2dhoni commentedMade the above suggested changes as per comment no:15 .
please check the commit logs :eb20637
AND 532d9fa,3d6d843
Comment #18
sachin2dhoni commentedTagging
Comment #19
eliza411 commentedI'm not comfortable with defining the post title in the yml file; I'm advancing this to jhedstrom for code review because we really need to contend with this issue. The rest of the feature file looks good.
Comment #20
jhedstromI agree with #19, if the post title is static enough to go into the yml file, can't we have it be a variable in the feature context? Alternatively, couldn't we grab a post title from the top of a list of posts and save that title in the class variable? If not, let's discuss potential ways around this--the
getPostTitleObject()method is confusing to me at this point.Comment #21
eliza411 commentedUnless we create data on behalf of 'site user' each time the site is set up or as part of the given statement, this test will fail because we can't guarantee there will be any posts at all when this test runs.
Comment #22
jhedstromI'm inclined towards doing this as a 'given' for now, until we have an easier way for people to run d.o. locally and have full bootstrap capabilities.
Comment #23
pradeeprkara commentedtagging
Comment #24
sachin2dhoni commentedAs more steps are required to create test data, adding them in Given will make it bulky, I think. So I have Added a separate scenario to achieve it.
Uploading to the dev branch.
Please check the commit log: a8dae2e
Please review it.
Comment #25
jhedstromLooks good.
Comment #26
jhedstromThis was merged to master.
Comment #28
pradeeprkara commentedPlease follow up #1846698: Update user_your_posts.feature for further developments.