You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Just wondering if anyone can help me. I am trying to run a Login test using the dataProvider annotation (my current set up is below). The test runs as expected and fills out the username and password fields correctly, however the output shows that the test failed with the following error message
testLoginFail with data set #1() does not exist. If anyone can help me out with this, it would be much appreciated.
/**
* Constructor - initialise the web driver session
*/
public function __construct($name = NULL, array $data = array(), $dataName = '') {
parent::__construct($name, $data, $dataName);
...
/**
* Tests the unsuccessful login of a user
* @dataProvider userDataProvider
*/
public function testLoginFail($email, $password) {
//Create objects required by this test
$userAction = new UserAction($this);
Firstly thanks for your response. Sorry I should have mentioned I also have the setUp method in the same file as the constructor, as below;
//===============
/*
* setup - add pre test run tasks
*/
public function setUp() {
parent::setUp();
}
//================
The parent setUp class is located in the WebDriverTestCase.php file and is as follows
//================
public function setUp()
{
$caps = $this->getDesiredCapabilities();
$this->setBrowserUrl('');
if (!isset($caps['name'])) {
$caps['name'] = get_called_class().'::'.$this->getName();
$this->setDesiredCapabilities($caps);
}
}
//===============
Also you say I won't be able to use a dataProvider with the __construct method present but it seems to run fine and actually loads the page, inputs the email and password fields and then submits them but I get the error as stated above (data set #1() does not exist). Could there be any other reason for this/ am I missing something from my setUp method?
Hi,
Just wondering if anyone can help me. I am trying to run a Login test using the dataProvider annotation (my current set up is below). The test runs as expected and fills out the username and password fields correctly, however the output shows that the test failed with the following error message
testLoginFail with data set #1() does not exist. If anyone can help me out with this, it would be much appreciated.
public function __construct($name = NULL, array $data = array(), $dataName = '') {
parent::__construct($name, $data, $dataName);
...
/**
* Tests the unsuccessful login of a user
* @dataProvider userDataProvider
*/
public function testLoginFail($email, $password) {
//Create objects required by this test
$userAction = new UserAction($this);
}
public function userDataProvider() {
return array(
array('afakeemail@gmail.com', 'Password'),
array('anotheremail@gmail.com', 'Password')
);
}
The text was updated successfully, but these errors were encountered: