15 March 2011

Debug Mode

My friend and fellow teammate - Trung - has been spending time with me to help me understand how to debug failing tests and code.

He showed me how to put break points in Eclipse and then to run the test in debug mode. When it hits the breakpoint, the test can move line by line of the code - by hitting F6. F8, will run through the rest of it without break/stopping.

This has helped me zoom in closer to problems I was reporting. Such as a variable not being set before the page continues.

03 March 2011

First Acceptance Test!

Pretty excited. I put together my first acceptance test today.

One problem we're running into is the lack of ID's on elements. We don't want to use x Paths to find elements on the page. So when I created this, I hit this problem... my dev's Trung and Victor were able to add ID's for me and I put together a communication test!

I login as a matched user, select a match, pull up their details and send an icebreaker. It's pretty cool!

So in case I've been remiss in describing these acceptance tests... The goal is this:
Each time a developer commits code, a build goes out and all the acceptance tests are run in a Continuous Integration environment.

These tests call a browser, and run through the automation of the browser to test the code. The more tests we have, the better and faster we'll catch a problem introduced through a commit.

How we automate this is in a Groovy/ Spock framework.

We have pages and tests. under the pages, we have each page being it's own Groovy Class. Then the tests themselves call each page, as an objects. This page object methodology makes it easier to understand whats going on, create tests and see where the failures are occurring.

For example:
If I wanted a test that would
Go to a Login page
Send valid login credentials
Get to a welcome page on the other side
Verify I'm at the welcome page
Logout
Verify I'm back at the login page

We set it up by making the page objects:
Loginpage.groovy
Welcomepage.groovy

The test:
logintest.groovy
would call the loginpage class.

Like
loginpage(username, password)
.logout()

28 February 2011

HTMLUnit

Victor and I set up forking logic to support HTMLUnit and FF. That way we'll have the ability to call a headless client test or a Firefox browser in the acceptance test run.

26 February 2011

setup: properties files.

We're now using a properties file to define which db we are running acceptance tests against. Since we have several QA environments, we need to be able to call these different login scripts to each db.

This is pretty cool. Victor showed me how to set up the properties file to support our different environments

25 February 2011

I work with some really cool Dev's... so on my Pilot team, they took the time out to help me with my Eclipse env issues from this weekend.

The DB errors were only specific to one specific test. My other tests were good (db connection wise) so i was on the right track. that feels good.

My acceptance tests weren't running because I was not extending them correctly! Victor, the dev I'm working with, showed me that I need to set up the Acceptance Tests and extend them correctly to the right class. This resolved the JUit issue - now I see "run as JUnit" avail for my tests.

24 February 2011

Eclipse... grr....

This was a hair pulling weekend.

I got pretty pissed off with Eclipse. it somewhat balanced with my initial Java application success in the last post. Now I'm frustrated as I can't run any of the damn acceptance tests!

It's an eclipse environment problem. Eclipse is complaining it can't communicate with the database. I'm also not getting the JUnit option when running the classes i've made... grr.

23 February 2011

My First Working App in JAVA!

OK - This weekend I got Eclipse set up. I've been working the past couple weeks in picking up Java. I found I couldn't really find resources to teach Groovy without first learning Java. Most Groovy resources are written to Java dev's. So I started with Java. I've been learning the JAVA basics so I can now pick up Groovy.

Backwards, I know, but I don't know how else to attempt this!

I've successfully written a few small applications in Java. I wrote a small application that uses selenium libraries to go to Google and pass a search term, then pull the results and report them back in Eclipse/IDE.

That was cool. My first working app in Java.