Skip to content

Commit

Permalink
Add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
valaparthvi committed Sep 9, 2019
1 parent 12a7a4e commit b17b440
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testing/test_bootstrap_nav.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from widgetastic.utils import partial_match
from widgetastic.widget import View
from widgetastic_patternfly import BootstrapNav

Expand All @@ -11,8 +12,10 @@ class TestView(View):
# assert that nav is visible
assert view.nav.is_displayed
# Check if all options are being returned
assert view.nav.all_options == ['ALL (Default)', 'Environment / Dev', 'Environment / Prod', '']
assert view.nav.all_options == ['ALL (Default)', 'Environment / Dev', 'Environment / Prod', 'Environment / UAT' ,'']
# assert if currently active(selected) element is being returned correctly
assert view.nav.read() == ['ALL (Default)']
# assert if list has_item
assert view.nav.has_item(text='Environment / Prod')
# assert if partial match works for is_disabled
assert view.nav.is_disabled(text=partial_match("UAT"))
3 changes: 3 additions & 0 deletions testing/testing_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,9 @@ <h4 class="modal-title" id="myModalLabel">Modal Title</h4>
<li class="">
<a href="#">Environment / Prod</a>
</li>
<li class="disabled">
<a href="#">Environment / UAT</a>
</li>
<li class="">
<a href="#"></a>
</li>
Expand Down

0 comments on commit b17b440

Please sign in to comment.