[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] Re: [PATCH] vm creation / start / stop tests via selenium

David Lutterkort wrote:
On Tue, 2008-08-26 at 17:25 -0400, Mohammed Morsi wrote:
 autobuild.sh                              |    5 +-
 wui/src/test/fixtures/cpus.yml            |   68 ++++++++++++++++----
 wui/src/test/fixtures/hosts.yml           |   10 +++
 wui/src/test/fixtures/nics.yml            |   13 +++-
 wui/src/test/fixtures/quotas.yml          |    8 +-
 wui/src/test/fixtures/storage_pools.yml   |    9 +++
 wui/src/test/functional/interface_test.rb |   98 +++++++++++++++++++++++++++-
 wui/src/test/unit/cpu_test.rb             |    2 +
 8 files changed, 189 insertions(+), 24 deletions(-)

ACK. Some small nits:

diff --git a/autobuild.sh b/autobuild.sh
index 6c95cb1..95395d0 100755
--- a/autobuild.sh
+++ b/autobuild.sh
@@ -80,7 +80,10 @@ fi
 echo "Running the wui tests"
 $ssh_cmd \
   "sed -i \"s/#RAILS_ENV=production/RAILS_ENV=test/g\" /etc/sysconfig/ovirt-rails && \
-   service ovirt-mongrel-rails restart && service httpd restart && \
+   sed -i \"s/development/test/\" /usr/share/ovirt-wui/dutils/active_record_env.rb && \

Why is it necessary to patch active_record_env.rb ? Shouldn't it be
enough to set the RAILS_ENV environment variable ?
Just sent a follow up patch addressing this issue.

diff --git a/wui/src/test/functional/interface_test.rb b/wui/src/test/functional/interface_test.rb
index 6563b44..eadeb74 100644
--- a/wui/src/test/functional/interface_test.rb
+++ b/wui/src/test/functional/interface_test.rb

+        # click the button
+        @browser.click "//form[ id='vm_form']/div[2]/div[2]/div[2]/a"

Ultimately, we should fix up the templates/views so that the tests can
reference the elements they are really interested in by their id,
instead of depending on the exact structure of the HTML ... that will
become rather painful to maintain.

If it works now, that's fine, but as soon as it breaks, the fix should
be to annotate the generated HTML, rather than adapt the tests all the
Agreed, hopefully these tests will bring light to the fact that we should set the id attribute on more elements. This probably can be done as we go along from here on out, when writing a test for some components, make sure those have ids.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]