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

reporting not working in windows (for single test) #21

Closed
wayneseymour opened this issue Feb 5, 2014 · 13 comments
Closed

reporting not working in windows (for single test) #21

wayneseymour opened this issue Feb 5, 2014 · 13 comments
Assignees
Labels

Comments

@wayneseymour
Copy link

JUnit XML Reporting (helps with Continue Integration [Bamboo, Jenkins, etc])
Any help will be appreciated. I'm a coder at Disney and I'm trying to push NightwatchJS instead of TheIntern.io.

Works on MAC just fine

This is what I do:
./nightwatch -t nightwatch-tests/some-nightwatch-test.js
when I run on windows, i get this:
OK. 2 assertions passed.

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'c:\dev\prj\git-repos\asgard.js\reports\c:\dev\prj\git-repos\asgard.js\nightwat
ch-tests\some-nightwatch-test.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at c:\dev\prj\git-repos\asgard.js\node_modules\nightwatch\runner\reporters\junit.js:36:10
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)
when I run on MAC, i get this:
# ... redacted success output, and then: 
OK. 5 total assertions passed.

My WIN box info (within GIT BASH TERMINAL):

# enter NODE repl:
> os.type()
'Windows_NT'
> os.arch()
'ia32'
> os.platform()
'win32'
# exit REPL
$ node --version
v0.10.24
$ npm --version
1.3.21
# my package.json$devDependencies (excerpt)
"nightwatch": "~0.2.4"
@beatfactor
Copy link
Member

looks like a bug.

@wayneseymour
Copy link
Author

Then..."Its clobbering time!" :) lol

@m1sta
Copy link

m1sta commented Feb 7, 2014

When screenshots are saved on windows they ignore the screenshots folder in settings.json too. Only raising because they might be releated.

@beatfactor beatfactor added the bug label Feb 7, 2014
@beatfactor beatfactor self-assigned this Feb 7, 2014
beatfactor pushed a commit that referenced this issue Feb 7, 2014
@wayneseymour
Copy link
Author

Its working! ...but only part of the time. :(

ran a mix of failing and passing tests

I expected reporting on the passed and failed tests
✖  Testing if element <a.signIn> contains text: undefined. Element could not be located.
INFO Request: DELETE /wd/hub/session/ae2e7c3f-5d5b-4587-b0dd-22ce80716931
 - data:
 - headers:  {}
ERROR: Unable to locate element: "a.signIn" using: css selector
LOG    - Completed command getText
INFO Response 204 DELETE /wd/hub/session/ae2e7c3f-5d5b-4587-b0dd-22ce80716931 {}

TEST FAILURE: 4 assertions failed, 5 passed and 9 skipped.
Unable to locate element: "a.signIn" using: css selector
FAILED:  1 assertions failed, 1 errors, 1 passed and 1 skipped
LOG    - Completed command session

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'c:\dev\prj\git-repos\asgard.js\reports\functional\basic.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at c:\dev\prj\git-repos\asgard.js\node_modules\nightwatch\runner\reporters\junit.js:36:10
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

waseymour@OR-WASEYMOUR-L1 /c/dev/prj/git-repos/asgard.js (nightwatch)

Now, nightwatch is reporting, but only if all tests succeed

@wayneseymour
Copy link
Author

Update my last:

  • If I run single test (passes for fails), reporting works! Thanks!
  • But, if if I run more than one, and any fails, reporting does not work. :(

@beatfactor Sorry for pestering, but I really do not want to have to be forced to doing this in Java by my managers.

@wayneseymour
Copy link
Author

Interesting features?:

Doesnt report correctly:

settings.json excpert:
{
  "src_folders": ["tests/functional"],
  "output_folder": "reports/functional",
output excerpt:
INFO FINISHED
OK. 2 assertions passed.

TEST FAILURE: 2 assertions failed, 6 passed and 8 skipped.

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'c:\dev\prj\git-repos\asgard.js\reports\functional\functional\basic.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at c:\dev\prj\git-repos\asgard.js\node_modules\nightwatch\runner\reporters\junit.js:36:10
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

waseymour@OR-WASEYMOUR-L1 /c/dev/prj/git-repos/asgard.js (nightwatch)

Also, doesnt report correctly:

settings.json excpert:
{
  "src_folders": ["tests/functional"],
  "output_folder": "reports",
output excerpt:
INFO FINISHED
OK. 2 assertions passed.

TEST FAILURE: 2 assertions failed, 6 passed and 8 skipped.

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'c:\dev\prj\git-repos\asgard.js\reports\functional\basic.xml'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at c:\dev\prj\git-repos\asgard.js\node_modules\nightwatch\runner\reporters\junit.js:36:10
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

waseymour@OR-WASEYMOUR-L1 /c/dev/prj/git-repos/asgard.js (nightwatch)

DOES report correctly:

settings.json excpert:
{
  "src_folders": ["tests/functional"],
  "output_folder": "reports",
create the reports/functional dir manually (grunt, shell, etc):
# cygwin:
mkdir -p reports/functional
output excerpt:
INFO FINISHED
OK. 2 assertions passed.

TEST FAILURE: 2 assertions failed, 6 passed and 8 skipped.

waseymour@OR-WASEYMOUR-L1 /c/dev/prj/git-repos/asgard.js (nightwatch)

@beatfactor any ideas man?

@beatfactor
Copy link
Member

this is only on windows happening?

@beatfactor beatfactor reopened this Feb 7, 2014
@beatfactor
Copy link
Member

I would find it very unpleasant too if I would have to do this in Java :-).

@beatfactor
Copy link
Member

The output folder isn't created automatically, it has to be an existing folder. Were you expecting it to be created by the runner?

@wayneseymour
Copy link
Author

Yeah, I was expecting it to be created.
I'll check it out on my MAC tonight.

Thanks again man.

@beatfactor
Copy link
Member

No problem. So if the folder is existing does it work properly?

@wayneseymour
Copy link
Author

Yes sir! All seems well.
I do thing nightwatch should just create the report dir though :)

@beatfactor
Copy link
Member

yes, I'll add that soon.

On Mon, Feb 10, 2014 at 4:19 PM, W. K. Seymour III <notifications@github.com

wrote:

Yes sir! All seems well.

I do thing nightwatch should just create the report dir though :)

Reply to this email directly or view it on GitHubhttps://github.com/beatfactor/nightwatch/issues/21#issuecomment-34642951
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants