Yii Framework Forum: Getting error in codeception test - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Getting error in codeception test

#1 User is offline   StreetCoder 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 61
  • Joined: 13-April 13

Posted 20 February 2015 - 02:28 PM

Hi Everybody,

I fall in a trouble that is I have been trying to test the customer query which is at the end of chapater 2. When I run a test for QueryCustomerByPhoneNumberCept.php I am getting the follwoing error.

There was 1 failure:

---------
1) Failed to query the customer info using his phone number in QueryCustomerByPhoneNumberCept (/var/www/crmapp/tests/acceptance/QueryCustomerByPhoneNumberCept.php)
Couldn't see "Malcolm Homenick DDS","#search_results":
Failed asserting that any element by '#search_results' on page /crmapp/web/index.php/customers?phone_number=634-129-6931x386 
+ <div class="list-view" id="search_results"><div class="empty">No results found.</div></div>
contains text 'Malcolm Homenick DDS'

Scenario Steps:
19. I see "Malcolm Homenick DDS","#search_results"
18. I see current url matches "/customers/"
17. I click "Search"
16. I fill field "phone_number","634-129-6931x386"
15. I am on page "/customers/query"
14. I see current url matches "/customers/"
13. I click "Submit"

                                     
FAILURES!                            
Tests: 2, Assertions: 5, Failures: 1.



The of QueryCustomerByPhoneNumberCept.php is given below:

$I = new \AcceptanceTester\CRMOperatorSteps($scenario);
$I->wantTo('add two different customers to database');

$I->amInAddCustomerUi();
$first_customer = $I->imagineCustomer();
$I->fillCustomerDataForm($first_customer);
$I->submitCustomerDataForm();
$I->seeIAmInListCustomersUi();

$I->amInAddCustomerUi();
$second_customer = $I->imagineCustomer();
$I->fillCustomerDataForm($second_customer);
$I->submitCustomerDataForm();
$I->seeIAmInListCustomersUi();

$I = new \AcceptanceTester\CRMUserSteps($scenario);
$I->wantTo('query the customer info using his phone number');
$I->amInQueryCustomerUi();
$I->fillInPhoneFieldWithDataFrom($first_customer);
$I->clickSearchButton();
$I->seeIAmInListCustomersUi();
$I->seeCustomerInList($first_customer); // I stuck on this line
$I->dontSeeCustomerInList($second_customer);


At the second last line I stuck. Could you tell me anyone how to solve it?

Thanks in advance.
0

#2 User is offline   michaeldev 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 19-April 15

Posted 19 April 2015 - 02:41 AM

I have the same error.
Has anybody deal with it?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users