-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb5a1ac
commit 88b527b
Showing
2 changed files
with
10 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ def _complete_form(self, user_profile: dict, signup_url=reverse("auth:signup"), | |
scroll_to_and_click_element(self.driver, accept_rgpd_element) | ||
|
||
if with_submit: | ||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button") | ||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button[type='submit']") | ||
scroll_to_and_click_element(self.driver, submit_element) | ||
|
||
def _assert_signup_success(self, redirect_url: str) -> list: | ||
|
@@ -182,10 +182,8 @@ def test_buyer_submits_signup_form_success_extra_data(self): | |
By.CSS_SELECTOR, f"input#id_nb_of_inclusive_provider_2022_{nb_of_inclusive}" | ||
) | ||
scroll_to_and_click_element(self.driver, nb_of_inclusive_provider_2022_element) | ||
|
||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button") | ||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button[type='submit']") | ||
scroll_to_and_click_element(self.driver, submit_element) | ||
|
||
# should get created User | ||
user = User.objects.get(email=BUYER.get("email")) | ||
|
||
|
@@ -209,7 +207,7 @@ def test_buyer_submits_signup_form_error(self): | |
# By.XPATH, "//select[@id='id_partner_kind']/option[text()='Réseaux IAE']" | ||
# ) | ||
# scroll_to_and_click_element(self.driver, partner_kind_option_element, sleep_time=10) | ||
# submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button") | ||
# submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button[type='submit']") | ||
# scroll_to_and_click_element(self.driver, submit_element) | ||
|
||
# self._assert_signup_success(redirect_url=reverse("wagtail_serve", args=("",))) | ||
|
@@ -230,7 +228,7 @@ def test_user_submits_signup_form_with_next_param_success_and_redirect(self): | |
signup_url=f"{reverse('auth:signup')}?next={next_url}", | ||
with_submit=False, | ||
) | ||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button") | ||
submit_element = self.driver.find_element(By.CSS_SELECTOR, "form button[type='submit']") | ||
scroll_to_and_click_element(self.driver, submit_element) | ||
|
||
self._assert_signup_success(redirect_url=next_url) | ||
|
@@ -258,7 +256,7 @@ def test_siae_user_can_sign_in_and_is_redirected_to_dashboard(self): | |
driver.find_element(By.CSS_SELECTOR, "input#id_username").send_keys(user_siae.email) | ||
driver.find_element(By.CSS_SELECTOR, "input#id_password").send_keys(DEFAULT_PASSWORD) | ||
|
||
driver.find_element(By.CSS_SELECTOR, "form button").click() | ||
driver.find_element(By.CSS_SELECTOR, "form button[type='submit']").click() | ||
|
||
# should redirect SIAE to dashboard | ||
self.assertEqual(driver.current_url, f"{self.live_server_url}{reverse('dashboard:home')}") | ||
|
@@ -271,7 +269,7 @@ def test_non_siae_user_can_sign_in_and_is_redirected_to_home(self): | |
driver.find_element(By.CSS_SELECTOR, "input#id_username").send_keys(user_buyer.email) | ||
driver.find_element(By.CSS_SELECTOR, "input#id_password").send_keys(DEFAULT_PASSWORD) | ||
|
||
driver.find_element(By.CSS_SELECTOR, "form button").click() | ||
driver.find_element(By.CSS_SELECTOR, "form button[type='submit']").click() | ||
|
||
# should redirect BUYER to search | ||
self.assertEqual(driver.current_url, f"{self.live_server_url}{reverse('siae:search_results')}") | ||
|
@@ -284,7 +282,7 @@ def test_user_can_sign_in_with_email_containing_capital_letters(self): | |
driver.find_element(By.CSS_SELECTOR, "input#id_username").send_keys("[email protected]") | ||
driver.find_element(By.CSS_SELECTOR, "input#id_password").send_keys(DEFAULT_PASSWORD) | ||
|
||
driver.find_element(By.CSS_SELECTOR, "form button").click() | ||
driver.find_element(By.CSS_SELECTOR, "form button[type='submit']").click() | ||
|
||
def test_user_wrong_credentials_should_see_error_message(self): | ||
user_siae = UserFactory(email="[email protected]", kind=User.KIND_SIAE) | ||
|
@@ -294,7 +292,7 @@ def test_user_wrong_credentials_should_see_error_message(self): | |
driver.find_element(By.CSS_SELECTOR, "input#id_username").send_keys(user_siae.email) | ||
driver.find_element(By.CSS_SELECTOR, "input#id_password").send_keys("password") | ||
|
||
driver.find_element(By.CSS_SELECTOR, "form button").click() | ||
driver.find_element(By.CSS_SELECTOR, "form button[type='submit']").click() | ||
|
||
# should not submit form | ||
self.assertEqual(driver.current_url, f"{self.live_server_url}{reverse('auth:login')}") | ||
|
@@ -312,7 +310,7 @@ def test_user_empty_credentials_should_see_password_reset_message(self): | |
driver.find_element(By.CSS_SELECTOR, "input#id_username").send_keys("[email protected]") | ||
driver.find_element(By.CSS_SELECTOR, "input#id_password").send_keys("password") | ||
|
||
driver.find_element(By.CSS_SELECTOR, "form button").click() | ||
driver.find_element(By.CSS_SELECTOR, "form button[type='submit']").click() | ||
|
||
# should not submit form | ||
self.assertEqual(driver.current_url, f"{self.live_server_url}{reverse('auth:login')}") | ||
|