asnov / jasmine-testrail-reporter Goto Github PK
View Code? Open in Web Editor NEWReports Jasmine test results to TestRail
License: MIT License
Reports Jasmine test results to TestRail
License: MIT License
Could you please improve the read,me file so as it's easier to get started?
It would be nice to have some example of setup for basic scenario:
1- Setup ENV variables
2- How to write the Spec file to match Test Cases on TestRail and test run
Any other changes which are necessary.
Could provide an example of a working protractor.conf.ts?
here the spec
fit('(196:) should get alert on invalid password submission (<6 chars)', async function () { const oldFormat = await userSettings.selectedTimeFormat() await userSettings.switchTimeFormat() const newFormat = await userSettings.selectedTimeFormat() await expect(oldFormat).not.toEqual(newFormat) })
here the protractor.config.ts
`import { Config, browser } from 'protractor'
import TestRailReporter from 'jasmine-testrail-reporter';
import matchers = require('jasmine-protractor-matchers')
const trReporter = new TestRailReporter({ // all parameters are setup in the code
username: 'username', // security warning: attention when commit to repository !
email: ''email, // security warning: attention when commit to repository !
password: ' iW3FqXXYKdD.RkYrwvF3-HTnQCp31OwF3UoGncNUQ', // security warning: attention when commit to repository !
projectId: 3,
suiteId: 3,
runId: 3,
});
`
`export const config = {
directConnect: true,
capabilities: {
browserName: 'chrome',
chromeOptions: {
//args: [ "--headless", "--disable-gpu", "--window-size=1280x1024" ]
}
},
specs: [
'../specs/**/*.spec.js',
'../specs/*.spec.js'
],
baseUrl: ' https://dev.sendit.gl',
onPrepare: () => {
// Adding nice console output.
// Provided by: https://github.com/razvanz/jasmine2-reporter
let ConsoleReporter = require('jasmine2-reporter').Jasmine2Reporter
let console_reporter_options = {
startingSpec: true
}
jasmine.getEnv().addReporter(new ConsoleReporter(console_reporter_options))
// Adding reporting that is applicable for Jenkins or other CI tool
// Provided by: https://github.com/larrymyers/jasmine-reporters
let JUnitXmlReporter = require('jasmine-reporters').JUnitXmlReporter
let junit_reporter_options = {
savePath: '../test_results/',
consolidateAll: true
}
jasmine.getEnv().addReporter(new JUnitXmlReporter(junit_reporter_options))
jasmine.getEnv().addReporter(trReporter);
},
beforeEach: () => {
jasmine.addMatchers(matchers);
},
afterEach: () => {
//Clearing browser data after each test
browser.manage().deleteAllCookies();
browser.executeScript('window.sessionStorage.clear(); window.localStorage.clear();')
},
onComplete: function() {
return trReporter.publishResults()
.then(results => { console.log('complete'); })
.catch(err => { console.log(err.message); });
},
} `
running npm tsc returns this error:
`npm run tsc
npm ERR! path C:\Users\simon\Desktop\Sendit - Automation\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\simon\Desktop\Sendit - Automation\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\simon\AppData\Roaming\npm-cache_logs\2017-12-04T21_47_32_396Z-debug.log`
I am trying to update test cases in test rails using the jasmine-test-rails-reporter api.
Here is my config :
let TestRailReporter = require('jasmine-testrail-reporter').default;
let trReporter = new TestRailReporter({
domain: 'https://xxx.testrail.com/',
email: '[email protected]',
password: 'xxx',
projectId: xx,
suiteId: xx
// runId: 30,
});
My test spec looks some thing like :
it('C215 should xxxxxxx', async function()
C215 is the test case ID from test rails.
But the test case is not getting updated in test rails with pass or fail status. Am i missing some thing here ?
Appreciate your response.
Thanks
According to the article found here:
http://docs.gurock.com/testrail-api2/accessing#username_and_api_key
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.