Skip to content

Conversation

geoffrey-brier
Copy link
Contributor

Q A
Bug fix? [yes]
New feature? [no]
BC breaks? [no]
Deprecations? [no]
Tests pass?
Fixed tickets
License MIT
Doc PR

I'm currently testing the payment workflow in a project. The problem is that when I reach the credit card type selection (CB, VISA ...) I cannot submit the desired one because its name is in uppercase (take a look at the screenshot).

@@ -667,7 +667,7 @@ public function selectLink($value)
public function selectButton($value)
{
$xpath = sprintf('//input[((@type="submit" or @type="button") and contains(concat(\' \', normalize-space(string(@value)), \' \'), %s)) ', static::xpathLiteral(' '.$value.' ')).
sprintf('or (@type="image" and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id="%s" or @name="%s"] ', static::xpathLiteral(' '.$value.' '), $value, $value).
sprintf('or (lower-case(@type)="image" and contains(concat(\' \', normalize-space(string(@alt)), \' \'), %s)) or @id="%s" or @name="%s"] ', static::xpathLiteral(' '.$value.' '), $value, $value).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about doing the same for type="submit" and type="button" above? Anywhere else where we can do the same?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the type should indeed be case insensitive everywhere.

Adn this should be tested

@geoffrey-brier
Copy link
Contributor Author

@fabpot @stof I have updated the code to make the type attribute case insensitive, do you see anywhere else I could fix it ?
@stof Any idea on how to test this modification?

@stof
Copy link
Member

stof commented May 2, 2014

@geoffrey-brier write some tests using an uppercase type attribute (i.e. exactly the case you faced)

@geoffrey-brier
Copy link
Contributor Author

@stof I just wrote a test

@fabpot
Copy link
Member

fabpot commented May 4, 2014

apparently, tests are broken (https://travis-ci.org/symfony/symfony/builds/24294084).

@geoffrey-brier
Copy link
Contributor Author

@fabpot sounds like the lower-case function does not exists in XPath 1, I've tried another way of doing that.

@geoffrey-brier
Copy link
Contributor Author

Tests are broken but I don't think it comes from my modifications, could you confirm @fabpot ?

@fabpot
Copy link
Member

fabpot commented May 12, 2014

Thank you @geoffrey-brier.

fabpot added a commit that referenced this pull request May 12, 2014
…ier)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #10841).

Discussion
----------

[DomCrawler] Fixed image input case sensitive

| Q             | A
| ------------- | ---
| Bug fix?      | [yes]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   |
| Fixed tickets |
| License       | MIT
| Doc PR        |

I'm currently testing the payment workflow in a project. The problem is that when I reach the credit card type selection (CB, VISA ...) I cannot submit the desired one because its name is in uppercase (take a look at the screenshot).

![](http://s22.postimg.org/oz5cm3fwh/example.png)

Commits
-------

ab1198f [DomCrawler] Fixed image input case sensitive
@fabpot fabpot closed this May 12, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants