Hi,

wondering if anyone has had a problem with DrupalSeleniumWebTestCase::drupalPost()?

The following code works fine within my test case if extends DrupalWebTestCase

    $edit = array(
      'root' => 'management:1',
    );
    $this->drupalPost('admin/config/user-interface/dynamic_persistent_menu/add', $edit, t('Save'));

However, if my test case extends DrupalSeleniumWebTestCase, it seems that the default name=main-menu:0 is selected instead of name=management:1

The entire module, with this code, can be found on the branch 1553368 of Dynamic Persistent Menu.

(Ref. #1553368: Set up selenium tests to test javascript functionality)

CommentFileSizeAuthor
#3 1553370-3-impossible-to-select.patch2.15 KBalberto56

Comments

alberto56’s picture

I suspect the presence of a colon in the value might have something to do with it, as all my other drupalPost()s work fine.

alberto56’s picture

Title: drupalPost() does not select the right element » drupalPost() selects default select list element when colon (":") is present in value of desired element.
Category: support » bug

Here is a better title for this. I believe it's a bug.

alberto56’s picture

Title: drupalPost() selects default select list element when colon (":") is present in value of desired element. » drupalPost() can't select from a select list
StatusFileSize
new2.15 KB

Hi,

OK, nothing to do with the colon after all.

I am including a patch which does the following: adds a test which confirms the problem. My test starts by creating a node, then going to the article display configuration page, and using the select list to make the body hidden. The test then runs an assertion that the body is in fact hidden. This test fails, which indicates that it is not possible to select something from a select list.

(Note: This patch is not a solution to the problem, it is simply meant to demonstrate the issue).

Cheers,

Albert.

alberto56’s picture

PatchRanger’s picture

Version: 6.x-1.x-dev » 7.x-3.x-dev
Status: Patch (to be ported) » Fixed

Fixed: http://drupalcode.org/project/selenium.git/commit/43fb666.
Commit is yours though I have refactored it a bit - and of course added a fix for your tests.
Consider it as thanksgiving to your effort - thank you!

PatchRanger’s picture

Version: 7.x-2.x-dev » 6.x-1.x-dev
Status: Active » Patch (to be ported)

Now it should be ported to D6 as well.

PatchRanger’s picture

Version: 7.x-3.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

Pure functionality is ported but without tests: http://drupalcode.org/project/selenium.git/commit/c773b1f.
The problem with test is that we don't have such configuration on D6 - so we need to find another obvious selectbox where to apply FormPost test case.

PatchRanger’s picture

Issue summary: View changes

added "the default"