Note that there are some explanatory texts on larger screens.

plurals
  1. PORun multiple specs using jasmine and jstestdriver
    primarykey
    data
    text
    <p>I have written multiple spec files for unit testing various modules on the webpage. If i run them individually, one at a time they work fine. But when i try to run all the files in a sequence, only the first file in the spec folder works while all other tests fail. Any help would be appreciated.</p> <p>Every spec file loads a static page using requirejs and renders them on the page. Once the page is rendered i check whether the title, text etc is proper or not. The spec files looks like this. AboutSpec.js--></p> <pre><code>require(["views/About", "nls/messages"], function (About, messages) { beforeEach(function(){ var temp = new About(); temp.render(); }); describe("Test for About Page", function () { it("Check For About Title", function () { var aboutTitleText = $('.eight.columns h2').text(); expect(aboutTitleText).toEqual(messages["about_title"]); }); }); }); </code></pre> <p>FooterSpec.js--></p> <pre><code>require(["views/Footer", "nls/messages"], function (Footer, messages) { beforeEach(function(){ var temp = new Footer(); temp.render(); }); describe("Test for Footer Page", function () { it("Check For Footer Content", function () { var footerText = $('.five.columns h2').text(); expect(footerText).toEqual(messages["footer_content"]); }); }); }); </code></pre> <p>jstestDriver.conf--></p> <pre><code> load: - jasmine/lib/jasmine-1.3.1/jasmine.js - jasmine/lib/adapter/JasmineAdapter.js - js-src/javaScript/require.js - js-src/javaScript/default.js test: - js-test/AboutSpec.js - js-test/FooterSpec.js </code></pre> <p>When i run this setup, the About page does not render. Only the Footer page renders due to which all the test cases of about page fails.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload