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

Added integration test for "deploy not existing image" user story #420

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

floreks
Copy link
Member

@floreks floreks commented Feb 24, 2016

Related to #346.

Tested user story contains following steps:

  • [Deploy Page] - provide data for not existing image and click deploy
  • [Replication Controller List Page] - wait for card status error to appear and go to details page
  • [Replication Controller Details Page] - Go to events tab, filter by warnings and check results
  • [Replication Controller Details Page] - Go to Pods tab and click on Logs link near the existing pod
  • [Logs Page] - Check if pods logs show that pod is in pending state.

I've created new folder stories for user story tests. Is it ok?

Review on Reviewable

it('should go to details page', () => {
// when
replicationControllersPage.cardDetailsPageLink.click();
browser.driver.sleep(3000);
Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a better way to wait for page to fully load before going further with the test?

browser.waitForAngular doesn't really work.

@floreks floreks force-pushed the integration-test branch 4 times, most recently from 96a042c to afc54f7 Compare February 24, 2016 11:49
@floreks
Copy link
Member Author

floreks commented Feb 24, 2016

Local gulp intergration-test:prod and travis on my fork both pass without problems
https://travis-ci.org/floreks/dashboard/builds/111448850
It looks like this travis is slower and also tests are not executed on sauce labs but directly on travis. Error is because of page transition time. I'm trying to increase it but then travis build time will increase.

Is there a better way to wait for page to be fully loaded then browser.driver.sleep()? browser.waitForAngular() is not working correctly.

@floreks floreks force-pushed the integration-test branch 4 times, most recently from d63adc3 to 375ad4d Compare February 24, 2016 12:48
@bryk
Copy link
Contributor

bryk commented Feb 24, 2016

@f-higashi @maciaszczykm Can you review?

@floreks
Copy link
Member Author

floreks commented Feb 24, 2016

This still does not pass on PR travis without sauce labs :) I'm looking for a solution.

@bryk
Copy link
Contributor

bryk commented Feb 24, 2016

Review status: 0 of 12 files reviewed at latest revision, 5 unresolved discussions.


src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 199 [r2] (raw file):
Hmmm... Can you base your page objects on Xpaths? To prevent adding element IDs just for testing . You can easily inspect xpath for an element in chrome when you have dev tools open.


src/app/frontend/replicationcontrollerlist/replicationcontrollercardmenu.html, line 34 [r2] (raw file):
There's many cards with the same id. That's an error.


src/test/integration/stories/deploy_not_existing_img_test.js, line 56 [r2] (raw file):
Can we have all timeouts, e.g., 30 seconds? Will this solve travis problems?


src/test/integration/stories/deploy_not_existing_img_test.js, line 203 [r2] (raw file):
Can you stop using sleep-s everywhere in the tests? Read timeouts docs and tell me whether this helps: https://github.com/angular/protractor/blob/master/docs/timeouts.md#timeouts


Comments from the review on Reviewable.io

@codecov-io
Copy link

Current coverage is 81.52%

Merging #420 into master will not affect coverage as of d697a42

@@            master    #420   diff @@
======================================
  Files           76      76       
  Stmts          617     617       
  Branches         0       0       
  Methods          0       0       
======================================
  Hit            503     503       
  Partial          0       0       
  Missed         114     114       

Review entire Coverage Diff as of d697a42

Powered by Codecov. Updated on successful CI builds.

@floreks
Copy link
Member Author

floreks commented Feb 24, 2016

Review status: 0 of 12 files reviewed at latest revision, 5 unresolved discussions.


src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 199 [r2] (raw file):
I'll try with xpaths. I was thinking about that at first but going through stackoverflow and documentation I saw that xpaths are not used very often.


src/app/frontend/replicationcontrollerlist/replicationcontrollercardmenu.html, line 34 [r2] (raw file):
I'll add method to get elements by card name.


src/test/integration/stories/deploy_not_existing_img_test.js, line 56 [r2] (raw file):
Now I'm not really sure what caused the problem. I've changed sleep to browser.wait.


src/test/integration/stories/deploy_not_existing_img_test.js, line 203 [r2] (raw file):
I've read this page while writing tests but this doesn't really help. All actions should be synchronized but without sleep or browser.wait test goes further and fails.


Comments from the review on Reviewable.io

@floreks
Copy link
Member Author

floreks commented Feb 24, 2016

@bryk Ok so I know why this travis have failed. :) I've changed browser used by protractor to chrome and travis passed without problems. Maybe there is some driver issue with firefox. It couldn't click on elements with ng-href.

@floreks floreks force-pushed the integration-test branch 3 times, most recently from 5da5d1f to f3d8972 Compare February 24, 2016 15:17
@bryk
Copy link
Contributor

bryk commented Feb 24, 2016

