-
Notifications
You must be signed in to change notification settings - Fork 5
User's home page Create Modal improvement tests. #39
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
4 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 was deleted.
Oops, something went wrong.
63 changes: 63 additions & 0 deletions
63
tests/common/modal_improvement/test_sketch_modal_improvement.py
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,63 @@ | ||
| from codebender_testing.utils import SeleniumTestCase | ||
| from selenium import webdriver | ||
| from selenium.webdriver.common.by import By | ||
| from selenium.webdriver.common.keys import Keys | ||
| from codebender_testing import config | ||
| from selenium.webdriver.common.action_chains import ActionChains | ||
| from selenium.webdriver.support import expected_conditions | ||
| from codebender_testing.config import TIMEOUT | ||
| from selenium.webdriver.support.ui import WebDriverWait | ||
| import pytest | ||
|
|
||
| class TestSketchesCounters(SeleniumTestCase): | ||
|
|
||
| @pytest.fixture(scope="class", autouse=True) | ||
| def open_user_home(self, tester_login): | ||
| """Makes sure we are logged in and are at the user home page | ||
| performing any of these tests.""" | ||
| pass | ||
|
|
||
| def test_create_sketch_modal(self): | ||
| # Create a public project. | ||
| createSketchBtn = self.get_element(By.ID, 'create_sketch_btn') | ||
| createSketchBtn.click() | ||
| WebDriverWait(self.driver, TIMEOUT['LOCATE_ELEMENT']).until( | ||
| expected_conditions.visibility_of_element_located( | ||
| (By.CSS_SELECTOR, "#create-sketch-modal") | ||
| ) | ||
| ) | ||
| createBtn = self.get_element( | ||
| By.ID, 'create-sketch-modal-action-button') | ||
|
|
||
| createdProject = self.get_element( | ||
| By.ID, 'create-sketch-name').get_attribute('value') | ||
|
|
||
| # Check that when the create sketch modal opens, | ||
| # the sketch name input has focus. | ||
| assert self.get_element(By.ID, 'create-sketch-name') == \ | ||
| self.driver.switch_to.active_element | ||
|
|
||
| # Check that when the input has focus and you press Enter, | ||
| # the create sketch action is executed. | ||
| self.get_element(By.ID, 'create-sketch-name').send_keys(Keys.ENTER) | ||
|
|
||
| self.get_element(By.CSS_SELECTOR, '#create-sketch-modal-action-button .fa-spinner') | ||
|
|
||
| # Check that during the sketch creation, | ||
| # the sketch privacy radio buttons are disabled. | ||
| publicRadioButton = self.get_element(By.CSS_SELECTOR, | ||
| '#create-sketch-modal-type-controls [value="public"]') | ||
| privateRadioButton = self.get_element(By.CSS_SELECTOR, | ||
| '#create-sketch-modal-type-controls [value="private"]') | ||
| assert publicRadioButton.get_attribute('disabled') | ||
| assert privateRadioButton.get_attribute('disabled') | ||
|
|
||
| WebDriverWait(self.driver, TIMEOUT['LOCATE_ELEMENT']).until( | ||
| expected_conditions.element_to_be_clickable( | ||
| (By.CSS_SELECTOR, "#editor_heading_project_name") | ||
| ) | ||
| ) | ||
|
|
||
| # Delete the created project. | ||
| self.open("/") | ||
| self.delete_project(createdProject) | ||
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.
Check your indentation here.