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

Fix Advanced Ledger Panel tests (#6911) #7401

Closed
wants to merge 2 commits into from
Closed

Fix Advanced Ledger Panel tests (#6911) #7401

wants to merge 2 commits into from

Conversation

willy-b
Copy link
Contributor

@willy-b willy-b commented Feb 27, 2017

for #6911

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

Test Plan:
npm run uitest -- --grep 'Advanced payment panel tests'

@bsclifton
Copy link
Member

@willy-b thanks for checking this out- The tests failed on travis-ci and also when I run them locally. I can always get the first test passing, but not the rest. Looking at the changes, I think there is more required to make these work... I'll take a look

@willy-b
Copy link
Contributor Author

willy-b commented Feb 27, 2017

Looks like Travis is having other test failures preventing these from being run.
What does running npm run uitest -- --grep 'Advanced payment panel tests' show on your machine?

Thanks.

@diracdeltas
Copy link
Member

@willy-b i also got local test failures with npm run uitest -- --grep 'Advanced payment panel tests'

  Advanced payment panel tests
recovered paymentId: 53d5d84a-b645-4f76-9763-cc9319ee9600
recovered passphrase: 77517ea2-9f71-4b8d-8dc2-82dbc560bc2b
    ✓ can backup wallet to file (12476ms)
    1) can recover wallet from file
    2) shows an error popover if one recovery key is missing
    3) shows an error popover if a recovery key is not a UUID
    4) shows an error popover if both recovery keys are missing
    5) shows an error popover if the file is empty


  1 passing (2m)
  5 failing

  1) Advanced payment panel tests can recover wallet from file:
     WaitUntilTimeoutError: element (.paymentsMessage) still not visible after 10000ms
      at isVisible(".paymentsMessage") - waitForVisible.js:37:22

  2) Advanced payment panel tests shows an error popover if one recovery key is missin$
:
     WaitUntilTimeoutError: element (.paymentsMessage) still not visible after 10000ms
      at isVisible(".paymentsMessage") - waitForVisible.js:37:22

  3) Advanced payment panel tests shows an error popover if a recovery key is not a UU$D:
     WaitUntilTimeoutError: element (.paymentsMessage) still not visible after 10000ms
      at isVisible(".paymentsMessage") - waitForVisible.js:37:22

  4) Advanced payment panel tests shows an error popover if both recovery keys are mis$ing:
     WaitUntilTimeoutError: element (.paymentsMessage) still not visible after 10000ms
      at isVisible(".paymentsMessage") - waitForVisible.js:37:22

  5) Advanced payment panel tests shows an error popover if the file is empty:
     WaitUntilTimeoutError: element (.paymentsMessage) still not visible after 10000ms
      at isVisible(".paymentsMessage") - waitForVisible.js:37:22

@willy-b
Copy link
Contributor Author

willy-b commented Feb 28, 2017

thanks for pasting the output, @diracdeltas.
strange that it's failing while waiting for .paymentsMessage, as that is the selector for Payments Tab Welcome Page, which is common to all the tests. looking into it.

here's my output for the advanced payment panel tests in case it is useful in the meantime:

$ npm run uitest -- --grep 'Advanced payment panel tests'
> brave@0.13.5 uitest /home/user/projs/3rd/brave/browser-laptop
> cross-env NODE_ENV=test mocha --require babel-register --require babel-polyfill --recursive "test/about/**/*Test.js" "test/app/**/*Test.js" "test/components/**/*Test.js" "test/lib/**/*Test.js" "--grep" "Advanced payment panel tests"

  Advanced payment panel tests
recovered paymentId: 3ecd451b-0e64-4a6a-89fb-5b3280534619
recovered passphrase: 1733d67e-d955-4cf2-bf78-f15c4d6c9ec0
    ✓ can backup wallet to file (14148ms)
    ✓ can recover wallet from file (5678ms)
    ✓ shows an error popover if one recovery key is missing (3969ms)
    ✓ shows an error popover if a recovery key is not a UUID (3992ms)
    ✓ shows an error popover if both recovery keys are missing (3960ms)
    ✓ shows an error popover if the file is empty (3391ms)

  6 passing (1m)

and regular payment panel tests for comparison:

$ npm run uitest -- --grep 'Regular payment panel tests'

> brave@0.13.5 uitest /home/user/projs/3rd/brave/browser-laptop
> cross-env NODE_ENV=test mocha --require babel-register --require babel-polyfill --recursive "test/about/**/*Test.js" "test/app/**/*Test.js" "test/components/**/*Test.js" "test/lib/**/*Test.js" "--grep" "Regular payment panel tests"

  Regular payment panel tests
    can setup payments
      ✓ shows welcome page (7231ms)
      ✓ payments can be enabled (8552ms)
      ✓ payments can be disabled (7081ms)
      ✓ advanced settings is hidden by default (1786ms)
      ✓ advanced settings is visible when payments are enabled (9725ms)
      ✓ can create wallet (8266ms)

  6 passing (1m)

Use the same timeout used elsewhere in the tests for waiting for initial payments tab load
@bbondy bbondy modified the milestones: 0.13.6, 0.13.5 Feb 28, 2017
@diracdeltas
Copy link
Member

