It works!. Both Karma and Protractor. Pythonanywhere team is the best!
For Protractor is very similar.
npm install protractor
xvfb-run node_modules/protractor/bin/protractor --version
xvfb-run node_modules/protractor/bin/webdriver-manager update
Follow the instructions on Protractor web site for
1-write a test( todo-spec.js )
2-configuration( conf.js ) *Here I had to make changes.
exports.config = {
//seleniumAddress: 'http://localhost:4444/wd/hub',
directConnect: true,
// Boolean. If true, Protractor will connect directly to the browser Drivers
// at the locations specified by chromeDriver and firefoxPath. Only Chrome
// and Firefox are supported for direct connect.
firefoxPath: null,
// Path to the firefox application binary. If null, will attempt to find
// firefox in the default locations.
specs: [
//'todo-spec.js'
'path/to/my/tests/todo-spec.js'
],
capabilities: {
browserName: 'firefox'
}
};
Then :
xvfb-run node_modules/protractor/bin/protractor conf.js
After the tests are run, still get an error from webdriver. But test are definitely working and getting correct results on basic tests like
expect(element(by.model('mymodel')).getText()).toEqual('It works!');