Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/seleniumbender
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ done

cd ..

URL="https://codebender.cc"
URL="https://staging.codebender.cc"

email_date=$(date +"%Y-%m-%d %H:%M:%S")

Expand Down
8 changes: 0 additions & 8 deletions logs/.gitignore

This file was deleted.

63 changes: 63 additions & 0 deletions tests/common/modal_improvement/test_sketch_modal_improvement.py
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(
Copy link
Contributor

Choose a reason for hiding this comment

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

Check your indentation here.

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)