acvetkov / sinon-chrome

Testing chrome extensions with Node.js
ISC License
434 stars 46 forks source link

Add update script and update Firefox schemas to 84 #94

Open ariasuni opened 4 years ago

ariasuni commented 4 years ago

Fix #63 Fix #87 Fix #89

I took the script at #73 and converted it to Python 3.

Right now I have 18 tests failed with two different types of failures, but I don’t know how to fix them:

  1) webextensions webextensions browser.menus webextensions browser.menus.create should be defined:
     AssertionError: expected false to be truthy
      at Function.assert.isOk (node_modules/chai/lib/chai/interface/assert.js:85:32)                                                                                                                                                   
      at Context.<anonymous> (test/specs/chrome.methods.test.js:36:20)                                                                                                                                                                 
      at processImmediate (internal/timers.js:439:21)                                                                                                                                                                                  

  2) webextensions webextensions browser.menus webextensions browser.menus.create should have stub sync behaviour:
     TypeError: Cannot read property 'resetHistory' of undefined
      at Context.<anonymous> (test/specs/chrome.methods.test.js:42:18)                                                                                                                                                                 
      at processImmediate (internal/timers.js:439:21)                                 

This may be related to the fact that there is three times webextensions in the test name, because they are apparently the only tests to have that.

acvetkov commented 4 years ago

This may be related to the fact that there is three times webextensions in the test name, because they are apparently the only tests to have that.

@ariasuni Hi, sorry for LOOOOOONG time answer and thank you for pr (it's very useful). I think problem is related to the fact that there is several namespace declarations in the new stable-api-ff.json and every next declaration clear previous data.

Unfortunately, I can not accept this pr, until you fix this problem, because new schema breaks sinon-chrome webextension api.

I think, solution is very simple - check this place. You should check is this namespace was already defined before override it.

ariasuni commented 3 years ago

I still have two errors that I didn’t find how to fix:

  1) webextensions webextensions browser.devtools.panels webextensions browser.devtools.panels.elements should return specified value:
     AssertionError: expected { Object (createSidebarPane, onSelectionChanged) } to equal 'a'
      at Context.<anonymous> (test/specs/chrome.properties.test.js:49:20)
      at processImmediate (node:internal/timers:463:21)

  2) webextensions webextensions browser.devtools.panels webextensions browser.devtools.panels.elements should return default value on flush:
     AssertionError: expected { Object (createSidebarPane, onSelectionChanged) } to equal 'value'
      at Context.<anonymous> (test/specs/chrome.properties.test.js:57:20)
      at processImmediate (node:internal/timers:463:21)