angular / protractor

E2E test framework for Angular apps
http://www.protractortest.org
MIT License
8.75k stars 2.31k forks source link

Error: config.framework (jasmine2) is not a valid framework. #4957

Open meetbaluyogi opened 6 years ago

meetbaluyogi commented 6 years ago

Please help me to get rid of this error.

C:\Users\Bala\Automation_Commusoft>npm test

test_framework@0.0.1 pretest C:\Users\Bala\Automation_Commusoft webdriver-manager update selenium standalone is up to date. chromedriver is up to date. test_framework@0.0.1 test C:\Users\Bala\Automation_Commusoft protractor config.js (node) util.puts is deprecated. Use console.log instead. Starting selenium standalone server... Selenium standalone server started at http://192.168.50.220:61124/wd/hub [launcher] Error: config.framework (jasmine2) is not a valid framework. npm ERR! Test failed. See above for more details.

This is my config.js file

var HtmlReporter = require('protractor-html-screenshot-reporter'); var PropertiesReader = require('properties-reader'); var path = require('path'); var Jasmine2HtmlReporter = require('protractor-jasmine2-html-reporter'); var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter'); exports.config= { ignoreSynchronization: true, framework: 'jasmine2', baseUrl: "https://app.commusoft.co.uk",

specs: ['testcases/searchcustomer.js','testcases/testjob.js','testcases/testjobaddnewpt.js'],
allScriptsTimeout: 2000000,
getPageTimeout: 3000000,
capabilities: {

    browserName: 'chrome',

// browserName: 'firefox',

// firefoxPath: 'C:/Program Files(x89)/Mozilla Firefox/firefox.exe', 'binary': 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', directConnect: true, // 'binary': 'C:/Program Files (x86)/Mozilla Firefox/firefox.exe', 'chromeOptions': { // Prevent warning about dev tools, which breaks some tests, in Windows at least. 'args': ['--disable-extensions','--start-maximized'] }

},
/*params:{
 username: 'raje',
 password: 'raje123',
 },*/
jasmineNodeOpts: {
    isVerbose: true,
    showColors: true,
    defaultTimeoutInterval: 500000000
},
onPrepare: function() {
    //Driver.Manage().Window.Maximize();
   // browser.driver.manage().window().maximize();
    //browser.driver.manage().window().setSize(1920, 1080);
    //Adding Jasmine Html reporter
    jasmine.getEnv().addReporter(new Jasmine2HtmlReporter({
        takeScreenshots: true,
        takeScreenshotsOnlyOnFailures: true,
        savePath: 'reports/',
        filePrefix: 'index'
    }));
    // add jasmine spec reporter
    var SpecReporter = require('jasmine-spec-reporter');
    jasmine.getEnv().addReporter(new SpecReporter({
        displayStacktrace: true
    }));
    return browser.get("https://app.commusoft.co.uk");

} };

Package.js

{ "name": "test_framework", "description": "QE Test Framework", "homepage": "http://demo7.star-systems.in/", "author": "Star System", "dependencies": { "check-node-version": "^2.1.0", "latest-version": "^2.0.0", "ngUpload": "^0.5.20", "node-svn-ultimate": "^0.1.2", "package-script": "0.0.8", "properties-reader": "0.0.10", "protractor": "4.0.3", "protractor-html-screenshot-reporter": "0.0.19", "xlsjs": "0.7.5", "xlsx": "0.8.0" }, "scripts": { "install": "node installer.js", "pretest": "webdriver-manager update", "test": "protractor config.js" }, "version": "0.0.1", "devDependencies": { "jasmine-spec-reporter": "^2.4.0", "protractor-jasmine2-html-reporter": "0.0.5", "protractor-jasmine2-screenshot-reporter": "^0.1.6" } }

raj8github commented 6 years ago

@meetbaluyogi can you try with framework as jasmine instead of jasmine2 in yout config file

meetbaluyogi commented 6 years ago

@raj8github No doesnt works.

Error: Cannot find module 'protractor-jasmine-html-reporter' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (C:\Users\Bala\Automation_Commusoft\config.js:4:27) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) npm ERR! Test failed. See above for more details.