danitseitlin / reportportal-testcafe-plugin

TestCafe reporter built to integrate with the Report Portal services.
Apache License 2.0
4 stars 4 forks source link

Can't get report portal to get data from testcafe #37

Closed yllawwally closed 3 years ago

yllawwally commented 3 years ago

When running the test, I get a message "Report Portal launch : function link() { [native code] }. No launch gets shown in report portal.

At command line this is the command I am running. /usr/bin/node //home/wally/testcafe/node_modules/testscafe.js chrome test.js --reporter=reportportal --rdomain=http://reportportal.svcs.aws:8080/ --rtoken=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --rlaunch=wally_test_added --rproject=wally_test

danitseitlin commented 3 years ago

@yllawwally Seems like you have a space between wally_test and added. Maybe add " ?

yllawwally commented 3 years ago

I added the quotes, and I'm still not seeing any results in report portal.

danitseitlin commented 3 years ago

@yllawwally The reporter is reportportal-plugin

danitseitlin commented 3 years ago

@yllawwally Your run should be:

/usr/bin/node //home/wally/testcafe/node_modules/testscafe.js chrome test.js --reporter=reportportal-plugin --rdomain=reportportal.svcs.aws --rtoken=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --rlaunch='wally_test_added' --rproject=wally_test

Let me know if this helps.

yllawwally commented 3 years ago

Thank you, it did help. But now I'm at the next hurdle. Connection error to reportportal /usr/bin/node //home/wally/testcafe/node_modules/testcafe/bin/testcafe.js chrome //home/wally/testcafe/tests/test.js --reporter=reportportal-plugin --rdomain=reportportal.svcs.aws:8080/ --rtoken=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --rlaunch='wally_test_added' --rproject=wally_test

` Running tests in:

ERROR The "reportTaskStart" method of the "reportportal-plugin" reporter produced an uncaught error. Error details: Error: Report portal is not connected! at ReportPortal.startLaunch (/home/wally/testcafe/node_modules/testcafe-reporter-reportportal-plugin/lib/report-portal.js:53:32) at processTicksAndRejections (internal/process/task_queues.js:97:5) at ReporterPluginHost.reportTaskStart (/home/wally/testcafe/node_modules/testcafe-reporter-reportportal-plugin/lib/index.js:18:7) at Reporter.dispatchToPlugin (/home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:278:13) at Reporter._onceTaskStartHandler (/home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:300:9) at /home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:424:40 at async Promise.all (index 0)`

danitseitlin commented 3 years ago

@yllawwally It means there is no connection to the server, try passing --rprotocol=http in addition

danitseitlin commented 3 years ago

Also without the extra slash in the domain at the end.

yllawwally commented 3 years ago

I made the 2 recommended changes, and I still get an error. However, the error is now a 403. /usr/bin/node //home/wally/testcafe/node_modules/testcafe/bin/testcafe.js chrome //home/wally/testcafe/tests/test.js --reporter=reportportal-plugin --rdomain=reportportal.svcs.aws:8080 --rtoken=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx --rlaunch='wally_test_added' --rproject=wally_test --rprotocol=http

` Running tests in:

ERROR The "reportTaskStart" method of the "reportportal-plugin" reporter produced an uncaught error. Error details: Error: Report portal is not connected! at ReportPortal.startLaunch (/home/wally/testcafe/node_modules/testcafe-reporter-reportportal-plugin/lib/report-portal.js:53:32) at processTicksAndRejections (internal/process/task_queues.js:97:5) at ReporterPluginHost.reportTaskStart (/home/wally/testcafe/node_modules/testcafe-reporter-reportportal-plugin/lib/index.js:18:7) at Reporter.dispatchToPlugin (/home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:278:13) at Reporter._onceTaskStartHandler (/home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:300:9) at /home/wally/testcafe/node_modules/testcafe/src/reporter/index.ts:424:40 at async Promise.all (index 0)`

danitseitlin commented 3 years ago

@yllawwally Are you sure the token you're passing is correct? seems like it doesn't have enough permissions according to the error message: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403

yllawwally commented 3 years ago

I'm listed as the project manager. I regenerated my token, and tried it again. But I saw no change in behavior. image

danitseitlin commented 3 years ago

@yllawwally Hi, quite hard to understand the issue here. Do you mind to drop in your discord, or give me some kind of temporary permissions to debug it for you?

yllawwally commented 3 years ago

Hello sorry for taking so long to get back to you. I can't run discord it's blocked, and can't get you access to the environment. I regenerated the token. I was able to make a curl in postman, that successfully connects to report portal, and can get information. I understand if you can't really help. Here is the working curl

curl -X GET \ http://reportportal.svcs.aws:8080/api/v1/wally/launch \ -H 'Accept: */*' \ -H 'Authorization: Bearer 115f95b4-XXXX-408d-9472-0d8764200911' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Host: reportportal.svcs.aws:8080' \ -H 'Postman-Token: f6c79d60-01bc-4262-8d61-bb183be9c861,c26438ce-9aee-4ba4-9265-0d7b9586166d' \ -H 'User-Agent: PostmanRuntime/7.15.0' \ -H 'accept-encoding: gzip, deflate' \ -H 'cache-control: no-cache' \ -H 'filter.cnt.name: _TESTRUN_ON_LOCAL_ENV'

danitseitlin commented 3 years ago

@yllawwally Hi, I did not forget you! I am just a bit overloaded with other project, 😅 I promise to get to this soon :)

yllawwally commented 3 years ago

Not a problem, I understand. I'm sorry I can't be more helpful with access.

danitseitlin commented 3 years ago

@yllawwally Hi, after looking into it more deeply, these are the following parameters required for you to use:

  1. --rdomain: The domain of your RP server, based on your example it should be reportportal.svcs.aws, without port or protocol, just the domain.
  2. --rtoken: Your RP token, make sure it has relevant permissions
  3. --rlaunch / rlaunch-id: An existing launch ID or a name of a new one to be created
  4. --rproject: An existing project
  5. --rprotocol: should be https for real life server, and probably http for local server only. In addition, you can clone this project, add a .env configuration file and run tests in order to be able to test around which configuration is the correct for you.

This info should help, hope it does.

yllawwally commented 3 years ago

@danitseitlin Those changes allowed it to work. Thank you very much.