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

(Feature) e2e tests for Wizard #660

Merged
merged 3 commits into from
Mar 7, 2018
Merged

(Feature) e2e tests for Wizard #660

merged 3 commits into from
Mar 7, 2018

Conversation

vbaranov
Copy link
Collaborator

@vbaranov vbaranov commented Mar 6, 2018

Closes #509

Problem: we have no integrated e2e tests for Token Wizard
Solution: integrate token-wizard-test-automation as a submodule

.travis.yml Outdated
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm i -g npm@^3
- sleep 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennis00010011b could you clarify why it is necessary?

Copy link

@dennis00010011b dennis00010011b Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vbaranov @fvictorio
Xvfb is needed for performs graphical operations in virtual memory. e2e script uses Metamask extension but headless Chrome don't support extension. It is why Xvfb used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was asking about the sleep 3 line.

Copy link

@dennis00010011b dennis00010011b Mar 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is recommended code from https://docs.travis-ci.com/user/gui-and-headless-browsers/
sleep 3 give xvfb some time to start

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dennis00010011b did you try other setups from recommended in the link above? if yes, do they work? just curious.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too much. I just tried to play with screen resolution but it wasn't helpfull

@vbaranov
Copy link
Collaborator Author

vbaranov commented Mar 6, 2018

@fvictorio @fernandomg let's do not merge any PR until we will not add e2e tests.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1588

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 9.544%

Totals Coverage Status
Change from base Build 1572: 0.0%
Covered Lines: 258
Relevant Lines: 1948

💛 - Coveralls

@vbaranov
Copy link
Collaborator Author

vbaranov commented Mar 7, 2018

@fernandomg @fvictorio is there anything stops us from merging?

@fernandomg
Copy link
Contributor

@vbaranov I'm running it locally, but I'm getting the following

[2018-03-07T14:05:08.235Z]  Test PASSED.'Owner can  finalize (after all tokens were sold)  
    ✓ Owner can  finalize (after all tokens were sold) (75902ms)
    ✓ Investors receive right amount of tokens after finalization)


  14 passing (13m)
  2 failing

  1) POA token-wizard. Test suite #1
       Investor can buy  amount = minCap:

      AssertionError [ERR_ASSERTION]: Test FAILED.Investor can NOT buy minCap
      + expected - actual

      -false
      +true
      
      at Context.<anonymous> (test/testSuite1.js:158:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
  From: Task: POA token-wizard. Test suite #1 Investor can buy  amount = minCap
      at Context.ret (node_modules/selenium-webdriver/testing/index.js:182:10)

  2) POA token-wizard. Test suite #1
       Investor can buy less than minCap after first transaction:

      AssertionError [ERR_ASSERTION]: Test FAILED. Investor can NOT buy less than minCap after first transaction
      + expected - actual

      -false
      +true
      
      at Context.<anonymous> (test/testSuite1.js:173:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
  From: Task: POA token-wizard. Test suite #1 Investor can buy less than minCap after first transaction
      at Context.ret (node_modules/selenium-webdriver/testing/index.js:182:10)

@vbaranov
Copy link
Collaborator Author

vbaranov commented Mar 7, 2018

@fernandomg please try to restart tests. You can see it worked with this PR. Anyway, @dennis00010011b will try to increase stability in the next releases of test-automation script.

@dennis00010011b
Copy link

@fernandomg There is should be result.log file(see path ./results/result_date_time/) Could you send it me?

Copy link
Contributor

@fernandomg fernandomg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it worked. Thanks!

@fernandomg
Copy link
Contributor

fernandomg commented Mar 7, 2018

There is should be result.log file(see path ./results/result_date_time/) Could you send it me?

Sorry, I moved to another issue and cleaned up the workspace. Now it worked. Thanks

@fvictorio
Copy link
Contributor

@vbaranov I think this can be merged now.

@fvictorio fvictorio merged commit 8155248 into master Mar 7, 2018
@ghost ghost removed the awaiting for review label Mar 7, 2018
@fvictorio fvictorio deleted the e2e-tests branch March 7, 2018 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants