Skip to content
Extraits de code Groupes Projets
Theme_spec.js 1,19 ko
Newer Older
  • Learn to ignore specific revisions
  • /*!
     * Piwik - free/libre analytics platform
     *
     * Tests that theming works.
     *
     * @link http://piwik.org
     * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
     */
    
    describe("Theme", function () {
    
    mattab's avatar
    mattab a validé
        this.retries(2);
    
    
        this.timeout(0);
    
    
        function clearAssets() {
            fs.removeTree(path.join(PIWIK_INCLUDE_PATH, 'tmp', 'assets'));
        }
    
    
        before(function () {
            testEnvironment.pluginsToLoad = ['ExampleTheme'];
    
    Matthieu Napoli's avatar
    Matthieu Napoli a validé
    
            // Enable development mode to be able to see the UI demo page
    
            testEnvironment.overrideConfig('Development', 'enabled', true);
    
            testEnvironment.save();
    
        });
    
        it("should use the current theme", function (done) {
    
            expect.screenshot("home").to.be.capture(function (page) {
    
                page.load("?module=CoreHome&action=index&idSite=1&period=year&date=2012-08-09");
    
            }, done);
        });
    
    
        it("should theme the UI demo page", function (done) {
    
            expect.screenshot("demo").to.be.similar(0.002).to.be.capture(function (page) {
    
                page.load("?module=Morpheus&action=demo");
            }, done);
        });