Agile development with Javascript [closed] - selenium

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking to adopt Agile Development for a project based on web2py on the backend and Ember on the front end. For that I would like to use Behavior Driven Development (BDD) tools like Cucumber and Capybara for Rails. An implicit requirement is that the members of the team writing the user stories should be able to write and run BDD tests without deep knowledge of the code being developed.
I think that Cucumber.js combined with Zombie.js or Selenium would be a good approach but then there are Jasmine and Mocha. Both claim to enable BDD testing for JavaScript but I have the feeling that they are more suited to Unit Testing rather than to testing web applications by simulating how a real user would interact with the application.
Can anyone who has tried BDD with Cucumber.js, Jasmine or Mocha share their point of view as to which one would be the better choice for BDD with javascript?
Also, are there any other alternatives to consider?

For a full BDD testing Stack you could use:
1) cucumber.js + selenium + Soda (or other adapter for node) + node.js
or
2) cucumber.js + zombie.js + node.js
Personally I would go with the second option, since cucumber.js provides you with stub javascript code after parsing your scenarios/features/step definitions written in Gherkin syntax. you can use this code and additionally setup your zombie world and provide all the necessary assertion helper functions for your test suites and you are all setup. The only advantage I see in selenium is his Webdriver capabilities (sauce labs etc.) and the record functionalities, but I think the syntax used in zombie.js to drive the tests is pretty strait forward and maybe you don't need all the functionality selenium provides you.
About mocha and jasmine, if you want Gherkin syntax then none will provide you this feature, but if you like to write all your test in a Rspec syntax style you can go with one of these instead of cucumber.js, it all depends how important the Gherkin style is to you.

Related