Review status: 0 of 8 files reviewed at latest revision, 4 unresolved discussions.


src/test/integration/stories/deploy_not_existing_img_test.js, line 145 [r1] (raw file):
replicationControllersPage.cardDetailsPageLink.click().then(....foo...) Does this work?


src/test/integration/stories/deploy_not_existing_img_test.js, line 56 [r2] (raw file):
Cool


src/test/integration/stories/deploy_not_existing_img_test.js, line 203 [r2] (raw file):
How can I reproduce that this fails? Can I reproduce this on my local machine?


src/app/frontend/replicationcontrollerdetail/replicationcontrollerdetail.html, line 199 [r2] (raw file):
The xpath does not need to be very strict. You can search by texts,classes, etc. Just minimal xpath that gets thing done.


Comments from the review on Reviewable.io

@floreks
Copy link
Member Author

floreks commented Feb 24, 2016

Review status: 0 of 8 files reviewed at latest revision, 3 unresolved discussions.


src/test/integration/stories/deploy_not_existing_img_test.js, line 145 [r1] (raw file):
Not always. Sometimes I need to use browser.wait.


src/test/integration/stories/deploy_not_existing_img_test.js, line 203 [r2] (raw file):
Deleting waitUntilPresent call should be enough :)


Comments from the review on Reviewable.io

@f-higashi
Copy link
Contributor

In my environment, when browser is chrome, tests fail. When browser is Firefox, tests success.

  • Mozilla Firefox 44.0.2
  • chrome 48.0.2564.116

Test code looks good.

@floreks
Copy link
Member Author

floreks commented Feb 25, 2016

In my environment, when browser is chrome, tests fail. When browser is Firefox, tests success.

I've had the same problem with local tests using firefox that's why I've changed protractor to use chrome. That may be issue with firefox driver as it didn't want to click elements with ng-href to switch the page. On sauce labs all tests pass (Firefox, IE, Chrome)

@floreks
Copy link
Member Author

floreks commented Feb 25, 2016

@bryk After all even browser.wait is not needed. I don't know what exactly caused tests failure without wait or sleep before but now it works :) Tests evolved over time so probably I've just fixed it.

PTAL

@floreks floreks force-pushed the integration-test branch 2 times, most recently from 1f3cce0 to 6576fe7 Compare February 25, 2016 08:44
@bryk
Copy link
Contributor

bryk commented Feb 25, 2016

Does this still fail on sauce? I see: https://saucelabs.com/beta/tests/43ce4e134b6e425189ca8f7c14f410bd/commands


Reviewed 3 of 11 files at r1, 1 of 2 files at r3, 2 of 8 files at r4, 2 of 2 files at r6.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/test/integration/stories/deploy_not_existing_img_test.js, line 145 [r1] (raw file):
Resolved I think.


Comments from the review on Reviewable.io

@floreks
Copy link
Member Author

floreks commented Feb 25, 2016

After removing all browser.wait the case when new logs page is opened and current window handle is changed failed. If moving this call to replicationControllerDetailPage.podLogsLink.click().then(....foo...) won't help then I'll use browser.wait again to fix it.


Review status: 7 of 8 files reviewed at latest revision, all discussions resolved.


src/test/integration/stories/deploy_not_existing_img_test.js, line 145 [r1] (raw file):
Yes.


Comments from the review on Reviewable.io

@floreks
Copy link
Member Author

floreks commented Feb 25, 2016

Review status: 7 of 8 files reviewed at latest revision, 1 unresolved discussion.


src/test/integration/stories/deploy_not_existing_img_test.js, line 144 [r7] (raw file):
This solved the issue. Sauce labs tests have passed. https://travis-ci.org/floreks/dashboard/builds/111711531


Comments from the review on Reviewable.io

@floreks
Copy link
Member Author

floreks commented Feb 25, 2016

PTAL

@bryk
Copy link
Contributor

bryk commented Feb 29, 2016

:lgtm:

Sorry for delay, merging :)


Reviewed 1 of 1 files at r7.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


Comments from the review on Reviewable.io

@bryk
Copy link
Contributor

bryk commented Feb 29, 2016

Review status: all files reviewed at latest revision, 1 unresolved discussion.


src/test/integration/stories/deploy_not_existing_img_test.js, line 144 [r7] (raw file):
Ack


Comments from the review on Reviewable.io

bryk added a commit that referenced this pull request Feb 29, 2016
Added integration test for "deploy not existing image" user story
@bryk bryk merged commit 769efba into kubernetes:master Feb 29, 2016
@bryk bryk deleted the integration-test branch February 29, 2016 12:57
anvithks pushed a commit to anvithks/k8s-dashboard that referenced this pull request Sep 27, 2021
Removed occurences of Fake Storage / Fake driver from the delfin UI
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.

5 participants