Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

jpm test not working on Windows 10 with Nightly 51 #567

Open
insidiator opened this issue Aug 11, 2016 · 12 comments
Open

jpm test not working on Windows 10 with Nightly 51 #567

insidiator opened this issue Aug 11, 2016 · 12 comments

Comments

@insidiator
Copy link

insidiator commented Aug 11, 2016

Hi everyone,

I am just starting addon development and trying to get some basic tutorials to run.
I followed this guide to install jpm from github, made a new addon with jpm init using all the default parameters and successfully used jpm test to run the unit tests. Then I updated to Firefox 48 and everything stopped working because of the new addon signing policy. I installed Nightly as suggested in #562 and mozilla/activity-stream/issues/1028 but still had no luck because it would open some windows 10 intro. Seeing #561 I found that there is a setting for it and I added the following line to preferences.js:

// Disable Windows 10 intro
"browser.usedOnWindows10.introURL": ""

With this the tests finally started running, but now I get "TypeError: tab is null". You can see the full output here

Maybe somebody can help me overcome this issue?

@freaktechnik
Copy link
Contributor

Hmm, that looks like a bug with the SDK test runner and not jpm specifically, but I haven't had a full look at the stack trace yet.

@Croydon
Copy link

Croydon commented Aug 15, 2016

@insidiator This is not really an issue solver, but if you just start to develop add-ons you might want to use WebExtensions, see https://developer.mozilla.org/en-US/Add-ons for a comparision.

@insidiator
Copy link
Author

@Croydon Thanks. I haven't seen this before. Unfortunately it looks like it doesn't support io/file.

@asamuzaK
Copy link
Contributor

I think you should ask questions about add-on development in Latest Add-ons topics - Mozilla Discourse

@asamuzaK
Copy link
Contributor

Confirmed jpm test works on Win10

C:\Users\XXX\Documents\testaddon>jpm test -b "C:\Program Files\Nightly\firefox.exe"
JPM [info] Starting jpm test on test add-on
JPM [info] Creating a new profile
Running tests on Firefox 51.0a1/Gecko 51.0a1 (Build 20160817030202) ({ec8030f7-c20a-464f-9b0e-13a3a9e97384}) under winnt/x86_64.
...console.log: testaddon: [JavaScript Warning: "TypeError: useless expression" {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/util/sequence.js" line: 333}]
......console.warn: testaddon: 2 warnings or errors were logged to the platform's nsIConsoleService, which could be of no consequence; however, they could also be indicative of aberrant behavior.

9 of 9 tests passed.
All tests passed!

@insidiator
Copy link
Author

Just tried it again and it still does not work with the latest nightly and jpm.
Strangley enough it did work in one single instance where I created a testaddon on c drive, but when I called the same command again, it didn't work anymore. :(

@asamuzaK
Copy link
Contributor

Ah, confirmed the error.

It looks like at the first run of Nightly (if you did not run Nightly before jpm test),
https://www.mozilla.org/ja/firefox/windows-10/welcome/?utm_source=firefox-browser&utm_medium=firefox-browser&utm_content=firstrun
shows up and jpm test fails.
But after that, if you try jpm test again and then it works.

Similar behavior in Developer Edition too (not exactly the same with Nightly though).

@kumar303
Copy link
Contributor

Hmm, there is probably some preference we need to add that disables the first run welcome URL on windows. You could check about:config compared to a new profile to try and figure out what gets flipped.

@freaktechnik
Copy link
Contributor

@kumar303 I think the pref name is in the bug description...

@kumar303
Copy link
Contributor

kumar303 commented Sep 1, 2016

Ah, right, so, the preference alone will not fix this problem. I guess we should add it anyway but someone probably needs to spelunk the ancient gecko SDK ruins for more answers.

@freaktechnik
Copy link
Contributor

I would assume setting the browser.usedOnWindows10 boolean pref to true would not show the page, but I have to test that first. The SDK test runner does not tolerate any extra tabs or windows, and there's no proper way of dealing with them other than being able to disable them from opening in the first place.

@SebastianZ
Copy link

I also have that issue for several months now. Strangly, sometimes it works, though most of the time not.
With my amateur knowledge, I assume the SDK doesn't wait for the window to be fully loaded to access window.gBrowser.

According to a related MDN article, window.gBrowser is only available once the load event is fired.

Sebastian

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

No branches or pull requests

6 participants