Scripting engine for OS X application [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am going to develop an application for OS X and I need some scripting engine for it.
The purpose of the scripts is to receive a text on their input (HTML file in most cases), parse it in some way and return the data to my app. These scripts should be easily editable by the users, therefore they should have some common used syntax like C or pascal.
Can you suggest some lightweight solution for this?
Thanks!
PS. I am new to OS X development, trying to switch from Windows...
Two suggestions:
Javascript, try the V8 engine. http://code.google.com/p/v8/ Very popular, likely familiar syntax to many.
Lua. http://www.lua.org Extremely lightweight and simple to connect. If your script editors write scripts for World of Warcraft, for example, they will know Lua.
In general AppleScript/Automator actions are easy for the end user to work with since the technology includes a GUI for building scripts without much programming knowledge. For experienced developers used to other languages, they can be a bit too friendly/loose and have a somewhat different syntax (more like plain English). The good thing is that they can also call other languages as needed, so a developer familiar with Perl or whatever could incorporate that into an AppleScript or Automator action.
Since you're talking about parsing text, Perl itself would be a good solution - again there's some difference in syntax, but the scripts can be rather compact and the basics of parsing aren't too difficult to learn. I haven't personally incorporated Perl into an OS X app, I've just used it on the command line, so I don't know if there are any pitfalls to that approach.
One additional advantage to AppleScript is that you can make your application itself scriptable so that users could automate the functions of your application into a larger workflow.
I would suggest downloading the free TextWrangler application by Bare Bones Software, or a similar developer's text editor, to see how they incorporate scripting into the application. This may give you additional insight into your approach.
LUA seems to be a good choice.

UI automation with functional languages [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Does anyone have an examples or experience of writing UI automation in a functional language? I'm currently learning F# to get a better understanding of functional concepts and I'm having difficulty working out how an automated UI test would be structured in a functional language - seems easy to use the same page/screen object patterns I would in Java or C#, but given lack of experience I'm curious if there's a different approach I've missed.
Your biggest win with using a functional language will come from not having to use classes at all, but being able to when they are the right answer. Also, F# allows for a nice clean 'dsl' looking test suite because of type inference and the syntax. Common actions (example: logging in) are easily abstracted into a function and called within a test. Any function that is very specific to a page can be added to that page's module along with its defining features (css selectors etc).
Here is an example of a test written with canopy
test(fun _ ->
//description of the test
describe "registering a user"
//go to root
url "/"
//ensure that you are on the login page
on "/Account/LogOn"
//click the registration link
click "form a[href='/Account/Register']"
//verify that you were redirected
on "/Account/Register"
//set the value of the input to email address specified
"#Email" << "username#example.com"
//set the value of the input to "Password"
"#Password" << "Password"
//set the value of the input to "PasswordConfirmation"
"#PasswordConfirmation" << "Password"
//click the register button
click "input[value='register']"
//verify that you were redirected
on "/"
//log off after test
url "/account/logoff"
)
More about canopy
I've written a Web automation framework/library in F# (also one in Ruby) and thus far, while I wouldn't consider its style to be functional, it doesn't have any classes. Almost everything is a function. Your test suite is a list of functions that are run.
github page
some examples
With < 500 LoC there are only 3 modules, the main set of functions to interact with your page, a simple test runner, and some configuration variables. At this point this paradigm has worked really well for me. I don't use classes for page definitions because for me, a page definition is as simply the css selectors I use. A module with a bunch of values fulfills this need nicely.
Give it a shot, I think you will find it to be an excellent way to accomplish your goals.
Sorry first time post so it wont let me show more links. Look on github and you can see the source at /canopy/canopy/canopy.fs
You seem to answer your own question, F# supports OOP, OOP is a good fit in this case, and the distinction between imperative vs functional is separate from structure in this case.
So use classes and methods just like you would in C#, but write the unit tests themselves in a functional manner.

Good alternative to Windows batch scripts? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are some good alternatives to Windows batch scripts? We have a number of them and they are very "clunky" to work with. As our group is familiar with Java is Groovy a good option?
A lot of our scripts are used to prep dev databases so they involve a lot of cd mydir, hg fetch, sqlplus ..., etc..
If you are interested in developing scripts for Windows than a technology developed specifically for Windows, like the PowerShell, is a sensible choice.
While groovy will probably allow you achieve your goal I don't think there is a particular advantage that it could offer.
Saying that, you have to consider familiarity factor and learning curve. You say developers have experience with Java and Groovy in which case running ant tasks via the groovy DSL can prove easier than learning PowerShell.
Regardless, consider developing your scripts using the TDD approach. Groovy offers plenty of frameworks (try Spock for example) while there are also ways to achieve that for PowerShell.
Powershell, VBScript, Perl, Python. There are no shortages of good scripting languages that have a Windows implementation.
It kind of depends on what you are looking to do with your scripts. BASH on windows via cygwin might be a good thing to try.
You might also wanna look at good old Ant, it has targets for copying, executing shell commands, etc. Gradle might be even better, as it supports inline Groovy code, including easy loops and conditions, which Ant lacks.
PowerShell 2.0 onward is a good choice. It will come along with Windows Server 2008 R2 or windows 7 onward. you don't need to install anything on top of these O/S version.

Open source test report generation tool [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Background
The QA department where I work has a lot of automated blackbox tests that interact with our applications via the GUI and the command line. Currently, the automated tests output their results to standard out where we then manually enter the final pass/fail result into a spreadsheet.
We would prefer to have a system where the automated test automatically saves detailed test results to a file. We would then have a web page that the testers and developers could access to view the detailed test results and any necessary attachments. It would generate reports of the test results by project and version number.
Question:
What system would you recommend for test report generation? We need a system where our tests will automatically be inserted into new reports and that is preferably open source. I'm interested in what your company actually uses or what you have found useful in managing test results.
Our QA department is capable of building a simplified version of this system from scratch, however we would prefer not to reinvent this.
We are now using Testopia. it is integrated with Bugzilla, it is nice to have everything at the ame place. It uses the same XMLRPC API interface as Bugzilla.
reStructuredText is a very happy medium between writing to stdout and formal documentation. There are several scripts to convert from rst to other formats such as html.
You could mostly keep the system you have in place -- you'd only have to add a couple "tags" around the text, but unlike HTML tags, these are more readable characters. In fact, it's very close to the markdown you use when asking/answering here on StackOverflow.
The stdout text remains overall very readable by humans, but then it's as simple as adding one script in the chain to render to HTML or PDF for instance.
This page has a very good example of what it looks like in plain text and rendered forms.
Maven has an an extensive site mechanism, it does require you to bend to its will though, so that might rule it out for you.
Once configured you get a standard set of reports generated on each build, that can be packaged as a jar if you wish, or deployed directly to your build results site. There are plugins for many of the major reporting tools, such as Cobertura/Emma, Junit, JDepend etc.
The maven-site-plugin publishes its own sites if you want to have a look.

Load testing WCF service (hosted on IIS) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What tools are there that I can test out a WCF service?
I am expecting allot of load so I want to have an idea how much a single server can handle.
WCFLoadTest all the way. I've even talked to MS guys who swear by this tool.
Visual Studio also has some load testing tools available, but I cannot vouch for how well they do their job, nor can I say which versions of VS contain the load testing tools.
I wrote my own tool (WCFStorm). These are the features:
General:
◦Dynamically invoke and test WCF Services
◦Dynamically invoke and test Web services written in any language
◦Save your opened service and its test cases into a "project" which can be reloaded anytime
◦Dynamically invoke service methods even those containing complex data types
◦UI-based, dynamic editing of complex data types
◦Test multiple WCF and Web services within a single UI.
◦Multiple-tabbed interface
◦Basic and windows authentication
◦Test services sitting behind a proxy
◦Dynamically modify the URL endpoint of a WCF or Web service.
◦Dynamically edit the service binding.
Functional Testing:
◦Create functional test cases and save it as part of a project
◦Create and save functional test cases containing Expected results.
◦Graphically compare (side-by-side) the expected results with the actual response of a service.
Performance Testing:
◦Create performance test cases and save it as part of a project
◦Graphically display charts in real-time as the performance test progresses.
◦Configurable test parameters (# of Agents, Test duration, interval etc.). You can stress out your service as much as you want.
Check out the screenshot.
(source: geekswithblogs.net)
Start with this:
http://www.codeplex.com/WCFLoadTest
It doesn't do everything possible with WCF, but it is the best tool to start with. Worse comes to worse, it's not that hard to write manual invocation code with web services. They are much easier to load test than web sites.
The SO-Aware test workbench makes things very easy with a rich visual experience. You can build a variety of tests and scenarios and run them very quickly.
http://www.tellagostudios.com/products/so-aware-test-workbench%E2%84%A2
Try http://www.soapui.org/ there's an open source and pro version you will need to tick download loadui, which is your load test bit.