Skip to content

Commit f40629d

Browse files
author
konstantina
committed
Merge branch 'master' into frontend_js_unit_tests
2 parents 5d85a87 + 38aae70 commit f40629d

File tree

8 files changed

+70
-14
lines changed

8 files changed

+70
-14
lines changed

bin/seleniumbender

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ done
6363

6464
cd ..
6565

66-
URL="https://codebender.cc"
66+
URL="https://staging.codebender.cc"
6767

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

codebender_testing/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def jsondump(data):
5959
# Chrome extension for Chrome versions < 42.
6060
_CHROME_EXTENSION_FNAME = 'codebendercc-extension.crx'
6161
# Chrome extension for Chrome versions >= 42.
62-
_CHROME_APP_FNAME = 'chrome-app-1.0.0.8.zip'
62+
_CHROME_APP_FNAME = 'chrome-app-1.0.0.11.zip'
6363

6464
# Maximum version number that we can use the Chrome extension with.
6565
# For versions higher than this, we need to use the newer Codebender app.

codebender_testing/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,9 @@ def open_all_libraries_and_examples(self, url, logfile):
537537
compile_type = 'fetch'
538538
urls_to_visit, log_entry, log_file, log_time = self.resume_log(logfile, compile_type, examples_libraries)
539539

540-
libraries_re = re.compile(r'/libraries$')
541-
library_re = re.compile(r'/library/.+$')
542-
example_re = re.compile(r'/example/.+/.+$')
540+
libraries_re = re.compile(r'.+/libraries$')
541+
library_re = re.compile(r'.+/library/.+$')
542+
example_re = re.compile(r'.+/example/.+/.+$')
543543

544544
print '\nVisiting:', len(urls_to_visit), 'URLs'
545545
tic = time.time()

extensions/chrome-app-1.0.0.11.zip

244 KB
Binary file not shown.

extensions/codebender.xpi

217 KB
Binary file not shown.

logs/.gitignore

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
from codebender_testing.utils import SeleniumTestCase
2+
from selenium import webdriver
3+
from selenium.webdriver.common.by import By
4+
from selenium.webdriver.common.keys import Keys
5+
from codebender_testing import config
6+
from selenium.webdriver.common.action_chains import ActionChains
7+
from selenium.webdriver.support import expected_conditions
8+
from codebender_testing.config import TIMEOUT
9+
from selenium.webdriver.support.ui import WebDriverWait
10+
import pytest
11+
12+
class TestSketchesCounters(SeleniumTestCase):
13+
14+
@pytest.fixture(scope="class", autouse=True)
15+
def open_user_home(self, tester_login):
16+
"""Makes sure we are logged in and are at the user home page
17+
performing any of these tests."""
18+
pass
19+
20+
def test_create_sketch_modal(self):
21+
# Create a public project.
22+
createSketchBtn = self.get_element(By.ID, 'create_sketch_btn')
23+
createSketchBtn.click()
24+
WebDriverWait(self.driver, TIMEOUT['LOCATE_ELEMENT']).until(
25+
expected_conditions.visibility_of_element_located(
26+
(By.CSS_SELECTOR, "#create-sketch-modal")
27+
)
28+
)
29+
createBtn = self.get_element(
30+
By.ID, 'create-sketch-modal-action-button')
31+
32+
createdProject = self.get_element(
33+
By.ID, 'create-sketch-name').get_attribute('value')
34+
35+
# Check that when the create sketch modal opens,
36+
# the sketch name input has focus.
37+
assert self.get_element(By.ID, 'create-sketch-name') == \
38+
self.driver.switch_to.active_element
39+
40+
# Check that when the input has focus and you press Enter,
41+
# the create sketch action is executed.
42+
self.get_element(By.ID, 'create-sketch-name').send_keys(Keys.ENTER)
43+
44+
self.get_element(By.CSS_SELECTOR, '#create-sketch-modal-action-button .fa-spinner')
45+
46+
# Check that during the sketch creation,
47+
# the sketch privacy radio buttons are disabled.
48+
publicRadioButton = self.get_element(By.CSS_SELECTOR,
49+
'#create-sketch-modal-type-controls [value="public"]')
50+
privateRadioButton = self.get_element(By.CSS_SELECTOR,
51+
'#create-sketch-modal-type-controls [value="private"]')
52+
assert publicRadioButton.get_attribute('disabled')
53+
assert privateRadioButton.get_attribute('disabled')
54+
55+
WebDriverWait(self.driver, TIMEOUT['LOCATE_ELEMENT']).until(
56+
expected_conditions.element_to_be_clickable(
57+
(By.CSS_SELECTOR, "#editor_heading_project_name")
58+
)
59+
)
60+
61+
# Delete the created project.
62+
self.open("/")
63+
self.delete_project(createdProject)

tests/walkthrough/test_walkthrough.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ def test_page_4(self):
5454
assert cb_cf_operation_output.text.strip() in [
5555
'Please select a valid port!',
5656
'The specified port might not be available. Please check if it is used by another application. If the problem persists, unplug your device and plug it again. More Info',
57-
'An error occurred while connecting to your device. Please try again.'
57+
'An error occurred while connecting to your device. Please try again.',
58+
'Could not connect to your device. Make sure that you have connected it properly, that you have selected the correct settings (device type and port) and try again. More Info'
5859
]
5960
board_image = self.get_element(By.CSS_SELECTOR, '#arduinoImg')
6061
assert board_image.is_displayed()

0 commit comments

Comments
 (0)