-
Notifications
You must be signed in to change notification settings - Fork 4.2k
bokchoy tests for move xblocks #14465
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| """ | ||
| Move XBlock Modal Page Object | ||
| """ | ||
| from bok_choy.page_object import PageObject | ||
| from common.test.acceptance.pages.common.utils import click_css | ||
|
|
||
|
|
||
| class MoveModalView(PageObject): | ||
| """ | ||
| A base class for move xblock | ||
| """ | ||
|
|
||
| def __init__(self, browser): | ||
| """ | ||
| Arguments: | ||
| browser (selenium.webdriver): The Selenium-controlled browser that this page is loaded in. | ||
| """ | ||
| super(MoveModalView, self).__init__(browser) | ||
|
|
||
| def is_browser_on_page(self): | ||
| return self.q(css='.modal-window.move-modal').present | ||
|
|
||
| def url(self): | ||
| """ | ||
| Returns None because this is not directly accessible via URL. | ||
| """ | ||
| return None | ||
|
|
||
| def save(self): | ||
| """ | ||
| Clicks save button. | ||
| """ | ||
| click_css(self, 'a.action-save') | ||
|
|
||
| def cancel(self): | ||
| """ | ||
| Clicks cancel button. | ||
| """ | ||
| click_css(self, 'a.action-cancel', require_notification=False) | ||
|
|
||
| def click_forward_button(self, source_index): | ||
| """ | ||
| Click forward button at specified `source_index`. | ||
| """ | ||
| css = '.move-modal .xblock-items-container .xblock-item' | ||
| self.q(css='.button-forward').nth(source_index).click() | ||
| self.wait_for( | ||
| lambda: len(self.q(css=css).results) > 0, description='children are visible' | ||
| ) | ||
|
|
||
| def click_move_button(self): | ||
| """ | ||
| Click move button. | ||
| """ | ||
| self.q(css='.modal-actions .action-move').first.click() | ||
|
|
||
| @property | ||
| def is_move_button_enabled(self): | ||
| """ | ||
| Returns True if move button on modal is enabled else False. | ||
| """ | ||
| return not self.q(css='.modal-actions .action-move.is-disabled').present | ||
|
|
||
| @property | ||
| def children_category(self): | ||
| """ | ||
| Get displayed children category. | ||
| """ | ||
| return self.q(css='.xblock-items-container').attrs('data-items-category')[0] | ||
|
|
||
| def navigate_to_category(self, category, navigation_options): | ||
| """ | ||
| Navigates to specifec `category` for a specified `source_index`. | ||
| """ | ||
| child_category = self.children_category | ||
| while child_category != category: | ||
| self.click_forward_button(navigation_options[child_category]) | ||
| child_category = self.children_category |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presentorvisible??There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
presentbecause we are checking if the element has this class or notThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we not checking for visibility of loader ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes based on it's
is-hiddenclass.FYI @muhammad-ammar