Tuesday, October 18, 2011

Geb ain't just some country hick!

Started using Geb (http://www.gebish.org/) for some simple UI automations to run via Jenkins.  Basically, login to several instances of our app every half an hour and make sure something infrastructure-wise has not taken our app down.  Only issue is something with the network (proxy config etc.) makes it run REAL slow so far...

>>>
@Grapes([
    @Grab("org.codehaus.geb:geb-core:0.6.0"),
    @Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.0rc3")
])
import geb.*
import org.openqa.selenium.firefox.FirefoxDriver

class LoginPage extends Page {
    static url = ""
   
    static content = {
        submitButton(to: MainPage) { $("input", type: "button", name: "signin") }
        usernameInput() { $("input", type: "text", name: "usernameInput") }
        passwordInput() { $("input", type: "password", name: "passwordInput") }
       
    }
}

class MainPage extends Page {
    static url = "main"
}

Browser.drive() {
    def username = config.rawConfig.username
    def password = config.rawConfig.password
    def loginTitle = config.rawConfig.loginTitle

    println "Opening login page..."
    to LoginPage
    at LoginPage
    assert $("title").text() == "Sign In"
   
    println "Setting username=$username"
    usernameInput << username
    println "Validating username..."
    assert usernameInput.value() == username
   
    println "Setting password=$password"
    passwordInput << password
    println "Validating password..."
    assert passwordInput.value() == password
   
    println "Submitting login form..."
    submitButton.click(MainPage)
    println "Waiting for main page..."
   
    at MainPage
   
    println "Checking for main title..."
    assert $("title").text() == "Main Title"
}.quit()

println "Done!"

<<<

Wednesday, October 12, 2011

If you can't beat em', join em'

I started out my little EclipsePhase RPG tracking web app using a Flex UI on top of Gaelyk services.  However, this last weekend I gave up on that and rebuilt my starting point plus some more features with Grails and HTML.

Using Grails instead of Gaelyk was an easy choice for now since I can get a free cloud deployment via CloudFoundry.  Nevermind the fact that I use Grails at my day job, I think I might generally like it better than Gaelyk.

However, the Flex vs. HTML/JavaScript thing is a little less logical.  I spent 4 years getting decent with the Flex framework which I think is a great RIA platform.  However these days with all the Flash FUD going around and the hype around HTML5, it seems highly unlikely that I will build many more Flex UIs professionally.  That's a shame but I'm growing tired of fighting it for now.

My project is a "no Flash" zone as my company's head management is convinced Steve Jobs "Flash is dead"eventhough we have several RIA front-end projects that have been success and no JavaScript/HTML ones yet to do anything significant. 

We actually pay for a JavaScript framework (ExtJs) when Adobe Flex is open source now.  Our UI constantly has browser issues.  It does very little.  In Flex it would be the equivalent of a couple data grids, a couple forms and file uploader.

I'm not digging on our UI guys, but they have alot more work to do dealing with what one guy referred to as "GarbageScript". 

I'm also not digging on JavaScript but browsers suck.  JavaScript devs that spend their time hating on Flash suck.  And eventhough I love my Mac and don't want to be insensitive, but Steve Jobs hateraid for Adobe Flash sucked also.

I'm tired and beaten, so I'm just doing HTML and GarbageScript for now.  The good thing is I am back to basically writing my UI on the server with Groovy/Grails and only slightly with HTML and JavaScript.

Thursday, October 6, 2011

Shady Illuminations

Posted to Pragmatic Bookshelf under PragPub topic...

http://forums.pragprog.com/forums/134/topics/9732

I have to admit that although I am a regular customer of The Pragmatic Bookshelf and have gleaned wisdom from many resources provided here, I have not been a regular reader of the PragPub magazine. However, with that being said, I was skimming October’s issue and saw a section labeled “Porn” that described how “Pornography… is a positive good that encourages experimentation with new media.” and “Porn is a subvirtue.”

This disappointed me a great deal. I believe that any positive pornography seems to bring to ANY industry should be immediately discounted as it promotes an escalating devaluing of the people involved and some might even say that on the extreme end it can even promote prostitution and sex trafficking. I am not here to make a case for the latter, but I think any article putting a positive spin on a industry like “porn” is not worthy of the “Pragmatic” name.

I sincerely hope Andy and Dave give this concern serious consideration.

Thanks guys for all that you have done for our industry and my career.

Todd W. Crone