Unit testing SuiteScripts and NetSuite Workflows in NetSuite [closed] - unit-testing

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I was looking for the options on how to unit test NetSuite SuiteScripts and workflows? Is there any framework for that??

I have used mochajs and chaijs for writing unit tests in NetSuite.
The library needs to be modified a bit as there are some async APIs which won't run in NetSuite.
I have pushed my code on github
You can take a look.
To test a workflow (assuming it runs after a record update/create), you can create/update the record in your unit tests and then write your expectations/assertions after create/update statements

You can unit test your javascript with a js testing framework like QUnit: qunitjs.com
While it wont mock nlapi calls, the rest of your javascript, if structured properly, can be tested with QUnit.
We use this for testing our javascript Netsuite modules.

I dont think anything for unit testing is there in NetSuite.
You can use the debugger to check the RESTlets, Suitelets, UserEvents , Portlets.
For Workflow, you need run it where condition is met and the workflow runs as expected

Yes, Nitish is right. Net suite doesn't have any unit testing functionality like other frameworks do. You can either use the netsuite debugger or manually you have to check the execution log in order to get the stack trace.
you can use log method
nlapiLogExecution(type,title,detail) for tracing . But I prefer netsuite Debugger.

Related

How to automatically detect bugs in a web application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a web application in Vaadin. It has got some forms, search fields, buttons, etc and supported by a SQL database. I have been using Selenium, Sahi Open Source and some other tools for automated GUI testing.
Problem is: With recording GUI actions for automated testing isn't really useful because it seems more manual work than automated because I need to record the tests manually anyway.
Question is: Is there any better way to test a Web Application? How do you test your web application? Is there any free tool which automatically detects bugs in my web application?
This won't be possible unless someone will invent sentient AI and even that might not be enough. In our company we have separate QA department (they're intelligent human beings) and they keep asking questions like "how we're supposed to test this flow" and "is this the expected response".
Without test that is aware of the business flow that you're limited to what bots do - randomly crawl trough site and try to get "500 page" and that is not enough. If you're tired of writing tests you can:
Use static code analysis tool (like jshint) to check if your code is written in "best practices" way
Use your users as testers (have streamlined release process, and mechanism of reporting error so you can address production bug as quickly as possible)
Hire someone to write the test for you
There are lots of ways to test software. None of them are fully automatic; they all require that actual behavior be compared against expected behavior, and expected behavior cannot be automatically inferred by a machine but must instead be prescribed and defined by humans, and then translated to a language that a machine can understand and use to determine whether it matches the actual behavior.
Here is a starting point to start reading about other ways to test your software:
https://en.wikipedia.org/wiki/Software_testing

AngularJS Test Example [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I don't know why but I'm finding it really difficult to get my head around setting up a JavaScript test using AngularJS.
I have my app.js, controller.js plus a number of other files for Ajax, Storage services, filters etc. My app works fine but I want to learn how to do E2E and unit testing.
I think I need to create a standalone HTML page that runs my tests, but I'm not sure, I'm also not sure which extra JavaScript files/libraries I might need.
Is there an AngularJS test example I could use to get the initial set-up?
Ideally I'd like to run the JS tests I create from within Visual Studio 2012...but that's a nice to have!
I find this tutorial a good start.
http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-testacular.html
It not only teaches how to do unit testing but also E2E and a special one ...Midway testing. A good reference IMHO.
I recomend you to look at angular-seed project.
It has e2e test already setup.
https://github.com/angular/angular-seed
AngularJS dev guide has a complete page on the subject:
http://docs.angularjs.org/guide/unit-testing
There is also a blog post mentioning a sample app in github including Testacular tests here:
http://blog.angularjs.org/2012/11/angularjs-example-applications.html
Hope it helps.
Angular Test Patterns is worth looking into as well. There are examples in both CoffeeScript and JavaScript for testing Controllers, Services, Directives and Filters. As well as ideas on how to use Mocks, End-to-End tests etc.

Custom report for SpecFlow [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
We're using Specflow with NUnit for our executable specifications. We're very impressed by specflow and the nice VS integration. We've also setup our build server (TeamCity) to run the specs and generate a "test execution report".
However, we're not so impressed by the report generated by specflow. There's an option to specify a custom xslt for the report generator, but we're not that fluent in xslt...
So my question is; Has anyone made any custom reports for the specflow report generator that they want to share here?
I suggest that you check out the Pickles project that creates a very nice documentation in a format of your choice (HTML, PDF, Word and other is supported).
It can be used via MsBuild, Powershell and via the commandline. And you'll get it easily from NuGet
This post of mine may help you create your own customized report as I have created a sample one here
http://softwarecookie.wordpress.com/2014/06/26/specflow-test-execution-report-enhancement/
Hope that helps

Recommended example applications written in Ember.js [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
Which recent, public, medium-sized Ember.js applications do you recommend for learning about usage patterns by reading its implementations?
I'd recommend the Travis CI project - it uses Ember on the client side and Rail 3 on the server. While it doesn't use the latest Ember features it has very good foundations. You'll find the client-side code in a separate repo travis-web.
I also found reading through #ebryn's "New Twitter" helpful although it is older (Sproutcore 2) and smaller/simpler than Travis CI.
Update: Ember has gone through a number of big changes leading up to their 1.0 release so a lot of older example apps use deprecated APIs and are no longer representative of best practices. A new example to check out is Discourse (https://github.com/discourse/discourse) a large webapp built by Jeff Atwood and Robin Ward. Also, check out #trek's Ember Todos, a version of TodoMVC with a touch more process (https://github.com/trek/ember-todos-with-build-tools-tests-and-other-modern-conveniences)
I recommend the ToDoMVC project, which offers the same Todo application implemented using MV* concepts in most of the popular JavaScript MV* frameworks of today. Now ToDO MVC ember.js example adapts ember.js 1.0.rc1.
The website: http://todomvc.com/
The source: https://github.com/addyosmani/todomvc
Emberwatch has an Open Source Category with a list of interesting projects.
I recommend the http://www.embercasts.com/episodes/client-side-authentication-part-1 great to start with authentication.
And also it from smashing magazine http://coding.smashingmagazine.com/2013/11/07/an-in-depth-introduction-to-ember-js/
a good exercise is to put those apps to work in http://iamstef.net/ember-app-kit/ that has the current releases

Should I Separate My Unit Tests and Integration Tests Into Separate Projects [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
I'm currently working on a project and have noticed a colleague has started adding integration tests into unit test files. I'm considering taking them out, and putting them in a new project. Is this a good idea?
Depends on your test framework and continuous integration environment and whether you want to execute your integration tests with your unit tests.
Test frameworks like MbUnit, NUnit and MSTest support the concept of tagging tests with categories, meaning you could indiciate which tests were integration tests by marking them with their own category, ie "Integration". Categories make it possible to keep both sets of tests in the same project but use configuration settings to control which set of tests are run on the build server.
Personally, I like to split them out into separate projects only when necessary. For example, I might split then into their own project if the integration tests required their own special project dependencies or if I wanted to simplify the configuration of the build server such that integration tests are only run periodically.
Depends on the scope of a "project". The integration tests for the components of a single project should be within the project. The tests testing the integration of multiple projects with each other should be a separate project.
It is my opinion that int tests and unit tests should be separate files. You don't know when a class in your SUT will be swapped out. Separate unit tests reduce the refactoring needed.