public function ThunderJavascriptTestBase::waitForImages in Thunder 8.2
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
- 8.3 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
- 8.4 tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
- 6.2.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
- 6.0.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
- 6.1.x tests/src/FunctionalJavascript/ThunderJavascriptTestBase.php \Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase::waitForImages()
Wait for images to load.
This functionality is sometimes need, because positions of elements can be changed in middle of execution and make problems with execution of clicks or other position depending actions. Image property complete is used.
Parameters
string $cssSelector: Css selector, but without single quotes.
int $total: Total number of images that should selected with provided css selector.
int $time: Waiting time, by default 10sec.
1 call to ThunderJavascriptTestBase::waitForImages()
- ChannelsTagsTest::testChannelsCreation in tests/
src/ FunctionalJavascript/ ChannelsTagsTest.php - Test channel creation, tagging of articles and channel page with articles.
File
- tests/
src/ FunctionalJavascript/ ThunderJavascriptTestBase.php, line 130
Class
- ThunderJavascriptTestBase
- Base class for Thunder Javascript functional tests.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function waitForImages($cssSelector, $total, $time = 10000) {
$this
->getSession()
->wait($time, "jQuery('{$cssSelector}').filter(function(){return jQuery(this).prop('complete');}).length === {$total}");
}