Git Product home page Git Product logo

Comments (21)

pjackson28 avatar pjackson28 commented on May 29, 2024

Automated browser testing would certainly be helpful. How much effort does it take to set up and author tests? Would you be interested in setting it up for us?

from wet-boew.

sylus avatar sylus commented on May 29, 2024

Yeah big +1 for this!

from wet-boew.

nschonni avatar nschonni commented on May 29, 2024

Creating testing with the IDE is fairly quick and straightforward, but my experience is more in using the .Net flavour through pure code. For this project I think using the IDE/Selenese test might be preferable rather than introduce a new language constraint. There is also the option of exporting tests created in the IDE to Java, Ruby, C#, php, python, or perl which would give others a good starting point for testing any custom work they do.

I'll try to commit some time this weekend for tests around those Mega Menu issues as a starting sample.

from wet-boew.

mgifford avatar mgifford commented on May 29, 2024

Although it can be more powerful if you're doing it from the command line & tying it into Simpletest or even PHPUnit like:
http://codebaboon.com/economist-testing-drupal-using-selenium

Ultimately, you can get anyone to record behaviors using their web browser using the Firefox plugin and then save this as a test or a test suite. There are lots of other options too. This can then be easily shared & opened by the plugin. No server side tools are required.

I've got one listed here:
http://pastebin.com/B4iaLzpf

This isn't the dominant way to do unit testing in Drupal, but it's fast and easy & there's documentation for it here:
http://nodeone.se/sv/node/726

Let's start generating a few basic unit tests & sharing them here.

from wet-boew.

mgifford avatar mgifford commented on May 29, 2024

adding link to related issue in Drupal Variant
wet-boew/wet-boew-drupal#44

from wet-boew.

sylus avatar sylus commented on May 29, 2024

I have taken a look at this and while Selenium is great I think we should probably use PhantomJS + CasperJS. Take a look at what casperjs offers here: http://casperjs.org/

Quite simply amazing!

from wet-boew.

mgifford avatar mgifford commented on May 29, 2024

The one thing Selenium offers that CasperJS doesn't is a simple UI for creating the tests using a simple Firefox plugin. There are a bunch of competing ways to programatically write tests, but like wiki markup, there's a whole new structure to learn for each one. Selenium can get folks started without having to learn the proper format for writing a test.

from wet-boew.

sylus avatar sylus commented on May 29, 2024

Yeah I agree with Selenium offering an easy program but casperjs is written in JS which I know the wet-boew folks would appreciate and the fact that it has css3 jquery selectors makes writing the code fairly easy. It also looks looks like this is what phase 2 is using.

https://docs.google.com/presentation/d/1IfPKMatoOF9nstMKrh8YuS0NC2Ozw04eqlpEOjceFD4/edit#slide=id.p
http://www.nyccamp.org/sessions/testing-your-drupal-site-friendly-ghosts
http://www.lullabot.com/events/events/2012-06-22-eric-duran-and-brock-boland-presenting-drupaldelphia

Additionally there is a working example to get this done in drupal which I am finishing up right now.

from wet-boew.

nschonni avatar nschonni commented on May 29, 2024

The reason I suggested Selenium is for the ability to test multiple browsers (not just WebKit based browsers), as WET has seen a few interesting issues with IE. The Selenium tests are intended for the integration phase, and not the unit tests where something like Jasmine, QUnit, etc... would be a better fit.

from wet-boew.

sylus avatar sylus commented on May 29, 2024

Yeah I think it is fair to have Selenium in for the integration phase and test all of that stuff but for simple one off unit tests I nominate for casperjs + junit. I actually got basic tests running with casperjs with relative ease. I'll live the selenium stuff to @nschonni as has a handle on it :)

from wet-boew.

sylus avatar sylus commented on May 29, 2024

Good news @mgifford I got Selenium working as well with Travis doing a basic login :) The script I got working runs a testsuite with itself can have many test cases. Runs using xvfb + firefox but apparently ie + chrome are easy drivers to add.

from wet-boew.

mgifford avatar mgifford commented on May 29, 2024

That's great. You're adding those tests to your sandbox on git?

from wet-boew.

sylus avatar sylus commented on May 29, 2024

Yeah on one of my demo ones I have the tests running but for some reason still can't login as the tests return a 302 so still some things to figure out ^_^

from wet-boew.

sylus avatar sylus commented on May 29, 2024

All fixed up and added to main wet-boew-drupal. I have both Selenium + CasperJS working.

Selenium: currently tests by logging in as administrator and logging out
CasperJS: checks that there are three headlines on the front page

Not that the base is done can do a lot of crazy things with both of these libraries!

from wet-boew.

pjackson28 avatar pjackson28 commented on May 29, 2024

Any progress on this for WET core? Should this remain open?

from wet-boew.

pjackson28 avatar pjackson28 commented on May 29, 2024

What's the status of using Selenium for testing? Do we still need to look into it or are existing testing methods sufficient?

from wet-boew.

mgifford avatar mgifford commented on May 29, 2024

We're making some progress on it. It's definitely still needed. Will contribute back when we can.

from wet-boew.

masterbee avatar masterbee commented on May 29, 2024

@mgifford et al. We are pushing forward with saucelabs as our first kick at the can with testing. I will close this thread, but feel free open another issue when you are get your findings back

from wet-boew.

nschonni avatar nschonni commented on May 29, 2024

PS: SauceLabs is Selenium testing 😄

from wet-boew.

masterbee avatar masterbee commented on May 29, 2024

@nschonni - ok I deserve a whack on the noggin for that "Doooh"! 👍 Thanks.

from wet-boew.

nschonni avatar nschonni commented on May 29, 2024

Well, it uses Selenium, but you're right that it isn't the same type of Selenium testing we were talking about at the beginning of the thread 😄

from wet-boew.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.