qunit

“Can't verify CSRF token authenticity” when testing emberjs/rails/devise app using qunit

 ̄綄美尐妖づ 提交于 2019-12-12 16:49:46
问题 I have a emberjs/rails application using devise for user authentication. I am building integration tests using qunit. I manually log into the app before I run tests. GET requests can be processed during tests, but POST requests fail. In particular, when making a POST request, I'm getting a "Can't verify CSRF token authenticity" error from devise. When I reload tests, I am logged out of app. How do I get qunit to play nice with devise? 回答1: You need to add csrf_meta_tags to the index.html.erb

How to add project and create jobs in TestSwarm

£可爱£侵袭症+ 提交于 2019-12-12 09:07:22
问题 I am trying setting up TestSwarm, but not able to create project and jobs. When cloning TestSwarm from github some files are missing like /run etc. Please suggest your thoughts! 回答1: You create a project using php scripts/manageProject.php --create=true --id="yourtestid" --display-title="your display title here" This script creates a project and requires an id and a display title, and also has optional options for site-url and password. The create flag tells the script to create the project

Running QUnit tests with Jenkins and Apache Ant?

偶尔善良 提交于 2019-12-12 07:08:37
问题 Is it possible to execute my QUnit (javascript) unit tests from Jenkins? My build script is Apache Ant. Would Jenkins execute this as a separate Build Step, or would I need to add something in the config of my Ant build script? 回答1: So, I have finally managed to figure this out. Here's my end-to-end implementation: Install PhantomJS (http://phantomjs.org/) - I installed this in my build/tools folder Install the PhantomJS QUnit Runner script (https://gist.github.com/1588423) - also installed

QUnit/Sinon: testing a function which checks if cookies are enabled

蹲街弑〆低调 提交于 2019-12-12 02:07:28
问题 I have the following (simplified) javascript module which uses jQuery Cookie plugin to check if cookies are enabled. If cookies are disabled it warns the user: var cookiePolicy = (function () { var cookiesEnabled = function () { return $.cookie('check', 'valid', { expires: 1 }) && $.cookie('check') == 'valid'; }; return { updateCookiePolicy: function () { if (!cookiesEnabled()) { $("#cookie-policy").append('<p id="cookie-warning">Cookies are disabled. Some features of this site may not work

'qunit' is not recognised as an internal or external command, operable program or batch file

南楼画角 提交于 2019-12-12 01:29:17
问题 I installed qunit, using command: npm install -g qunit Then, I wrote a test program and named the file as firstTest.js. The contents of firstTest.js is: module.exports = { 'should run test': function(t) { t.printf("running test!\n"); t.done(); }, }; On executing command: qunit firstTest.js I got 'qunit' is not recognised as an internal or external command, operable program or batch file. What should I do ? 回答1: Okay, so first off, that is not how you write a QUnit test. You can read the

how to integrate qunits with jenkins

爱⌒轻易说出口 提交于 2019-12-11 22:43:57
问题 we are using Qunits to write testcases,Test cases are getting passed,we are using Jenkins for continuous integration.can any one please let us know how to inegrate qunits with jenkins .so that Jenkins picks up tests and runs the testcases result.xml format 来源: https://stackoverflow.com/questions/23214983/how-to-integrate-qunits-with-jenkins

ReferenceError: CoffeeScript + JsTestDriver + Qunit

谁说胖子不能爱 提交于 2019-12-11 13:22:59
问题 Currently I'm looking into TDD with CoffeeScript and JsTestDriver however I'm stuck on a ReferenceError thrown by JsTestDriver. Some info: Using the IntelliJ JsTestDriver plugin Testing via Chrome Configured JsTestDriver the same way as on: http://code.google.com/p/js-test-driver/wiki/QUnitAdapter Writing the tests in CoffeeScript CoffeeScript is compiled to javascript and put in the configured directories before the test is run Config server: http://Mark-PC:9876/capture load: - js/lib/main/*

How can I unit test a method that results in an Action

故事扮演 提交于 2019-12-11 12:08:56
问题 In my Ember application, I have a simple form component, with the following behavior (snippet): ... let searchText = this.get('searchText') && this.get('searchText').trim().toLowerCase(); this.sendAction('searchTextChanged', searchText); ... How can I unit test this functionality in a qunit test? I'm unable to figure out how to listen for the action result . I'm using the test functionality that comes with ember-cli -- qunit, the helpers, etc. 回答1: Ember has a guide on how to do that here. I

Integrating Node.js with QUnit to Jenkins

荒凉一梦 提交于 2019-12-11 11:06:07
问题 This is my first sof post so forgive my format and organization of thought. I've made a great effort to solve my problem before posting this. Part of my issue could be lack of knowledge with packages in Ubuntu or Node.js so please guide me. I'm trying to create a XUnit xml file for Jenkins from QUnit tests for a Node.js application. I don't have the ability to run a browser or even a headless browser, also don't understand why I'd need one since the Node.js code doesn't deal with the browser.

PhantomJS, Qunit, Grunt testing browser resize widgets

廉价感情. 提交于 2019-12-11 08:25:13
问题 I've created a jQuery UI Widget that resizes a DIV/thing to fill up the browser screen. It all works fine but now I want to create unit tests for testing that it's resizing and keeping to boundaries etc. I'm using Grunt with grunt-contrib-qunit , which uses PhantomJS to do tests but am now unsure how I can test browser resizing at this point as it's not possible via JS to resize a browser. Perhaps PhantomJS provides something that allows me to alter it at runtime? 回答1: Check CasperJS library.