New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option text to seeInField #3905

Merged
merged 2 commits into from Jan 18, 2017

Conversation

Projects
None yet
4 participants
@gimler
Contributor

gimler commented Jan 10, 2017

  • support option text in seeInField not only value
  • fix bug match with and without whitespaces see also facebook/php-webdriver#394
  • fix bug seeInField not working after selectOption
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Jan 16, 2017

Member

The WebDriver tests failed:

---------
1) WebDriverTest: See in field empty value for unselected select
 Test  tests/web/WebDriverTest.php:testSeeInFieldEmptyValueForUnselectedSelect
Failed testing for '' in select3's value: 'Nothing selected', 'Nothing selected', 'not seen one'
Failed asserting that an array contains ''.
#1  PHPUnit_Framework_Assert::assertContains
#2  /home/runner/Codeception/src/Codeception/Module/WebDriver.php:1016
#3  /home/runner/Codeception/tests/unit/Codeception/Module/TestsForWeb.php:537
#4  TestsForWeb->testSeeInFieldEmptyValueForUnselectedSelect
#5  /home/runner/Codeception/codecept:34

---------
2) WebDriverTest: See in field select
 Test  tests/web/WebDriverTest.php:testSeeInFieldSelect
Failed testing for '        no_whitespaces    ' in 's value: 'no_whitespaces', 'no_whitespaces', 'white'
Failed asserting that an array contains '        no_whitespaces    '.
#1  PHPUnit_Framework_Assert::assertContains
#2  /home/runner/Codeception/src/Codeception/Module/WebDriver.php:1016
#3  /home/runner/Codeception/tests/web/WebDriverTest.php:668
#4  WebDriverTest->testSeeInFieldSelect
#5  /home/runner/Codeception/codecept:34

Could you run the tests locally to fix them?

php -S 127.0.0.1:8000 -t tests/data/app
./codecept run web
Member

DavertMik commented Jan 16, 2017

The WebDriver tests failed:

---------
1) WebDriverTest: See in field empty value for unselected select
 Test  tests/web/WebDriverTest.php:testSeeInFieldEmptyValueForUnselectedSelect
Failed testing for '' in select3's value: 'Nothing selected', 'Nothing selected', 'not seen one'
Failed asserting that an array contains ''.
#1  PHPUnit_Framework_Assert::assertContains
#2  /home/runner/Codeception/src/Codeception/Module/WebDriver.php:1016
#3  /home/runner/Codeception/tests/unit/Codeception/Module/TestsForWeb.php:537
#4  TestsForWeb->testSeeInFieldEmptyValueForUnselectedSelect
#5  /home/runner/Codeception/codecept:34

---------
2) WebDriverTest: See in field select
 Test  tests/web/WebDriverTest.php:testSeeInFieldSelect
Failed testing for '        no_whitespaces    ' in 's value: 'no_whitespaces', 'no_whitespaces', 'white'
Failed asserting that an array contains '        no_whitespaces    '.
#1  PHPUnit_Framework_Assert::assertContains
#2  /home/runner/Codeception/src/Codeception/Module/WebDriver.php:1016
#3  /home/runner/Codeception/tests/web/WebDriverTest.php:668
#4  WebDriverTest->testSeeInFieldSelect
#5  /home/runner/Codeception/codecept:34

Could you run the tests locally to fix them?

php -S 127.0.0.1:8000 -t tests/data/app
./codecept run web
@DavertMik

Overall looks good, but please fix the failing test

@@ -1088,10 +1094,14 @@ protected function proceedSeeInField(array $elements, $value)
$currentValues[] = $el->getAttribute('value');
}
break;
case 'option':

This comment has been minimized.

@Nitpick-CI

Nitpick-CI Jan 17, 2017

There must be a comment when fall-through is intentional in a non-empty case body

@Nitpick-CI

Nitpick-CI Jan 17, 2017

There must be a comment when fall-through is intentional in a non-empty case body

@gimler

This comment has been minimized.

Show comment
Hide comment
@gimler

gimler Jan 17, 2017

Contributor

@DavertMik ready

Contributor

gimler commented Jan 17, 2017

@DavertMik ready

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Jan 17, 2017

Member

Could you ensure that seeInField of InnerBrowser behaves in the same way?
The best way to do that is to move tests to https://github.com/Codeception/Codeception/blob/2.2/tests/unit/Codeception/Module/TestsForWeb.php

Member

Naktibalda commented Jan 17, 2017

Could you ensure that seeInField of InnerBrowser behaves in the same way?
The best way to do that is to move tests to https://github.com/Codeception/Codeception/blob/2.2/tests/unit/Codeception/Module/TestsForWeb.php

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Jan 18, 2017

Member

Ok, that's pretty enough. I will try to check how seeInField will work for PhpBrowser and others

Member

DavertMik commented Jan 18, 2017

Ok, that's pretty enough. I will try to check how seeInField will work for PhpBrowser and others

@DavertMik DavertMik merged commit b283768 into Codeception:2.2 Jan 18, 2017

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details

@gimler gimler deleted the gimler:seeInField_option_text branch Jan 20, 2017

chris1312 added a commit to chris1312/Codeception that referenced this pull request Jun 16, 2017

add option text to seeInField (#3905)
* add option text to seeInField

* fix phpdoci comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment