Behat tests: I click on the button and the test is stopping - Ajax request

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Behat tests: I click on the button and the test is stopping - Ajax request



I'm using the Behat testing in my website and I'm trying to click on one of the button and the test is stopping (without response or exception). This button calls to a js function which function make a AJAX request to the PHP code and I think that this is the problem, because the others buttons works good every time.



Any ideas?



This is the code and the configuration.



Scenario


Then I click on the "a.next_step"



FeatureContext.php


/**
* @Then /^I click on the "([^"]*)"$/
*/
public function iClickOn($element)
{
$page = $this->getSession()->getPage();
$find_name = $page->find('css', $element);
if (!$find_name) {
throw new Exception($element . ' could not be found');
} else {
$find_name->click();
}
}



behat.yml


#behat.yml
default:
extensions:
DMoreChromeExtensionBehatServiceContainerChromeExtension: ~
BexBehatScreenshotExtension:
image_drivers:
local:
screenshot_directory: PATH
clear_screenshot_directory: true
BehatMinkExtension:
browser_name: chrome
base_url: URL
sessions:
default:
chrome:
api_url: API_URL
download_behavior: allow
download_path: /download
validate_certificate: false

imports:
- behat.local.yml



HTML


<div class="row">
<div class="col-md-12">
<a href="#" class="form-group mr-3 float-right btn btn-warning reset_page">Reset</a>
<a href="#" class="form-group mr-1 float-right btn btn-primary next_step">Next step</a>
</div>
</div>





It’s really hard to answer a question about a bug in code when the question doesn’t include any of the buggy code. In order to help fix the problem, answerers are going to have to see what the code is.
– Liam
15 hours ago





Please post the code if you want help.
– tommyO
15 hours ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results