I am working on automating a website written in Python and using Angular where there are many confirmation notifications. The issue I have is that Behat doesn't seem to recognise those notifications, let alone allow me to interact with them.
I have attached screenshots of what the notification should look like and the Undefined – Undefined error message Behat produces instead.
My scenario:
Then I select the Delete the Media Plan Line Checkbox
And I delete the Media Plan Line
And I select Yes to confirm the deletion
And I select No to confirm the deletion
And my context:
/**
* @Then /^I select the Delete the Media Plan Line Checkbox$/
*/
public function iDeleteMediaPlanLineCheckbox()
{
/**
* @var AddMediaPlan $addMediaPlan
*/
$addMediaPlan= $this->getPage('AddMediaPlan');
$addMediaPlan->deleteMediaPlanLineCheckbox();
}
/**
* @Given /^I delete the Media Plan Line$/
*/
public function iDeleteTheMediaPlanLine()
{
/**
* @var AddMediaPlan $addMediaPlan
*/
$addMediaPlan= $this->getPage('AddMediaPlan');
$addMediaPlan->deleteMediaPlanLines();
}
public function deleteMediaPlanLineCheckbox ()
{
$this->getElement('deleteMediaPlanLineArea')->click();
$this->getSession()->wait(2000);
$element = $this->getElement('deleteMediaPlanLineCheckbox');
$this->scrollWindowToElement($element);
$element->click();
$this->getSession()->wait(4000);
}
public function deleteMediaPlanLines ()
{
$this->getSession()->wait(2000);
$this->getElement('deleteMediaPlanLines')->click();
$this->getSession()->wait(800000);
}
public function deletePopUpYes ()
{
$this->getElement('deletePopUpYes')->click();
$this->getSession()->wait(2000);
}
public function deletePopUpNo ()
{
$this->getElement('deletePopUpNo')->click();
$this->getSession()->wait(2000);
}
Working notification
Broken notification
And here is the video.