Skip to content

Commit 76d30ce

Browse files
committed
Replace sendKeys() with click() when testing Skip all step button,
in how it works page.
1 parent c5a7478 commit 76d30ce

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

tests/common/how_it_works/test_how_it_works.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
TIMEOUT = 30
1010

1111
class TestHowItWorks(SeleniumTestCase):
12-
12+
1313
@pytest.fixture(scope="class")
1414
def skip_button_display (self):
1515
skip_button = self.driver.find_element_by_id('skip-all-steps-button')
@@ -22,7 +22,7 @@ def test_how_it_works(self, tester_logout):
2222

2323
def test_skip_button (self):
2424
skip_button = self.driver.find_element_by_id('skip-all-steps-button')
25-
skip_button.send_keys(Keys.ENTER)
25+
skip_button.click()
2626
WebDriverWait(self.driver, TIMEOUT).until(
2727
expected_conditions.text_to_be_present_in_element(
2828
(By.CSS_SELECTOR, ".popover-title"), "That's all for now."
@@ -36,67 +36,67 @@ def test_skip_button (self):
3636
def test_how_it_works_page_1 (self, skip_button_display):
3737
WebDriverWait(self.driver, TIMEOUT).until(
3838
expected_conditions.text_to_be_present_in_element(
39-
(By.CSS_SELECTOR, "#hiw-one .popover-title"),
39+
(By.CSS_SELECTOR, "#hiw-one .popover-title"),
4040
"Awesome editor (1/6)"
4141
)
42-
)
42+
)
4343
next_button = self.find('#hiw-one .popover-content .btn-primary')
4444
next_button.click()
4545

4646
def test_how_it_works_page_2 (self, skip_button_display):
4747
WebDriverWait(self.driver, TIMEOUT).until(
4848
expected_conditions.text_to_be_present_in_element(
49-
(By.CSS_SELECTOR, "#hiw-two .popover-title"),
49+
(By.CSS_SELECTOR, "#hiw-two .popover-title"),
5050
"Helpful utilities (2/6)"
5151
)
52-
)
52+
)
5353
next_button = self.find('#hiw-two .popover-content .btn-primary')
5454
next_button.click()
55-
55+
5656
def test_how_it_works_page_3 (self, skip_button_display):
5757
WebDriverWait(self.driver, TIMEOUT).until(
5858
expected_conditions.text_to_be_present_in_element(
59-
(By.CSS_SELECTOR, "#hiw-three .popover-title"),
59+
(By.CSS_SELECTOR, "#hiw-three .popover-title"),
6060
"Compile & Upload (3/6)"
6161
)
62-
)
62+
)
6363
verify_button = self.find('#cb_cf_verify_btn')
6464
verify_button.click()
6565

6666
def test_how_it_works_page_4 (self, skip_button_display):
6767
WebDriverWait(self.driver, TIMEOUT).until(
6868
expected_conditions.text_to_be_present_in_element(
69-
(By.CSS_SELECTOR, "#hiw-four .popover-title"),
69+
(By.CSS_SELECTOR, "#hiw-four .popover-title"),
7070
"Better error output (4/6)"
7171
)
7272
)
7373
insert_text = """
7474
var cursor_position = editor.aceEditor.getCursorPosition();
7575
editor.aceEditor.getSession().insert(cursor_position, ';')
7676
"""
77-
self.execute_script(insert_text, "editor")
77+
self.execute_script(insert_text, "editor")
7878
verify_button = self.find('#cb_cf_verify_btn')
7979
verify_button.click()
8080

8181

8282
def test_how_it_works_page_5 (self, skip_button_display):
8383
WebDriverWait(self.driver, TIMEOUT).until(
8484
expected_conditions.text_to_be_present_in_element(
85-
(By.CSS_SELECTOR, "#hiw-five .popover-title"),
85+
(By.CSS_SELECTOR, "#hiw-five .popover-title"),
8686
"Share (5/6)"
8787
)
88-
)
88+
)
8989
next_button = self.find('#hiw-five .popover-content .btn-primary')
9090
next_button.click()
9191

9292

9393
def test_how_it_works_page_6 (self, skip_button_display):
9494
WebDriverWait(self.driver, TIMEOUT).until(
9595
expected_conditions.text_to_be_present_in_element(
96-
(By.CSS_SELECTOR, "#hiw-six .popover-title"),
96+
(By.CSS_SELECTOR, "#hiw-six .popover-title"),
9797
"Collaborate (6/6)"
9898
)
99-
)
99+
)
100100
finish_button = self.find('.popover-content .btn-primary')
101101
finish_button.click()
102102

@@ -105,8 +105,8 @@ def test_how_it_works_page_7 (self):
105105
skip_button.is_displayed() == False
106106
WebDriverWait(self.driver, TIMEOUT).until(
107107
expected_conditions.text_to_be_present_in_element(
108-
(By.CSS_SELECTOR,
109-
'.navbar .popover:nth-child(3) .popover-title'),
108+
(By.CSS_SELECTOR,
109+
'.navbar .popover:nth-child(3) .popover-title'),
110110
"That's all for now."
111111
)
112112
)

0 commit comments

Comments
 (0)