Skip to content

Commit 0401872

Browse files
author
Brandon Duffany
committed
Add speeds dropdown and clone project tests
1 parent 3ae2a60 commit 0401872

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/sketch/test_sketch.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from selenium.webdriver.support.ui import WebDriverWait
99
import pytest
1010

11+
from codebender_testing.config import TEST_PROJECT_NAME
1112
from codebender_testing.utils import SeleniumTestCase
1213

1314

@@ -52,7 +53,7 @@ def test_boards_dropdown(self):
5253
assert boards_dropdown.first_selected_option.text == TEST_BOARD
5354

5455
def test_ports_dropdown(self):
55-
"""Ensures that the ports dropdown exists."""
56+
"""Tests that the ports dropdown exists."""
5657
self.get_element(By.ID, "ports")
5758

5859
def test_run_with_no_port(self):
@@ -63,3 +64,15 @@ def test_run_with_no_port(self):
6364
WebDriverWait(self.driver, FLASH_TIMEOUT).until(
6465
expected_conditions.text_to_be_present_in_element(
6566
(By.ID, "operation_output"), "Please select a valid port or enable the plugin!!"))
67+
68+
def test_speeds_dropdown(self):
69+
"""Tests that the speeds dropdown exists."""
70+
self.get_element(By.ID, "baudrates")
71+
72+
def test_clone_project(self):
73+
"""Tests that clicking the 'Clone Project' link brings us to a new
74+
sketch with the title 'test_project clone'."""
75+
clone_link = self.get_element(By.LINK_TEXT, 'Clone Project')
76+
clone_link.click()
77+
project_name = self.get_element(By.ID, 'editor_heading_project_name')
78+
assert project_name.text.startswith("%s copy" % TEST_PROJECT_NAME)

0 commit comments

Comments
 (0)