Yii Framework Forum: Testing the application with functional tests - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Testing the application with functional tests Chapter 5, Page 140

#1 User is offline   yasen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 29-October 11
  • Location:Sofia, Bulgaria

Posted 17 January 2012 - 02:16 AM

I've ran into the following error when doing the function test on Chapter 5, Page 140
PHPUnit 3.6.3 by Sebastian Bergmann.

Configuration read from ***

F.

Time: 01:02, Memory: 5.75Mb

There was 1 failure:

1) CheckAllWidgetTest::testWidget
Current URL: OR Server Exception: sessionId led to start new browser session: java.lang.RuntimeException: SystemRoot apparently not set! doesn't exist; perhaps this session was already stopped?

Failed asserting that two strings are equal.--- Expected
+++ Actual
@@ @@
-'Check all'
+'OR Server Exception: sessionId led to start new browser session: java.lang.RuntimeException: SystemRoot apparently not set! doesn't exist; perhaps this session was already stopped?'

--- Expected
+++ Actual
@@ @@
-'Check all'
+'OR Server Exception: sessionId led to start new browser session: java.lang.RuntimeException: SystemRoot apparently not set! doesn't exist; perhaps this session was already stopped?'


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

Running Fedora 16 so don't have Internet Explorer (not sure if this matters). The reply of this Yii forum post did help: Error in running functional test

Quote

I added below line to WebTestCase setUp() and it runs without Exception now.

$this->setBrowser('*firefox');



Edit: on a side note, at page 138, the lazy coders may replace
<?php echo CHtml::checkBox('test1', true)?>
<?php echo CHtml::checkBox('test2', false)?>
<?php echo CHtml::checkBox('test3', true)?>
<?php echo CHtml::checkBox('test4', false)?>
<?php echo CHtml::checkBox('test5', true)?>
<?php echo CHtml::checkBox('test6', true)?>

with
for($i = 0; $i < 6; $i++)
  echo CHtml::checkBox('test' . $i, $i % 2 == 0);

0

#2 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,333
  • Joined: 17-January 09
  • Location:Russia

Posted 21 January 2012 - 02:46 PM

The error is about correct selenium configuration. In your case you've configured it in runtime. You can use XML config that's under test directory of your application as well.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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