Skip to content

Commit d7c0d22

Browse files
author
konstantina
committed
Updated create_sketch function is utils.py file.
Sketch creation process has changed in homepage redesign, so create_sketch function was modified. create_sketch first clicks on Create Project button located in homepage. Create Sketch modal opens and function clicks on Create button. Waits for the loading screen to appear and disappear, finds the created project name and renames it.
1 parent 732a493 commit d7c0d22

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

codebender_testing/utils.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,24 @@ def create_sketch(self, name):
739739
"""Creates a sketch with a given name"""
740740
createSketchBtn = self.driver.find_element_by_id('create_sketch_btn')
741741
createSketchBtn.click()
742-
sketchHeading = self.get_element(By.ID, 'editor_heading_project_name')
742+
createBtn = self.get_element(By.ID, 'create-sketch-modal-action-button')
743+
createBtn.click()
744+
WebDriverWait(self.driver, VERIFY_TIMEOUT).until(
745+
expected_conditions.visibility_of_element_located(
746+
(By.CSS_SELECTOR, "#editor-loading-screen")
747+
)
748+
)
749+
WebDriverWait(self.driver, VERIFY_TIMEOUT).until(
750+
expected_conditions.invisibility_of_element_located(
751+
(By.CSS_SELECTOR, "#editor-loading-screen")
752+
)
753+
)
754+
WebDriverWait(self.driver, VERIFY_TIMEOUT).until(
755+
expected_conditions.element_to_be_clickable(
756+
(By.CSS_SELECTOR, "#editor_heading_project_name")
757+
)
758+
)
759+
sketchHeading = self.driver.find_element_by_id('editor_heading_project_name')
743760
sketchHeading.click()
744761
renameInput = '#editor_heading_project_name input'
745762
headingInput = self.get_element(By.CSS_SELECTOR, renameInput)

0 commit comments

Comments
 (0)