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)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 1553370-3-impossible-to-select.patch | 2.15 KB | alberto56 |
Comments
Comment #1
alberto56 commentedI suspect the presence of a colon in the value might have something to do with it, as all my other drupalPost()s work fine.
Comment #2
alberto56 commentedHere is a better title for this. I believe it's a bug.
Comment #3
alberto56 commentedHi,
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.
Comment #4
alberto56 commentedsee also #1312184: Problem with select element and support for selenium IDE commands, possibly a duplicate?
Comment #5
PatchRanger commentedFixed: 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!
Comment #6
PatchRanger commentedNow it should be ported to D6 as well.
Comment #7
PatchRanger commentedPure 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.
Comment #7.0
PatchRanger commentedadded "the default"