From 8a18dbe064ebe50feaa10d62d98db3a22255c680 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 4 Dec 2023 12:17:37 +0100 Subject: [PATCH] MDL-80313 mod_forum: Fix a few steps to use :checked pseudo element Not sure why the [checked=checked] was working ok, but everywhere I have looked out there show examples about :checked (and :not(:checked) being the correct way to use CSS Selectors that are converted to working XPath expressions. Curiously, it's only for NonJS steps, JS one already were using another syntax, just [checked]. --- .../behat/forum_subscriptions_default.feature | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mod/forum/tests/behat/forum_subscriptions_default.feature b/mod/forum/tests/behat/forum_subscriptions_default.feature index 965ed07e05b..2a15ba92f86 100644 --- a/mod/forum/tests/behat/forum_subscriptions_default.feature +++ b/mod/forum/tests/behat/forum_subscriptions_default.feature @@ -28,11 +28,11 @@ Feature: A user can control their default discussion subscription settings Given I am on the "Test forum name" "forum activity" page logged in as student1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" - Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist + Then "input[name=discussionsubscribe]:checked" "css_element" should exist And I am on the "Test forum name" "forum activity" page logged in as student2 And I click on "Add discussion topic" "link" And I click on "Advanced" "button" - And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist + And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist Scenario: Replying to an existing discussion in an optional forum follows user preferences Given the following forum discussions exist in course "Course 1": @@ -41,11 +41,11 @@ Feature: A user can control their default discussion subscription settings And I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Test post subject" When I follow "Reply" - Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist + Then "input[name=discussionsubscribe]:checked" "css_element" should exist And I am on the "Test forum name" "forum activity" page logged in as student2 And I follow "Test post subject" And I follow "Reply" - And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist + And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist Scenario: Creating a new discussion in an automatic forum follows forum subscription Given I am on the "Test forum name" "forum activity editing" page logged in as admin @@ -55,11 +55,11 @@ Feature: A user can control their default discussion subscription settings And I am on the "Test forum name" "forum activity" page logged in as student1 When I click on "Add discussion topic" "link" And I click on "Advanced" "button" - Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist + Then "input[name=discussionsubscribe]:checked" "css_element" should exist And I am on the "Test forum name" "forum activity" page logged in as student2 And I click on "Add discussion topic" "link" And I click on "Advanced" "button" - And "input[name=discussionsubscribe][checked=checked]" "css_element" should exist + And "input[name=discussionsubscribe]:checked" "css_element" should exist Scenario: Replying to an existing discussion in an automatic forum follows forum subscription Given the following forum discussions exist in course "Course 1": @@ -72,11 +72,11 @@ Feature: A user can control their default discussion subscription settings And I am on the "Test forum name" "forum activity" page logged in as student1 And I follow "Test post subject" When I follow "Reply" - Then "input[name=discussionsubscribe][checked=checked]" "css_element" should exist + Then "input[name=discussionsubscribe]:checked" "css_element" should exist And I am on the "Test forum name" "forum activity" page logged in as student2 And I follow "Test post subject" And I follow "Reply" - And "input[name=discussionsubscribe]:not([checked=checked])" "css_element" should exist + And "input[name=discussionsubscribe]:not(:checked)" "css_element" should exist @javascript Scenario: Replying to an existing discussion in an automatic forum which has been unsubscribed from follows user preferences