Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App.js timestamp & duration showing Null #73

Closed
harta11 opened this issue Jul 25, 2018 · 6 comments
Closed

App.js timestamp & duration showing Null #73

harta11 opened this issue Jul 25, 2018 · 6 comments

Comments

@harta11
Copy link

harta11 commented Jul 25, 2018

Hello,
I followed the instruction for setting up the protractor-beautiful-reporter.
When i finished running the tests and produced a reporter, the reporter timestamp and duration is showing as Null.

Below is the screenshot from the app.js file.

image

@miller45
Copy link
Collaborator

@harta11 I tried to reproduce the phenomenon with my currenty angular 2 and angular 2 environment.
But i never get null for timestamp and duration. Can you post your package.json and your protractor.conf?

@denizengin
Copy link

denizengin commented Aug 24, 2018

@miller45 I've the same issue when I run protractor through a custom script in package.json, but if I use the command prompt to run protractor, then the duration is populated in the resulting json file.

I've added some logging into the reporter source, and it seems the started property of the result object is not getting populated, when I run protractor using npm run [customscriptname]

metaData.duration = new Date(result.stopped) - new Date(result.started);

All that the custom script in package.json does is 'protractor [path to protractor config]'.

Summary
npm run test-e2e will generate reports, but without duration
"test-e2e": "webdriver-manager update && protractor ClientApp/test/e2e/protractor.conf.js"

Running protractor from the command line
generates report with the duration

@miller45
Copy link
Collaborator

miller45 commented Aug 25, 2018

@denizengin I also start protractor via npm but i do not use the "global" command because i work in different teams and configurations. By npm script looks like this...
"faste2e": "node node_modules/protractor/bin/protractor e2e/protractor.conf"
can you try that if makes a difference?
Which version of protractor /webdriver / npm / node /protractor-beautiful-reporter / jasmine are you using?

@denizengin
Copy link

denizengin commented Aug 28, 2018

@miller45 Thanks for the reply.

Pointing to node_modules/protractor in package.json, doesn't make a difference.

Here are the versions:

"protractor": "~5.1.2",
"protractor-angular-screenshot-reporter": "^0.1.2",
"protractor-beautiful-reporter": "^1.2.4",
"jasmine-core": "~2.6.2",
"jasmine-reporters": "^2.0.0",
"jasmine-spec-reporter": "~4.1.0"

npm -> 5.6.0
node -> 9.7.0
OS -> windows 10

@miller45
Copy link
Collaborator

miller45 commented Aug 28, 2018

@denizengin most version kindof match mine.... the only exception is that i use node 8.11.1 LTS.
I do not really know if node or other factors are influencing this... but there is one thing you could try.

Go to the source code (index.js) of protractor-beautiful-reporter and search for function nowString() { . There you should see return new Date().toISOString();
Replace this with new Date().getTime();
Save the file run e2e tests and see if this makes a difference....

@miller45
Copy link
Collaborator

miller45 commented Sep 5, 2019

Cannot reproduce and no more feedback

@miller45 miller45 closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants