Add public key link - There is a link to upload a key (currently there are two when you have no key)
Add keys - Verify that you can upload only valid keys

Comments

kssundar’s picture

Component: Tests » Feature/Scenarios
Assigned: Unassigned » kssundar
Issue tags: +sprint 4

Taking this up and tagging

kssundar’s picture

Title: Edit profile (SSH keys) » Edit profile (SSH keys) (edit_profile_sshkey.feature)
Status: Active » Needs review

This feature is created and attached is the patch.

The patch will add a few parameters to the yml file. You might have to configure the following parameters:
ssh key -> title (This is the ssh key title on which Delete/Edit operations have to be performed)
ssh key -> valid (Provide a valid ssh key - Dont forget to provide the title at the end of the key & title should be same as ssh key -> title)
ssh key -> invalid (Provide an invalid ssh key)

Sample parameters have been added in the patch as well. Some scenarios may fail if ssh key you entered already exists.

kssundar’s picture

StatusFileSize
new7.98 KB

Attaching patch here :)

eliza411’s picture

Assigned: kssundar » halstead
Status: Needs review » Needs work

Really glad to see this get underway!

Ultimately we'll need this test to have pub/private keys on the CI server and for developers running tests on demand. This seems like a great start, but I think we might consider creating the key as part of the test setup, and if that's not platform agnostic, then tagging these tests @linux or something.

@halstead, can you weigh in here.

kssundar’s picture

Assigned: halstead » eliza411
Status: Needs work » Needs review

Anything here? :)

eliza411’s picture

Status: Needs review » Needs work

Thanks for reminding me.

Now that you've been working with the command-line, can this test be written to both produce and upload keys? It may limit the test to being run on a linux system, and that's okay.

I'll open a separate issue regarding the provision of keys for git user and git vetted user for push/pull tests.

eliza411’s picture

Assigned: eliza411 » Unassigned

unassigning.

kssundar’s picture

Assigned: Unassigned » kssundar
Issue tags: +sprint 7

tagging

kssundar’s picture

Assigned: kssundar » eliza411
Status: Needs work » Needs review

Feature created and committed here - http://drupalcode.org/project/doobie.git/commit/75d5758

I have tagged scenarios as @linux

Also, Process->run() did not work for generating ssh keys as it required user interaction. So I used exec().

eliza411’s picture

Status: Needs review » Needs work

I'm still being prompted for interaction.

Also, we should not delete an existing key with a default name. I among others use id_rsa as my main key.
ssh-keygen -f filename should let you specify the key name)

  @linux
  Scenario: Add a public key: Invalid key                                                             # features/drupalorg/user_profile_sshkeys.feature:50
    When I follow "Add a public key"                                                                  # FeatureContext::clickLink()
Enter file in which to save the key (/home/melissa/.ssh/id_rsa): 
kssundar’s picture

Status: Needs work » Needs review

Oops! I forgot to mention that the file is being removed. Apologies for that :(

I am trying to use this command:

"ssh-keygen -f \"$sshFile\" -N \"$pass\" -t rsa -C \"$title\"";

The above command will take filename and password in a single shot and does not require any user interaction. The newly generated ssh keys will be stored in 'files' folder.

Can we delete the newly generated ssh files after the scenario?

eliza411’s picture

Assigned: eliza411 » Unassigned

If the step definition is using a random string, I think it's fine to delete the key.

kssundar’s picture

Assigned: Unassigned » eliza411

Updated the ssh key generating logic and it now does not ask for any user interaction. Also, changed 'exec()' to 'Process->run()'.

Committed here - http://drupalcode.org/project/doobie.git/commit/0115207

eliza411’s picture

I'm getting
PHP Fatal error: Call to a member function getHTML() on a non-object in /home/melissa/doobie/features/bootstrap/FeatureContext.php on line 385

I think this is because of the broken nature of git6 right now, but I think we need better exception handling as this kind of broken is clearly something we can expect.

 Scenario: View the Projects section         # features/project/user_profile_projects_section.feature:9
    Then I should see the heading "Projects"  # FeatureContext::iShouldSeeTheHeading()
      The text Projects was not found in any heading http://git6site.devdrupal.org/user
    And I should see "Total:"                 # FeatureContext::assertPageContainsText()
    And I should see "commits)"               # FeatureContext::assertPageContainsText()
    And I should see the link "SSH keys"      # FeatureContext::iShouldSeeTheLink()

  @gitrepo
  Scenario: Create a sandbox project and initialize repo # features/project/user_profile_projects_section.feature:16
    When I am at "/node/add/project-project"             # FeatureContext::iAmAt()
    And I create a "module"                              # FeatureContext::iCreateA()
    And I see the project title                          # FeatureContext::iShouldSeeTheProjectTitle()
    And I am on the Version control tab                  # FeatureContext::iAmOnTheVersionControlTab()
PHP Fatal error:  Call to a member function getHTML() on a non-object in /home/melissa/doobie/features/bootstrap/FeatureContext.php on line 385
eliza411’s picture

Status: Needs review » Needs work

Consider the following changes to produce a clear given/when/then structure:
As a git vetted user
I should see the Projects section in my profile page

Background:
Given I am logged in as "git vetted user"

Scenario: View the Projects section
When I visit "/user"
Then I should see the heading "Projects"
And I should see "Total:"
And I should see "commits)"
And I should see the link "SSH keys"

@gitrepo
Scenario: Create a sandbox project and initialize repo
When I visit "/node/add/project-project"
And I create a "module"
And I see the project title
And I am on the Version control tab
And I initialize the repository
Then I should see {test something here}

@gitrepo
Scenario: Commit to the above sandbox project
When I visit the Version control tab
And I clone the repo
And I push a commit to the repository
And I push one more commit to the repository
Then I should see the project link
And I should see "2" commits for the project

@gitrepo
Scenario: Promote the sandbox project and commit
When I visit the project page
And I promote the project
And I follow "Version control"
And I clone the repo
And I push a commit to the repository // If it's not too complicated can we combine this
And I push one more commit to the repository // with this

To something more like:

And I push "X" commit(s) to the repository

Then I should see the project link
And I should see "4" commits for the project <- This introduces an unnecessary dependency

@gitrepo
Scenario: Create a full project and commit
When I visit "/node/add/project-project"
And I create a full project
And I follow "Version control"
And I initialize the repository
And I follow "Version control"
And I push a commit to the repository
Then I should see the project link
And I should see "1" commit for the project

eliza411’s picture

Assigned: eliza411 » Unassigned

Unassigning

kssundar’s picture

Assigned: Unassigned » eliza411
Status: Needs work » Needs review

I think the comments #14 and #15 belong to the issue #1706782: Profile (/user) and the issue in this page still needs review. :)

kssundar’s picture

Issue tags: +sprint 8

tagging

eliza411’s picture

Component: Feature/Scenarios » Step definitions
Assigned: eliza411 » Unassigned

Looks good to me ... sorry about posting comments on the wrong issue!

jhedstrom’s picture

Status: Needs review » Reviewed & tested by the community

Code changes look good, tests are passing.

eliza411’s picture

Status: Reviewed & tested by the community » Fixed

merged to master

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pradeeprkara’s picture

Version: » 6.x-1.x-dev
Issue tags: +sprint 18
pradeeprkara’s picture

Issue summary: View changes

.