$ (php: get)
$div = $this->page->get('#querying-get');
querying-get
$$ (php: getAll)
$divs = $this->page->getAll('.querying-get');
foreach ($divs as $div) {
echo $div->getProperty('textContent')->jsonValue();
}
contains
$divs = $this->page->contains('apple');
.value()
$inputValue = $this->page->get('#properties-value input')->value();
$textareaValue = $this->page->get('#properties-value textarea')->value();
$selectValue = $this->page->get('#properties-value select')->value();
.innerText()
$divInnerText = $this->page->get('#properties-innertext')->innerText();
.innerHTML()
$divInnerHtml = $this->page->get('#properties-innerhtml')->innerHTML();
Attributes
$dataTest = $page->get('#properties-attributes')->its('data-test');
dialog
// Alert
$this->page->click('#dialog-alert');
$dialog = $this->page->waitForDialog(); // waits for a dialog to open
$dialog->dismiss();
// Prompt
$this->page->click('#dialog-prompt');
$dialog = $this->page->waitForDialog();
$dialog->accept('type this text into the prompt');
// or $dialog->dismiss();
// Confirm
$this->page->click('#dialog-confirm');
$dialog = $this->page->waitForDialog();
$dialog->accept();
// or $dialog->dismiss();
type
$this->page->get('input')->type('write your text');
focus/blur
$this->page->get('#actions-focus')->focus();
// or with selector
$this->page->focus('#actions-focus');
// And to blur
$this->page->get('#actions-focus')->blur();
// or with selector
$this->page->blur('#actions-focus');
input with id actions-focus
clear
$this->page->get('input')->clear();
click & doubleClick & middleClick & rightClick
$this->page->get('button')->click();
select
$this->page->get('select')->select('Apple');
checkbox
// TOD
scrollIntoView
$this->page->get('select')->scrollIntoView();
actions-scrollIntoView
scrollTo
$this->page->scrollTo(0, 200);
$this->page->get('#actions-scrollTo')->scrollTo(0, 100);
actions-scrollIntoView
hover
// TOD
children
$parent = $this->page->get('#traversal-parent');
// returns all 3 children
$children = $parent->children();
// returns only the children that match the selector
$selected = $parent->children('.traversal-child-selector');
parent & parents
$child = $this->page->get('#traversal-child');
// returns the wrapper div
$parent = $child->parent();
// returns all parent elements until html
$parents = $child->parents();
traversal-child
siblings
// returns 'Child 1' and 'Child 3'
$siblings = $this->page->get('#traversal-siblings')->siblings();
Drop element on target
$parent = $this->page->get('#traversal-parent');
// returns all 3 children
$children = $parent->children();
// returns only the children that match the selector
$selected = $parent->children('.traversal-child-selector');
waitForMissing(Text)
// TODO
waitForEvent
// TODO
waitForMissing(Text)
// TODO
withinFrame
// TODO