now i get different failures:

 1) Advanced payment panel tests can backup wallet to file:
     Error: timeout of 30000ms exceeded. Ensure the done() callback is being called in this test.


  2) Advanced payment panel tests can recover wallet from file:
     Error: timeout of 30000ms exceeded. Ensure the done() callback is being called in this test.


  3) Advanced payment panel tests shows an error popover if one recovery key is missing:
     TypeError: path must be a string or Buffer
      at Object.fs.openSync (fs.js:582:18)
      at Object.fs.writeFileSync (fs.js:1301:33)
      at generateAndSaveRecoveryFile (test/components/ledgerPanelAdvancedPanelTest.js:128:6)
      at Context.<anonymous> (test/components/ledgerPanelAdvancedPanelTest.js:199:5)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co-mocha/node_modules/co/index.js:65:19)
      at node_modules/co-mocha/node_modules/co/index.js:54:5
      at Context.co (node_modules/co-mocha/node_modules/co/index.js:50:10)
      at Context.createPromise (node_modules/co-mocha/node_modules/co/index.js:30:15)
      at Test.Runnable.run (node_modules/co-mocha/lib/co-mocha.js:43:16)
      at process._tickCallback (internal/process/next_tick.js:103:7)

  4) Advanced payment panel tests shows an error popover if a recovery key is not a UUID:
     TypeError: path must be a string or Buffer
      at Object.fs.openSync (fs.js:582:18)
      at Object.fs.writeFileSync (fs.js:1301:33)
      at generateAndSaveRecoveryFile (test/components/ledgerPanelAdvancedPanelTest.js:128:6)
      at Context.<anonymous> (test/components/ledgerPanelAdvancedPanelTest.js:206:5)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co-mocha/node_modules/co/index.js:65:19)
      at node_modules/co-mocha/node_modules/co/index.js:54:5
      at Context.co (node_modules/co-mocha/node_modules/co/index.js:50:10)
      at Context.createPromise (node_modules/co-mocha/node_modules/co/index.js:30:15)
      at Test.Runnable.run (node_modules/co-mocha/lib/co-mocha.js:43:16)
      at process._tickCallback (internal/process/next_tick.js:103:7)

  5) Advanced payment panel tests shows an error popover if both recovery keys are missing:
     TypeError: path must be a string or Buffer
      at Object.fs.openSync (fs.js:582:18)
      at Object.fs.writeFileSync (fs.js:1301:33)
      at generateAndSaveRecoveryFile (test/components/ledgerPanelAdvancedPanelTest.js:128:6)
      at Context.<anonymous> (test/components/ledgerPanelAdvancedPanelTest.js:213:5)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co-mocha/node_modules/co/index.js:65:19)
      at node_modules/co-mocha/node_modules/co/index.js:54:5
      at Context.co (node_modules/co-mocha/node_modules/co/index.js:50:10)
      at Context.createPromise (node_modules/co-mocha/node_modules/co/index.js:30:15)
      at Test.Runnable.run (node_modules/co-mocha/lib/co-mocha.js:43:16)
      at process._tickCallback (internal/process/next_tick.js:103:7)

  6) Advanced payment panel tests shows an error popover if the file is empty:
     TypeError: path must be a string or Buffer
      at Object.fs.openSync (fs.js:582:18)
      at Object.fs.writeFileSync (fs.js:1301:33)
      at generateAndSaveRecoveryFile (test/components/ledgerPanelAdvancedPanelTest.js:128:6)
      at Context.<anonymous> (test/components/ledgerPanelAdvancedPanelTest.js:220:5)
      at Generator.next (<anonymous>)
      at onFulfilled (node_modules/co-mocha/node_modules/co/index.js:65:19)
      at node_modules/co-mocha/node_modules/co/index.js:54:5
      at Context.co (node_modules/co-mocha/node_modules/co/index.js:50:10)
      at Context.createPromise (node_modules/co-mocha/node_modules/co/index.js:30:15)
      at Test.Runnable.run (node_modules/co-mocha/lib/co-mocha.js:43:16)
      at process._tickCallback (internal/process/next_tick.js:103:7)

@willy-b
Copy link
Contributor Author

willy-b commented Feb 28, 2017

Ouch. Looks like the first test (which was not changed) timed out this time. The rest depend on the recovery file generated by the first test and will generate path errors like what you see there if it fails.

Are the Basic Payment Panel tests failing intermittently for you too?
( npm run uitest -- --grep 'Regular payment panel tests')

Thanks for testing this.

@willy-b
Copy link
Contributor Author

willy-b commented Mar 9, 2017

I think this may be obsoleted by @NejcZdovc s work in #7642

@NejcZdovc
Copy link
Contributor

@willy-b yeah, I think that #7642 and #7481 will introduce a lot of changes. I already rewrote a lot of test's and will keep doing it till they are green 😃 Will for sure check out your changes to see if I can add it into the new code.

@willy-b
Copy link
Contributor Author

willy-b commented Mar 9, 2017

no worries, this was fixing the old tests I wrote.
out with the old, in with the new! closing.

@willy-b willy-b closed this Mar 9, 2017
@NejcZdovc NejcZdovc removed this from the 0.13.6 milestone Mar 9, 2017
@bsclifton bsclifton reopened this Mar 10, 2017
@bsclifton bsclifton added this to the 0.13.6 milestone Mar 10, 2017
@bsclifton bsclifton closed this Mar 10, 2017
@bsclifton bsclifton removed this from the 0.13.6 milestone Mar 10, 2017
@luixxiul luixxiul removed the request for review from bsclifton March 12, 2017 04:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants