reportportal / agent-js-jasmine

Agent to integrate Jasmine with ReportPortal.
https://www.npmjs.com/package/@reportportal/agent-js-jasmine
Apache License 2.0
8 stars 15 forks source link

result not getting posted on RP #50

Open vaibhavshukl12 opened 4 years ago

vaibhavshukl12 commented 4 years ago

my config.js const ReportportalAgent = require('agent-js-jasmine'); const agent = new ReportportalAgent({ token: "8736a402-8d39-46ac-99d9-**", endpoint: "http://*********.com", launch: "protractortest", project: "unified-qa", attachPicturesToLogs: false, }); exports.config = { capabilities: { 'browserName': 'chrome' }, seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['rpspec.js'], onPrepare: ()=> { jasmine.getEnv().addReporter(agent.getJasmineReporter()); }, afterLaunch:() => { return agent.getExitPromise(); } };

and my spec file

describe('second spec', function() { // Test in Jasmine it('second specopening home page', function() { browser.get('https://angular.io/') expect('true').toBe('true'); console.log('--------------------all----------') }); });

protractor log:

`D:\AutomationPOC\proptractor\protractor_rp> protractor .\config.js (node:5680) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. [00:13:07] I/launcher - Running 1 instances of WebDriver [00:13:07] I/hosted - Using the selenium server at http://localhost:4444/wd/hub Started --------------------all----------. 1 spec, 0 failures Finished in 8.947 seconds

[00:13:18] I/launcher - 0 instance(s) of WebDriver still running [00:13:18] I/launcher - chrome reportportal/reportportal#1 passed PS D:\AutomationPOC\proptractor\protractor_rp>`

vaibhavshukl12 commented 4 years ago

Hi, @DzmitryHumianiuk Hope you are doing well. Please help with this.

DzmitryHumianiuk commented 4 years ago

@AmsterGet can assist here.

vaibhavshukl12 commented 4 years ago

Hi, @AmsterGet please help with this.

vaibhavshukl12 commented 4 years ago

Hi, @AmsterGet and@KatsiarynaTatarynovich Please help on this.

AmsterGet commented 4 years ago

Hi @vaibhavshukl12 ! Have you tried an example from our examples repository?

vaibhavshukl12 commented 4 years ago

@AmsterGet yes I cloned the same example also but no result is posting. I change the configuration like token, endpoint and project only But nothing turned on

AmsterGet commented 4 years ago

Any other logs from the console?

vaibhavshukl12 commented 4 years ago

No @AmsterGet as my script is passing I am not getting any failed log. I followed the below process please let me know if anything I missed. 1- Ran this command - npm i @reportportal/agent-js-jasmine --save-dev 2- added this code in conf.js file

var ReportportalAgent = require('@reportportal/agent-js-jasmine');`
var agent = new ReportportalAgent({
    // client settings
    token: "00000000-0000-0000-0000-000000000000",
    endpoint: "http://your.reportportal.server/api/v1",
    launch: "LAUNCH_NAME",
    project: "PROJECT_NAME",
    // agent settings
    attachPicturesToLogs: true,
    attributes: [
        {
            "key": "YourKey",
            "value": "YourValue"
        },
        {
            "value": "YourValue"
        },
    ]
});

3- added this in onPrepare- jasmine.addReporter(agent.getJasmineReporter()); 4- added this in conf file -

agent.getExitPromise().then(() => {
    console.log('finish work');
})

Anything else i need to do

vaibhavshukl12 commented 4 years ago

Hi @AmsterGet, Please help on this.

vaibhavshukl12 commented 4 years ago

Hi @AmsterGet below is version: "devDependencies": { "@reportportal/agent-js-jasmine": "^5.0.0", "jasmine": "^3.2.0" }

vaibhavshukl12 commented 4 years ago

Hi @KatsiarynaTatarynovich RP Version is 5.3 and other is

"devDependencies": {
"@reportportal/agent-js-jasmine": "^5.0.0",
"jasmine": "^3.2.0"
}
KatsiarynaTatarynovich commented 4 years ago

@vaibhavshukl12 two minutes ago I ran the example from our examples repository and the results are displayed in RP. Are you sure you entered the data correctly? Please send me an endpoint value. And recheck the token value.

vaibhavshukl12 commented 4 years ago

Thanks, @KatsiarynaTatarynovich for your support it's working now, I created a new project then it's working fine. But now I have one more issue. I have one describe block in which I have three it blocks, but on RP @Test is created inside @Test and launch is the in-progress mode it's not stopping also please help on this

vaibhavshukl12 commented 4 years ago

Hi @KatsiarynaTatarynovich it's working with one it block in describe but when I am putting multiple it in single describe then issue is coming launch is also not stopping and it is coming inside it. Please look into this.

vaibhavshukl12 commented 4 years ago

Hi, @KatsiarynaTatarynovich Hope you doing well. Please update on this.

vaibhavshukl12 commented 4 years ago

Hi @KatsiarynaTatarynovich and @AmsterGet I try to run in debug mode also. But the Finish launch is not happening. The launch is in running mode until i am forcibly stopped it.

Start launch 3btx73gkelh38s3 [19:55:29] I/launcher - Running 1 instances of WebDriver [19:55:29] I/direct - Using ChromeDriver directly...

DevTools listening on ws://127.0.0.1:57700/devtools/browser/b440497e-8d13-4a04-b93a-69bd512d1a2c XML report directory cleared! Spec started Start test item 3btx73gkelh3h67 Hi 2

Flipkart Launch Demo Script ✓ Demo1 Hi 2 ✓ Demo2

Executed 2 of 2 specs SUCCESS in 0.359 sec. Success start item 3btx73gkelh3h67 Start test item 3btx73gkelh3h69 Start test item 3btx73gkelh3hfn [19:55:40] I/launcher - 0 instance(s) of WebDriver still running [19:55:40] I/launcher - chrome reportportal/reportportal#1 passed Success start item 3btx73gkelh3h69 Save log 3btx73gkelh3hfm Success start item 3btx73gkelh3hfn Finish test item 3btx73gkelh3hfn Save log 3btx73gkelh3hnd Successfully save log 3btx73gkelh3hfm Finish test item 3btx73gkelh3h69 Success finish item 3btx73gkelh3hfn Success finish item 3btx73gkelh3h69 Successfully save log 3btx73gkelh3hnd Finish test item 3btx73gkelh3hfn Success finish item 3btx73gkelh3hfn

Please help on this .

KatsiarynaTatarynovich commented 4 years ago

@vaibhavshukl12 Put return agent.getExitPromise(); inside of the afterLaunch method in the config (like in the example)

afterLaunch() {
        return agent.getExitPromise();
    }
vaibhavshukl12 commented 4 years ago

@KatsiarynaTatarynovich I already put this method but still launch is not finishing. Please have a look at the conf file that I am using. And pls help on this.

var q = require('./node_modules/q');
const ReportportalAgent = require('@reportportal/agent-js-jasmine');

const agent = new ReportportalAgent({
  // client settings
  token: "",
  endpoint: "",
  launch: "",
  project: "",
  debug: true,
  attachPicturesToLogs: true,
});
exports.config = {
  allScriptsTimeout: 160000,
  getPageTimeout: 190000,

  specs: [

    'specs/demo_spec.js',
  ],

  capabilities: {
    browserName : 'chrome',
    marionette : true,
    acceptInsecureCerts : true
  },
  directConnect: true,
  framework: 'jasmine2',
  onPrepare: function () {
    jasmine.getEnv().addReporter(agent.getJasmineReporter());
    },
  afterLaunch() {
    return agent.getExitPromise();
}

};
KatsiarynaTatarynovich commented 4 years ago

@vaibhavshukl12 Please try this configuration multiTread

vaibhavshukl12 commented 4 years ago

@KatsiarynaTatarynovich I tried both, but the issue persists. I am using Grunt as task runner is there any issue with this for RP

KatsiarynaTatarynovich commented 4 years ago

@vaibhavshukl12 You can try this solution https://github.com/reportportal/agent-js-jasmine/issues/82 Hope it will help you

vaibhavshukl12 commented 4 years ago

@KatsiarynaTatarynovich i tried the above solution but still launch is in running mode only.

tr1ble commented 2 years ago

@KatsiarynaTatarynovich i tried the above solution but still launch is in running mode only.

Is problem still actual ? @vaibhavshukl12

DzmitryHumianiuk commented 2 years ago

@AmsterGet ^?

AmsterGet commented 1 year ago

Hello @vaibhavshukl12 ! Did you manage to solve the issue?